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 |
|---|---|---|---|---|---|---|---|---|---|---|
50ebf1fdca04c6472f9c1d1eef0b6c2341ecaafa | packages/jest-fela-bindings/src/createSnapshotFactory.js | packages/jest-fela-bindings/src/createSnapshotFactory.js | import { format } from 'prettier'
import HTMLtoJSX from 'htmltojsx'
import { renderToString } from 'fela-tools'
import type { DOMRenderer } from '../../../flowtypes/DOMRenderer'
function formatCSS(css) {
return format(css, { parser: 'css', useTabs: false, tabWidth: 2 })
}
function formatHTML(html) {
const converter = new HTMLtoJSX({
createClass: false,
})
const jsx = converter.convert(html)
return format(jsx, { parser: 'babylon' }).replace(/[\\"]/g, '')
}
export default function createSnapshotFactory(
createElement: Function,
render: Function,
defaultRenderer: Function,
defaultRendererProvider: Function,
defaultThemeProvider: Function
): Function {
return function createSnapshot(
component: any,
theme: Object = {},
renderer: DOMRenderer = defaultRenderer,
RendererProvider: Function = defaultRendererProvider,
ThemeProvider: Function = defaultThemeProvider
) {
const div = document.createElement('div')
// reset renderer to have a clean setup
renderer.clear()
render(
createElement(
RendererProvider,
{ renderer },
createElement(ThemeProvider, { theme }, component)
),
div
)
return `${formatCSS(renderToString(renderer))}\n\n${formatHTML(
div.innerHTML
)}`
}
}
| import { format } from 'prettier'
import HTMLtoJSX from 'htmltojsx'
import { renderToString } from 'fela-tools'
import type { DOMRenderer } from '../../../flowtypes/DOMRenderer'
function formatCSS(css) {
return format(css, { parser: 'css', useTabs: false, tabWidth: 2 })
}
function formatHTML(html) {
const converter = new HTMLtoJSX({
createClass: false,
})
const jsx = converter.convert(html)
return format(jsx, { parser: 'babel' }).replace(/[\\"]/g, '')
}
export default function createSnapshotFactory(
createElement: Function,
render: Function,
defaultRenderer: Function,
defaultRendererProvider: Function,
defaultThemeProvider: Function
): Function {
return function createSnapshot(
component: any,
theme: Object = {},
renderer: DOMRenderer = defaultRenderer,
RendererProvider: Function = defaultRendererProvider,
ThemeProvider: Function = defaultThemeProvider
) {
const div = document.createElement('div')
// reset renderer to have a clean setup
renderer.clear()
render(
createElement(
RendererProvider,
{ renderer },
createElement(ThemeProvider, { theme }, component)
),
div
)
return `${formatCSS(renderToString(renderer))}\n\n${formatHTML(
div.innerHTML
)}`
}
}
| Use 'babel' Prettier parser instead of deprecated 'bablyon'. | Use 'babel' Prettier parser instead of deprecated 'bablyon'.
As per warning when using jest-react-fela.
console.warn node_modules/prettier/index.js:7939
{ parser: "babylon" } is deprecated; we now treat it as { parser:
"babel" }.
| JavaScript | mit | rofrischmann/fela,risetechnologies/fela,risetechnologies/fela,rofrischmann/fela,risetechnologies/fela,rofrischmann/fela | ---
+++
@@ -15,7 +15,7 @@
})
const jsx = converter.convert(html)
- return format(jsx, { parser: 'babylon' }).replace(/[\\"]/g, '')
+ return format(jsx, { parser: 'babel' }).replace(/[\\"]/g, '')
}
export default function createSnapshotFactory( |
0f875085def889ae65b834c15f56109fc2363e7a | packages/bpk-docs/src/pages/ShadowsPage/ShadowsPage.js | packages/bpk-docs/src/pages/ShadowsPage/ShadowsPage.js | /*
* Backpack - Skyscanner's Design System
*
* Copyright 2017 Skyscanner Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import TOKENS from 'bpk-tokens/tokens/base.raw.json';
import IOS_TOKENS from 'bpk-tokens/tokens/ios/base.raw.json';
import ANDROID_TOKENS from 'bpk-tokens/tokens/android/base.raw.json';
import DocsPageBuilder from './../../components/DocsPageBuilder';
import { getPlatformTokens } from './../../helpers/tokens-helper';
const ShadowsPage = () => <DocsPageBuilder
title="Shadows"
tokenMap={getPlatformTokens(TOKENS, IOS_TOKENS, ANDROID_TOKENS, ({ category }) => category === 'box-shadows')}
/>;
export default ShadowsPage;
| /*
* Backpack - Skyscanner's Design System
*
* Copyright 2017 Skyscanner Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import TOKENS from 'bpk-tokens/tokens/base.raw.json';
import IOS_TOKENS from 'bpk-tokens/tokens/ios/base.raw.json';
import ANDROID_TOKENS from 'bpk-tokens/tokens/android/base.raw.json';
import DocsPageBuilder from './../../components/DocsPageBuilder';
import { getPlatformTokens } from './../../helpers/tokens-helper';
const ShadowsPage = () => <DocsPageBuilder
title="Shadows"
tokenMap={getPlatformTokens(
TOKENS, IOS_TOKENS, ANDROID_TOKENS, ({ category }) => ['box-shadows', 'elevation'].includes(category),
)}
/>;
export default ShadowsPage;
| Add elevation tokens under shadows | [BPK-1053] Add elevation tokens under shadows
| JavaScript | apache-2.0 | Skyscanner/backpack,Skyscanner/backpack,Skyscanner/backpack | ---
+++
@@ -26,7 +26,9 @@
const ShadowsPage = () => <DocsPageBuilder
title="Shadows"
- tokenMap={getPlatformTokens(TOKENS, IOS_TOKENS, ANDROID_TOKENS, ({ category }) => category === 'box-shadows')}
+ tokenMap={getPlatformTokens(
+ TOKENS, IOS_TOKENS, ANDROID_TOKENS, ({ category }) => ['box-shadows', 'elevation'].includes(category),
+ )}
/>;
export default ShadowsPage; |
577b1add3cd2804dbf4555b0cbadd45f8f3be761 | .github/actions/change-release-intent/main.js | .github/actions/change-release-intent/main.js | const { exec } = require('@actions/exec');
const getWorkspaces = require('get-workspaces').default;
async function execWithOutput(command, args, options) {
let myOutput = '';
let myError = '';
return {
code: await exec(command, args, {
listeners: {
stdout: data => {
myOutput += data.toString();
},
stderr: data => {
myError += data.toString();
}
},
...options
}),
stdout: myOutput,
stderr: myError
};
}
const publishablePackages = ['xstate', '@xstate/fsm', '@xstate/test'];
(async () => {
const currentBranchName = (await execWithOutput('git', [
'rev-parse',
'--abbrev-ref',
'HEAD'
])).stdout.trim();
if (!/^changeset-release\//.test(currentBranchName)) {
return;
}
const latestCommitMessage = (await execWithOutput('git', [
'log',
'-1',
'--pretty=%B'
])).stdout.trim();
await exec('git', ['reset', '--mixed', 'HEAD~1']);
const workspaces = await getWorkspaces();
for (let workspace of workspaces) {
if (publishablePackages.includes(workspace.name)) {
continue;
}
await exec('git', ['checkout', '--', workspace.dir]);
}
await exec('git', ['add', '.']);
await exec('git', ['commit', '-m', latestCommitMessage]);
await exec('git', ['push', 'origin', currentBranchName, '--force']);
})();
| const { exec } = require('@actions/exec');
const getWorkspaces = require('get-workspaces').default;
async function execWithOutput(command, args, options) {
let myOutput = '';
let myError = '';
return {
code: await exec(command, args, {
listeners: {
stdout: data => {
myOutput += data.toString();
},
stderr: data => {
myError += data.toString();
}
},
...options
}),
stdout: myOutput,
stderr: myError
};
}
const publishablePackages = [
'xstate',
'@xstate/fsm',
'@xstate/test',
'@xstate/vue'
];
(async () => {
const currentBranchName = (await execWithOutput('git', [
'rev-parse',
'--abbrev-ref',
'HEAD'
])).stdout.trim();
if (!/^changeset-release\//.test(currentBranchName)) {
return;
}
const latestCommitMessage = (await execWithOutput('git', [
'log',
'-1',
'--pretty=%B'
])).stdout.trim();
await exec('git', ['reset', '--mixed', 'HEAD~1']);
const workspaces = await getWorkspaces();
for (let workspace of workspaces) {
if (publishablePackages.includes(workspace.name)) {
continue;
}
await exec('git', ['checkout', '--', workspace.dir]);
}
await exec('git', ['add', '.']);
await exec('git', ['commit', '-m', latestCommitMessage]);
await exec('git', ['push', 'origin', currentBranchName, '--force']);
})();
| Add @xstate/vue to publishable packages | Add @xstate/vue to publishable packages
| JavaScript | mit | davidkpiano/xstate,davidkpiano/xstate,davidkpiano/xstate | ---
+++
@@ -23,7 +23,12 @@
};
}
-const publishablePackages = ['xstate', '@xstate/fsm', '@xstate/test'];
+const publishablePackages = [
+ 'xstate',
+ '@xstate/fsm',
+ '@xstate/test',
+ '@xstate/vue'
+];
(async () => {
const currentBranchName = (await execWithOutput('git', [ |
2a9b5a4077ea3d965b6994c9d432c3d98dc839ca | app/components/Settings/EncryptQR/index.js | app/components/Settings/EncryptQR/index.js | // @flow
import { connect } from 'react-redux'
import { compose } from 'recompose'
import { getEncryptedWIF } from '../../../modules/generateEncryptedWIF'
import EncryptQR from './EncryptQR'
const mapStateToProps = (state: Object) => ({
encryptedWIF: getEncryptedWIF(state),
})
export default compose(connect(mapStateToProps))(EncryptQR)
| // @flow
import { connect } from 'react-redux'
import { getEncryptedWIF } from '../../../modules/generateEncryptedWIF'
import EncryptQR from './EncryptQR'
const mapStateToProps = (state: Object) => ({
encryptedWIF: getEncryptedWIF(state),
})
export default connect(
mapStateToProps,
(dispatch: Dispatch) => ({ dispatch }),
)(EncryptQR)
| Fix yarn type annotation error | Fix yarn type annotation error
| JavaScript | mit | hbibkrim/neon-wallet,CityOfZion/neon-wallet,CityOfZion/neon-wallet,hbibkrim/neon-wallet,CityOfZion/neon-wallet | ---
+++
@@ -1,13 +1,14 @@
// @flow
import { connect } from 'react-redux'
-import { compose } from 'recompose'
import { getEncryptedWIF } from '../../../modules/generateEncryptedWIF'
-
import EncryptQR from './EncryptQR'
const mapStateToProps = (state: Object) => ({
encryptedWIF: getEncryptedWIF(state),
})
-export default compose(connect(mapStateToProps))(EncryptQR)
+export default connect(
+ mapStateToProps,
+ (dispatch: Dispatch) => ({ dispatch }),
+)(EncryptQR) |
775ac532cd1fab831b679955226e205c97dceaf0 | novaform/lib/resources/iam.js | novaform/lib/resources/iam.js | var AWSResource = require('../awsresource')
, types = require('../types');
var Role = AWSResource.define('AWS::IAM::Role', {
AssumeRolePolicyDocument : { type: types.object('iam-assume-role-policy-document'), required: true },
Path : { type: types.string, required: true },
Policies : { type: types.array },
});
var Policy = AWSResource.define('AWS::IAM::Policy', {
Groups : { type: types.array, required: 'conditional' },
PolicyDocument : { type: types.object('iam-policy-document'), required: true },
PolicyName : { type: types.string, required: true },
Roles : { type: types.array },
Users : { type: types.array, required: 'conditional' },
});
function PathValidator(self) {
// TODO: Half assed solution. Path can be a fn.Join for eg.
if (typeof self.properties.Path === 'string' && !/^\/[a-zA-Z0-9+=,.@_\-\/]*\/$/.test(self.properties.Path)) {
return 'Path can contain only alphanumeric characters and / and begin and end with /';
};
}
var InstanceProfile = AWSResource.define('AWS::IAM::InstanceProfile', {
Path : { type: types.string, required: true, validators: [PathValidator] },
Roles : { type: types.array, required: true },
});
module.exports = {
Role: Role,
Policy: Policy,
InstanceProfile: InstanceProfile
};
| var AWSResource = require('../awsresource')
, types = require('../types');
var Role = AWSResource.define('AWS::IAM::Role', {
AssumeRolePolicyDocument : { type: types.object('iam-assume-role-policy-document'), required: true },
ManagedPolicyArns: { type: types.array },
Path : { type: types.string },
Policies : { type: types.array },
});
var Policy = AWSResource.define('AWS::IAM::Policy', {
Groups : { type: types.array, required: 'conditional' },
PolicyDocument : { type: types.object('iam-policy-document'), required: true },
PolicyName : { type: types.string, required: true },
Roles : { type: types.array },
Users : { type: types.array, required: 'conditional' },
});
function PathValidator(self) {
// TODO: Half assed solution. Path can be a fn.Join for eg.
if (typeof self.properties.Path === 'string' && !/^\/[a-zA-Z0-9+=,.@_\-\/]*\/$/.test(self.properties.Path)) {
return 'Path can contain only alphanumeric characters and / and begin and end with /';
};
}
var InstanceProfile = AWSResource.define('AWS::IAM::InstanceProfile', {
Path : { type: types.string, required: true, validators: [PathValidator] },
Roles : { type: types.array, required: true },
});
module.exports = {
Role: Role,
Policy: Policy,
InstanceProfile: InstanceProfile
};
| Update IAM Role cfn resource | Update IAM Role cfn resource
| JavaScript | apache-2.0 | aliak00/kosmo,comoyo/nova,comoyo/nova,aliak00/kosmo | ---
+++
@@ -3,7 +3,8 @@
var Role = AWSResource.define('AWS::IAM::Role', {
AssumeRolePolicyDocument : { type: types.object('iam-assume-role-policy-document'), required: true },
- Path : { type: types.string, required: true },
+ ManagedPolicyArns: { type: types.array },
+ Path : { type: types.string },
Policies : { type: types.array },
});
|
d1909fc22d1c94772b51c9fb1841c4c5c10808a1 | src/device-types/device-type.js | src/device-types/device-type.js | /**
* Copyright 2019, Google, Inc.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export class DeviceType {
valuesArray;
genUuid() {
return Math.floor((Math.random()) * 100000).toString(36)
}
getNicknames(element, type) {
return element ? element.nicknames : [`Smart ${type}`];
}
getRoomHint(element) {
return element ? element.roomHint : '';
}
} | /**
* Copyright 2019, Google, Inc.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export class DeviceType {
constructor() {
this.valuesArray = []
}
genUuid() {
return Math.floor((Math.random()) * 100000).toString(36)
}
getNicknames(element, type) {
return element ? element.nicknames : [`Smart ${type}`];
}
getRoomHint(element) {
return element ? element.roomHint : '';
}
} | Move DeviceType valuesArray to constructor | Move DeviceType valuesArray to constructor
classProperties is not enabled for Polymer compiler
See: https://github.com/Polymer/tools/issues/3360
Bug: 137847631
Change-Id: Iae68919462765e9672539fbc68c14fa9818ea163
| JavaScript | apache-2.0 | actions-on-google/smart-home-frontend,actions-on-google/smart-home-frontend | ---
+++
@@ -12,7 +12,9 @@
*/
export class DeviceType {
- valuesArray;
+ constructor() {
+ this.valuesArray = []
+ }
genUuid() {
return Math.floor((Math.random()) * 100000).toString(36) |
f86c39497502954b6973702cf090e76fa3ddf463 | lib/behavior/events.js | lib/behavior/events.js | events = {};
events.beforeInsert = function() {
// Find a class on which the behavior had been set.
var behaviorData = Astro.utils.behaviors.findBehavior(this.constructor, 'timestamp');
// If the "hasCreatedField" option is set.
if (behaviorData.hasCreatedField) {
// Set value for created field.
this.set(behaviorData.createdFieldName, new Date());
}
};
events.beforeUpdate = function() {
// Find a class on which the behavior had been set.
var behaviorData = Astro.utils.behaviors.findBehavior(this.constructor, 'timestamp');
// If the "hasUpdatedField" option is set.
if (behaviorData.hasUpdatedField) {
// We only set the "updatedAt" field if there are any changes.
if (_.size(this.getModified())) {
// Set value for the "updatedAt" field.
this.set(behaviorData.updatedFieldName, new Date());
}
}
};
| events = {};
events.beforeInsert = function() {
var doc = this;
var Class = doc.constructor;
// Find a class on which the behavior had been set.
var behaviorData = Astro.utils.behaviors.findBehavior(
Class,
'timestamp'
);
// Get current date.
var date = new Date();
// If the "hasCreatedField" option is set.
if (behaviorData.hasCreatedField) {
// Set value for created field.
this.set(behaviorData.createdFieldName, date);
}
if (behaviorData.hasUpdatedField) {
// Set value for the "updatedAt" field.
this.set(behaviorData.updatedFieldName, date);
}
};
events.beforeUpdate = function() {
var doc = this;
var Class = doc.constructor;
// Find a class on which the behavior had been set.
var behaviorData = Astro.utils.behaviors.findBehavior(
Class,
'timestamp'
);
// If the "hasUpdatedField" option is set.
if (behaviorData.hasUpdatedField) {
// We only set the "updatedAt" field if there are any changes.
if (_.size(this.getModified())) {
// Set value for the "updatedAt" field.
this.set(behaviorData.updatedFieldName, new Date());
}
}
};
| Set updatedAt field on insertion | Set updatedAt field on insertion
| JavaScript | mit | jagi/meteor-astronomy-timestamp-behavior | ---
+++
@@ -1,19 +1,39 @@
events = {};
events.beforeInsert = function() {
+ var doc = this;
+ var Class = doc.constructor;
+
// Find a class on which the behavior had been set.
- var behaviorData = Astro.utils.behaviors.findBehavior(this.constructor, 'timestamp');
+ var behaviorData = Astro.utils.behaviors.findBehavior(
+ Class,
+ 'timestamp'
+ );
+
+ // Get current date.
+ var date = new Date();
// If the "hasCreatedField" option is set.
if (behaviorData.hasCreatedField) {
// Set value for created field.
- this.set(behaviorData.createdFieldName, new Date());
+ this.set(behaviorData.createdFieldName, date);
+ }
+
+ if (behaviorData.hasUpdatedField) {
+ // Set value for the "updatedAt" field.
+ this.set(behaviorData.updatedFieldName, date);
}
};
events.beforeUpdate = function() {
+ var doc = this;
+ var Class = doc.constructor;
+
// Find a class on which the behavior had been set.
- var behaviorData = Astro.utils.behaviors.findBehavior(this.constructor, 'timestamp');
+ var behaviorData = Astro.utils.behaviors.findBehavior(
+ Class,
+ 'timestamp'
+ );
// If the "hasUpdatedField" option is set.
if (behaviorData.hasUpdatedField) { |
17096bf54d0692abf2fc22b497b7ebc2cbb217a2 | packages/extract-css/index.js | packages/extract-css/index.js | 'use strict';
var assert = require('assert'),
Batch = require('batch'),
getStylesData = require('style-data'),
getStylesheetList = require('list-stylesheets'),
getHrefContent = require('href-content');
module.exports = function (html, options, callback) {
var batch = new Batch(),
data = getStylesheetList(html, options);
batch.push(function (cb) {
getStylesData(data.html, options, cb);
});
if (data.hrefs.length) {
assert.ok(options.url, 'options.url is required');
}
data.hrefs.forEach(function (stylesheetHref) {
batch.push(function (cb) {
getHrefContent(stylesheetHref, options.url, cb);
});
});
batch.end(function (err, results) {
if (err) {
return callback(err);
}
var stylesData = results.shift(),
css;
results.forEach(function (content) {
stylesData.css.push(content);
});
css = stylesData.css.join('\n');
callback(null, stylesData.html, css);
});
};
| 'use strict';
var assert = require('assert'),
Batch = require('batch'),
getStylesData = require('style-data'),
getStylesheetList = require('list-stylesheets'),
getHrefContent = require('href-content');
module.exports = function (html, options, callback) {
var batch = new Batch(),
data = getStylesheetList(html, options);
batch.push(function (cb) {
getStylesData(data.html, options, cb);
});
if (data.hrefs.length) {
assert.ok(options.url, 'options.url is required');
}
data.hrefs.forEach(function (stylesheetHref) {
batch.push(function (cb) {
getHrefContent(stylesheetHref, options.url, cb);
});
});
batch.end(function (err, results) {
var stylesData,
css;
if (err) {
return callback(err);
}
stylesData = results.shift();
results.forEach(function (content) {
stylesData.css.push(content);
});
css = stylesData.css.join('\n');
callback(null, stylesData.html, css);
});
};
| Move var declarations to the top. | Move var declarations to the top.
| JavaScript | mit | jonkemp/inline-css,jonkemp/inline-css | ---
+++
@@ -22,12 +22,14 @@
});
});
batch.end(function (err, results) {
+ var stylesData,
+ css;
+
if (err) {
return callback(err);
}
- var stylesData = results.shift(),
- css;
+ stylesData = results.shift();
results.forEach(function (content) {
stylesData.css.push(content); |
3d28029aaed853c2a20e289548fea4a325e8d867 | src/modules/api/models/Media.js | src/modules/api/models/Media.js | /* global require, module, process, console, __dirname */
/* jshint -W097 */
var
mongoose = require('mongoose'),
Schema = mongoose.Schema;
var MediaSchema = new Schema({
name: String,
description: String,
url: String,
active: Boolean
});
module.exports = mongoose.model('Media', MediaSchema);
| /* global require, module, process, console, __dirname */
/* jshint -W097 */
'use strict';
var
mongoose = require('mongoose'),
Schema = mongoose.Schema;
var MediaSchema = new Schema({
name: String,
description: String,
url: String,
active: Boolean
});
module.exports = mongoose.model('Media', MediaSchema);
| Add missing 'use strict' declaration | style: Add missing 'use strict' declaration
| JavaScript | mit | mosaiqo/frontend-devServer | ---
+++
@@ -1,5 +1,7 @@
/* global require, module, process, console, __dirname */
/* jshint -W097 */
+'use strict';
+
var
mongoose = require('mongoose'),
Schema = mongoose.Schema; |
c28b11a967befef52d4378f4ee2c74e805ce8774 | waveform.js | waveform.js | var rows = 0;
var cols = 10;
var table;
var edit_border = "thin dotted grey";
function text(str)
{
return document.createTextNode(str);
}
function cellContents(rowindex, colindex)
{
return " ";
}
function init()
{
table = document.getElementById("wftable");
addRows(4);
}
function addRows(numrows)
{
numrows += rows;
if (table.tBodies.length < 1) {
table.appendChild(document.createElement('tbody'));
}
for (; rows < numrows; rows++) {
table.tBodies[table.tBodies.length - 1].appendChild(text("\n"));
var row = table.insertRow(-1);
row.appendChild(text("\n"));
for (c = 0; c < cols; c++) {
var cell = row.insertCell(-1);
cell.innerHTML = cellContents(rows, c);
cell.style.border = edit_border;
row.appendChild(text("\n"));
}
}
}
function addCols(numcols)
{
cols += numcols;
for (r = 0; r < rows; r++) {
var row = table.rows[r];
for (c = row.cells.length; c < cols; c++) {
var cell = row.insertCell(-1);
cell.innerHTML = cellContents(r, c);
cell.style.border = edit_border;
row.appendChild(text("\n"));
}
}
}
| var rows = 0;
var cols = 10;
var table;
var edit_border = "thin dotted lightgrey";
function text(str)
{
return document.createTextNode(str);
}
function cellContents(rowindex, colindex)
{
return " ";
}
function init()
{
table = document.getElementById("wftable");
addRows(4);
}
function addRows(numrows)
{
numrows += rows;
if (table.tBodies.length < 1) {
table.appendChild(document.createElement('tbody'));
}
for (; rows < numrows; rows++) {
table.tBodies[table.tBodies.length - 1].appendChild(text("\n"));
var row = table.insertRow(-1);
row.appendChild(text("\n"));
for (c = 0; c < cols; c++) {
var cell = row.insertCell(-1);
cell.innerHTML = cellContents(rows, c);
cell.style.border = edit_border;
row.appendChild(text("\n"));
}
}
}
function addCols(numcols)
{
cols += numcols;
for (r = 0; r < rows; r++) {
var row = table.rows[r];
for (c = row.cells.length; c < cols; c++) {
var cell = row.insertCell(-1);
cell.innerHTML = cellContents(r, c);
cell.style.border = edit_border;
row.appendChild(text("\n"));
}
}
}
| Set editing border color to lightgrey | Set editing border color to lightgrey
| JavaScript | mit | seemuth/waveforms | ---
+++
@@ -1,7 +1,7 @@
var rows = 0;
var cols = 10;
var table;
-var edit_border = "thin dotted grey";
+var edit_border = "thin dotted lightgrey";
function text(str)
{ |
88f9da77f9865f1f093792bf4dace8ea5ab59d8b | frontend/frontend.js | frontend/frontend.js | $(document).ready(function(){
$("#related").click(function(){
$.post("http://localhost:8080/dummy_backend.php",
{
related: "true"
},
function(){
});
//alert("post sent");
});
$("#unrelated").click(function(){
$.post("http://localhost:8080/dummy_backend.php",
{
related: "false"
},
function(){
});
});
});
| $(document).ready(function(){
$("#related").click(function(){
$.post("http://localhost:8080/",
{
'action': 'my_action',
'related': "true"
'individual': 0,//update code for Id
},
function(){
});
//alert("post sent");
});
$("#unrelated").click(function(){
$.post("http://localhost:8080/",
{
'action': 'my_action',
'related': "false"
'individual': 0,//update code for Id
},
function(){
});
});
});
| Add wordpress and GA capabilities to JS | Add wordpress and GA capabilities to JS
| JavaScript | mit | BrandonBaucher/website-optimization,BrandonBaucher/website-optimization,BrandonBaucher/website-optimization,BrandonBaucher/website-optimization,BrandonBaucher/website-optimization | ---
+++
@@ -1,17 +1,21 @@
$(document).ready(function(){
$("#related").click(function(){
- $.post("http://localhost:8080/dummy_backend.php",
+ $.post("http://localhost:8080/",
{
- related: "true"
+ 'action': 'my_action',
+ 'related': "true"
+ 'individual': 0,//update code for Id
},
function(){
});
//alert("post sent");
});
$("#unrelated").click(function(){
- $.post("http://localhost:8080/dummy_backend.php",
+ $.post("http://localhost:8080/",
{
- related: "false"
+ 'action': 'my_action',
+ 'related': "false"
+ 'individual': 0,//update code for Id
},
function(){
}); |
a2c7b0b92c4d12e0a74397a8099c36bdde95a8ff | packages/shared/lib/helpers/string.js | packages/shared/lib/helpers/string.js | import getRandomValues from 'get-random-values';
export const getRandomString = (length) => {
const charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
let i;
let result = '';
const values = getRandomValues(new Uint32Array(length));
for (i = 0; i < length; i++) {
result += charset[values[i] % charset.length];
}
return result;
};
export const normalize = (value = '') => value.toLowerCase();
export const replaceLineBreak = (content = '') => content.replace(/(?:\r\n|\r|\n)/g, '<br />');
| import getRandomValues from 'get-random-values';
const CURRENCIES = {
USD: '$',
EUR: '€',
CHF: 'CHF'
};
export const getRandomString = (length) => {
const charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
let i;
let result = '';
const values = getRandomValues(new Uint32Array(length));
for (i = 0; i < length; i++) {
result += charset[values[i] % charset.length];
}
return result;
};
export const normalize = (value = '') => value.toLowerCase();
export const replaceLineBreak = (content = '') => content.replace(/(?:\r\n|\r|\n)/g, '<br />');
export const toPrice = (amount = 0, currency = 'EUR', divisor = 100) => {
const symbol = CURRENCIES[currency] || currency;
const value = Number(amount / divisor).toFixed(2);
const prefix = value < 0 ? '-' : '';
const absValue = Math.abs(value);
if (currency === 'USD') {
return `${prefix}${symbol}${absValue}`;
}
return `${prefix}${absValue} ${symbol}`;
};
| Add helper to format price value | Add helper to format price value
| JavaScript | mit | ProtonMail/WebClient,ProtonMail/WebClient,ProtonMail/WebClient | ---
+++
@@ -1,4 +1,10 @@
import getRandomValues from 'get-random-values';
+
+const CURRENCIES = {
+ USD: '$',
+ EUR: '€',
+ CHF: 'CHF'
+};
export const getRandomString = (length) => {
const charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
@@ -17,3 +23,16 @@
export const normalize = (value = '') => value.toLowerCase();
export const replaceLineBreak = (content = '') => content.replace(/(?:\r\n|\r|\n)/g, '<br />');
+
+export const toPrice = (amount = 0, currency = 'EUR', divisor = 100) => {
+ const symbol = CURRENCIES[currency] || currency;
+ const value = Number(amount / divisor).toFixed(2);
+ const prefix = value < 0 ? '-' : '';
+ const absValue = Math.abs(value);
+
+ if (currency === 'USD') {
+ return `${prefix}${symbol}${absValue}`;
+ }
+
+ return `${prefix}${absValue} ${symbol}`;
+}; |
2669a19d55bcc27ca8b9a47667e2664f24a8aadf | mix-write/index.js | mix-write/index.js | var File = require('vinyl');
var mix = require('mix');
var path = require('path');
var rimraf = require('rimraf');
var vfs = require('vinyl-fs');
module.exports = function (dir) {
var pending = [];
function schedule(work) {
pending.push(work);
if (pending.length === 1) {
performNext();
}
}
function performNext() {
var work = pending[0];
work(function () {
pending.splice(0, 1);
if (pending.length > 0) {
performNext();
}
});
}
function nodeToVinyl(node) {
return new File({
cwd: node.base,
base: node.base,
path: path.join(node.base, node.name),
stat: node.stat,
contents: node.data
});
}
return function (tree) {
return new mix.Stream(function (sink) {
schedule(function (done) {
rimraf(dir, function (error) {
if (!error) {
var stream = vfs.dest(dir);
tree.nodes.map(nodeToVinyl).forEach(function (file) {
stream.write(file);
});
stream.end();
console.log('TODO');
} else {
console.log(error);
sink.close();
done();
}
});
});
});
}
};
| var File = require('vinyl');
var mix = require('mix');
var path = require('path');
var rimraf = require('rimraf');
var vfs = require('vinyl-fs');
module.exports = function (dir) {
var pending = [];
function schedule(work) {
pending.push(work);
if (pending.length === 1) {
performNext();
}
}
function performNext() {
var work = pending[0];
work(function () {
pending.splice(0, 1);
if (pending.length > 0) {
performNext();
}
});
}
function nodeToVinyl(node) {
return new File({
cwd: node.base,
base: node.base,
path: path.join(node.base, node.name),
stat: node.stat,
contents: node.data
});
}
return function (tree) {
return new mix.Stream(function (sink) {
schedule(function (done) {
rimraf(dir, function (error) {
if (error) {
console.log(error);
sink.close();
done();
}
var stream = vfs.dest(dir);
tree.nodes.map(nodeToVinyl).forEach(function (file) {
stream.write(file);
});
stream.end();
stream.on('finish', function () {
sink.close(tree);
done();
});
stream.on('error', function (error) {
console.log(error);
sink.close();
done();
});
});
});
});
}
};
| Implement remainder of the write plugin | Implement remainder of the write plugin
| JavaScript | mit | byggjs/bygg,byggjs/bygg-plugins | ---
+++
@@ -38,18 +38,26 @@
return new mix.Stream(function (sink) {
schedule(function (done) {
rimraf(dir, function (error) {
- if (!error) {
- var stream = vfs.dest(dir);
- tree.nodes.map(nodeToVinyl).forEach(function (file) {
- stream.write(file);
- });
- stream.end();
- console.log('TODO');
- } else {
+ if (error) {
console.log(error);
sink.close();
done();
}
+
+ var stream = vfs.dest(dir);
+ tree.nodes.map(nodeToVinyl).forEach(function (file) {
+ stream.write(file);
+ });
+ stream.end();
+ stream.on('finish', function () {
+ sink.close(tree);
+ done();
+ });
+ stream.on('error', function (error) {
+ console.log(error);
+ sink.close();
+ done();
+ });
});
});
}); |
2a75bf909aadb7cb754e40ff56da1ac19fbc6533 | src/rules/order-alphabetical.js | src/rules/order-alphabetical.js | /*
* Rule: All properties should be in alphabetical order..
*/
/*global CSSLint*/
CSSLint.addRule({
//rule information
id: "order-alphabetical",
name: "Alphabetical order",
desc: "Assure properties are in alphabetical order",
browsers: "All",
//initialization
init: function(parser, reporter){
"use strict";
var rule = this,
properties;
var startRule = function () {
properties = [];
};
parser.addListener("startrule", startRule);
parser.addListener("startfontface", startRule);
parser.addListener("startpage", startRule);
parser.addListener("startpagemargin", startRule);
parser.addListener("startkeyframerule", startRule);
parser.addListener("property", function(event){
var name = event.property.text,
lowerCasePrefixLessName = name.toLowerCase().replace(/^-.*?-/, "");
properties.push(lowerCasePrefixLessName);
});
parser.addListener("endrule", function(event){
var currentProperties = properties.join(","),
expectedProperties = properties.sort().join(",");
if (currentProperties !== expectedProperties){
reporter.report("Rule doesn't have all its properties in alphabetical ordered.", event.line, event.col, rule);
}
});
}
});
| /*
* Rule: All properties should be in alphabetical order..
*/
/*global CSSLint*/
CSSLint.addRule({
//rule information
id: "order-alphabetical",
name: "Alphabetical order",
desc: "Assure properties are in alphabetical order",
browsers: "All",
//initialization
init: function(parser, reporter){
"use strict";
var rule = this,
properties;
var startRule = function () {
properties = [];
};
var endRule = function(event){
var currentProperties = properties.join(","),
expectedProperties = properties.sort().join(",");
if (currentProperties !== expectedProperties){
reporter.report("Rule doesn't have all its properties in alphabetical ordered.", event.line, event.col, rule);
}
};
parser.addListener("startrule", startRule);
parser.addListener("startfontface", startRule);
parser.addListener("startpage", startRule);
parser.addListener("startpagemargin", startRule);
parser.addListener("startkeyframerule", startRule);
parser.addListener("startviewport", startRule);
parser.addListener("property", function(event){
var name = event.property.text,
lowerCasePrefixLessName = name.toLowerCase().replace(/^-.*?-/, "");
properties.push(lowerCasePrefixLessName);
});
parser.addListener("endrule", endRule);
parser.addListener("endfontface", endRule);
parser.addListener("endpage", endRule);
parser.addListener("endpagemargin", endRule);
parser.addListener("endkeyframerule", endRule);
parser.addListener("endviewport", endRule);
}
});
| Order Aphabetical: Add listeners for at-rules | Order Aphabetical: Add listeners for at-rules
Viewport was completely missing, but the others were also not reporting
at the end of the rule scope
| JavaScript | mit | YanickNorman/csslint,SimenB/csslint,lovemeblender/csslint,malept/csslint,codeclimate/csslint,dashk/csslint,SimenB/csslint,scott1028/csslint,Arcanemagus/csslint,sergeychernyshev/csslint,scott1028/csslint,malept/csslint,codeclimate/csslint,lovemeblender/csslint,dashk/csslint,sergeychernyshev/csslint,YanickNorman/csslint,Arcanemagus/csslint | ---
+++
@@ -20,11 +20,21 @@
properties = [];
};
+ var endRule = function(event){
+ var currentProperties = properties.join(","),
+ expectedProperties = properties.sort().join(",");
+
+ if (currentProperties !== expectedProperties){
+ reporter.report("Rule doesn't have all its properties in alphabetical ordered.", event.line, event.col, rule);
+ }
+ };
+
parser.addListener("startrule", startRule);
parser.addListener("startfontface", startRule);
parser.addListener("startpage", startRule);
parser.addListener("startpagemargin", startRule);
parser.addListener("startkeyframerule", startRule);
+ parser.addListener("startviewport", startRule);
parser.addListener("property", function(event){
var name = event.property.text,
@@ -33,14 +43,12 @@
properties.push(lowerCasePrefixLessName);
});
- parser.addListener("endrule", function(event){
- var currentProperties = properties.join(","),
- expectedProperties = properties.sort().join(",");
-
- if (currentProperties !== expectedProperties){
- reporter.report("Rule doesn't have all its properties in alphabetical ordered.", event.line, event.col, rule);
- }
- });
+ parser.addListener("endrule", endRule);
+ parser.addListener("endfontface", endRule);
+ parser.addListener("endpage", endRule);
+ parser.addListener("endpagemargin", endRule);
+ parser.addListener("endkeyframerule", endRule);
+ parser.addListener("endviewport", endRule);
}
}); |
ff95ba59917460a3858883141c9f4dd3da8c8d40 | src/jobs/items/itemPrices.js | src/jobs/items/itemPrices.js | const mongo = require('../../helpers/mongo.js')
const api = require('../../helpers/api.js')
const async = require('gw2e-async-promises')
const transformPrices = require('./_transformPrices.js')
async function itemPrices (job, done) {
job.log(`Starting job`)
let prices = await api().commerce().prices().all()
let collection = mongo.collection('items')
job.log(`Fetched prices for ${prices.length} tradingpost items`)
let updateFunctions = prices.map(price => async () => {
// Find the item matching the price, update the price based on the first match
// and then overwrite the prices for all matches (= all languages)
let item = await collection.find({id: price.id, tradable: true}).limit(1).next()
if (!item) {
return
}
item = transformPrices(item, price)
await collection.updateMany({id: price.id}, {$set: item})
})
job.log(`Created update functions`)
await async.parallel(updateFunctions)
job.log(`Updated item prices`)
done()
}
module.exports = itemPrices
| const mongo = require('../../helpers/mongo.js')
const api = require('../../helpers/api.js')
const async = require('gw2e-async-promises')
const transformPrices = require('./_transformPrices.js')
const config = require('../../config/application.js')
async function itemPrices (job, done) {
job.log(`Starting job`)
let collection = mongo.collection('items')
let prices = await api().commerce().prices().all()
job.log(`Fetched prices for ${prices.length} tradingpost items`)
var items = await updatePrices(prices)
job.log(`Updated ${items.length} item prices`)
let updateFunctions = items.map(item =>
() => collection.updateMany({id: item.id}, {$set: item})
)
job.log(`Created update functions`)
await async.parallel(updateFunctions)
job.log(`Updated item prices`)
done()
}
async function updatePrices (prices) {
let collection = mongo.collection('items')
let items = await collection.find(
{id: {$in: prices.map(p => p.id)}, tradable: true, lang: config.server.defaultLanguage},
{_id: 0, id: 1, buy: 1, sell: 1, vendor_price: 1, craftingWithoutPrecursors: 1, crafting: 1}
).toArray()
let priceMap = {}
prices.map(price => priceMap[price.id] = price)
items = items.map(item => {
return {id: item.id, ...transformPrices(item, priceMap[item.id])}
})
return items
}
module.exports = itemPrices
| Clean up item price updating (1/2 runtime!) | Clean up item price updating (1/2 runtime!)
| JavaScript | agpl-3.0 | gw2efficiency/gw2-api.com | ---
+++
@@ -2,26 +2,21 @@
const api = require('../../helpers/api.js')
const async = require('gw2e-async-promises')
const transformPrices = require('./_transformPrices.js')
+const config = require('../../config/application.js')
async function itemPrices (job, done) {
job.log(`Starting job`)
+ let collection = mongo.collection('items')
let prices = await api().commerce().prices().all()
- let collection = mongo.collection('items')
job.log(`Fetched prices for ${prices.length} tradingpost items`)
- let updateFunctions = prices.map(price => async () => {
- // Find the item matching the price, update the price based on the first match
- // and then overwrite the prices for all matches (= all languages)
- let item = await collection.find({id: price.id, tradable: true}).limit(1).next()
+ var items = await updatePrices(prices)
+ job.log(`Updated ${items.length} item prices`)
- if (!item) {
- return
- }
-
- item = transformPrices(item, price)
- await collection.updateMany({id: price.id}, {$set: item})
- })
+ let updateFunctions = items.map(item =>
+ () => collection.updateMany({id: item.id}, {$set: item})
+ )
job.log(`Created update functions`)
await async.parallel(updateFunctions)
@@ -29,4 +24,22 @@
done()
}
+async function updatePrices (prices) {
+ let collection = mongo.collection('items')
+
+ let items = await collection.find(
+ {id: {$in: prices.map(p => p.id)}, tradable: true, lang: config.server.defaultLanguage},
+ {_id: 0, id: 1, buy: 1, sell: 1, vendor_price: 1, craftingWithoutPrecursors: 1, crafting: 1}
+ ).toArray()
+
+ let priceMap = {}
+ prices.map(price => priceMap[price.id] = price)
+
+ items = items.map(item => {
+ return {id: item.id, ...transformPrices(item, priceMap[item.id])}
+ })
+
+ return items
+}
+
module.exports = itemPrices |
7188b06d2a1168ce8950be9eff17253a0b10e09c | .eslintrc.js | .eslintrc.js | module.exports = {
root: true,
env: {
node: true,
"jest/globals": true
},
plugins: ["jest"],
'extends': [
'plugin:vue/essential',
'@vue/standard'
],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'vue/no-use-v-if-with-v-for': 'off',
'jest/no-disabled-tests': 'warn',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
'jest/prefer-to-have-length': 'warn',
'jest/valid-expect': 'error'
},
parserOptions: {
parser: 'babel-eslint'
}
}
| module.exports = {
root: true,
env: {
node: true,
"jest/globals": true
},
plugins: ["jest"],
'extends': [
'plugin:vue/essential',
'@vue/standard'
],
rules: {
'no-console': 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'vue/no-use-v-if-with-v-for': 'off',
'jest/no-disabled-tests': 'warn',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
'jest/prefer-to-have-length': 'warn',
'jest/valid-expect': 'error'
},
parserOptions: {
parser: 'babel-eslint'
}
}
| Remove no-console rule from estlint configuration | Remove no-console rule from estlint configuration
| JavaScript | agpl-3.0 | cgwire/kitsu,cgwire/kitsu | ---
+++
@@ -10,7 +10,7 @@
'@vue/standard'
],
rules: {
- 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
+ 'no-console': 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'vue/no-use-v-if-with-v-for': 'off',
'jest/no-disabled-tests': 'warn', |
cd27c9c88623f0659fb0a58b59add58e26461fb0 | src/store/modules/users.spec.js | src/store/modules/users.spec.js | const mockCreate = jest.fn()
jest.mock('@/services/api/users', () => ({ create: mockCreate }))
import { createStore } from '>/helpers'
describe('users', () => {
beforeEach(() => jest.resetModules())
let storeMocks
let store
beforeEach(() => {
storeMocks = {
auth: {
actions: {
login: jest.fn(),
},
},
}
store = createStore({
users: require('./users'),
...storeMocks,
})
})
it('can signup', async () => {
let signupData = { email: 'foo@foo.com', password: 'foo' }
mockCreate.mockImplementation(user => user)
await store.dispatch('users/signup', signupData)
expect(mockCreate).toBeCalledWith(signupData)
expect(storeMocks.auth.actions.login.mock.calls[0][1]).toEqual(signupData)
})
})
| const mockCreate = jest.fn()
jest.mock('@/services/api/users', () => ({ create: mockCreate }))
import { createStore } from '>/helpers'
describe('users', () => {
beforeEach(() => jest.resetModules())
let storeMocks
let store
beforeEach(() => {
storeMocks = {
auth: {
actions: {
login: jest.fn(),
},
},
}
store = createStore({
users: require('./users'),
...storeMocks,
})
})
it('can signup', async () => {
let signupData = { email: 'foo@foo.com', password: 'foo' }
mockCreate.mockImplementation(user => user)
await store.dispatch('users/signup', signupData)
expect(mockCreate).toBeCalledWith(signupData)
expect(storeMocks.auth.actions.login.mock.calls[0][1]).toEqual(signupData)
})
it('can get all entries', () => {
expect(store.getters['users/all']).toEqual([])
})
})
| Add basic users module test | Add basic users module test
| JavaScript | mit | yunity/foodsaving-frontend,yunity/karrot-frontend,yunity/karrot-frontend,yunity/foodsaving-frontend,yunity/karrot-frontend,yunity/karrot-frontend,yunity/foodsaving-frontend,yunity/foodsaving-frontend | ---
+++
@@ -29,4 +29,8 @@
expect(mockCreate).toBeCalledWith(signupData)
expect(storeMocks.auth.actions.login.mock.calls[0][1]).toEqual(signupData)
})
+
+ it('can get all entries', () => {
+ expect(store.getters['users/all']).toEqual([])
+ })
}) |
090b36392e1549c44108b300f3bb86bf72f79164 | .eslintrc.js | .eslintrc.js | module.exports = {
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": "eslint:recommended",
"parserOptions": {
"sourceType": "module"
},
"rules": {
"indent": [
"error",
4
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
]
}
}; | module.exports = {
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": "eslint:recommended",
"parserOptions": {
"sourceType": "module"
},
"rules": {
"indent": [
"error",
2
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
]
}
};
| Modify eslint rules; change indent spaces from 4 to 2 | Modify eslint rules; change indent spaces from 4 to 2
| JavaScript | apache-2.0 | ailijic/era-floor-time,ailijic/era-floor-time | ---
+++
@@ -11,7 +11,7 @@
"rules": {
"indent": [
"error",
- 4
+ 2
],
"linebreak-style": [
"error", |
5ae40aeffa9358825ce6043d4458130b45a090a7 | src/localization/currency.js | src/localization/currency.js | /**
* mSupply Mobile
* Sustainable Solutions (NZ) Ltd. 2020
*/
import currency from 'currency.js';
import { LANGUAGE_CODES } from '.';
const CURRENCY_CONFIGS = {
DEFAULT: {
decimal: '.',
separator: ',',
pattern: '!#',
symbol: '$',
formatWithSymbol: true,
},
[LANGUAGE_CODES.FRENCH]: {
decimal: ',',
separator: '.',
pattern: '#!',
symbol: 'CFA',
formatWithSymbol: true,
},
};
let currentLanguageCode = LANGUAGE_CODES.ENGLISH;
export const setCurrencyLocalisation = languageCode => {
currentLanguageCode = languageCode;
};
const getCurrencyConfig = () => CURRENCY_CONFIGS[currentLanguageCode] || CURRENCY_CONFIGS.DEFAULT;
export default value => currency(value, getCurrencyConfig());
| /**
* mSupply Mobile
* Sustainable Solutions (NZ) Ltd. 2020
*/
import currency from 'currency.js';
import { LANGUAGE_CODES } from '.';
const CURRENCY_CONFIGS = {
DEFAULT: {
decimal: '.',
separator: ',',
},
[LANGUAGE_CODES.FRENCH]: {
decimal: ',',
separator: '.',
},
};
let currentLanguageCode = LANGUAGE_CODES.ENGLISH;
export const setCurrencyLocalisation = languageCode => {
currentLanguageCode = languageCode;
};
const getCurrencyConfig = () => CURRENCY_CONFIGS[currentLanguageCode] || CURRENCY_CONFIGS.DEFAULT;
export default value => currency(value, getCurrencyConfig());
| Add remove formatting with symbol from Currency object | Add remove formatting with symbol from Currency object
| JavaScript | mit | sussol/mobile,sussol/mobile,sussol/mobile,sussol/mobile | ---
+++
@@ -10,16 +10,10 @@
DEFAULT: {
decimal: '.',
separator: ',',
- pattern: '!#',
- symbol: '$',
- formatWithSymbol: true,
},
[LANGUAGE_CODES.FRENCH]: {
decimal: ',',
separator: '.',
- pattern: '#!',
- symbol: 'CFA',
- formatWithSymbol: true,
},
};
|
0da9f19684e830eb0a704e973dfb8ec1358d6eaf | pixi/main.js | pixi/main.js | (function (PIXI) {
'use strict';
var stage = new PIXI.Stage(0x66FF99);
var renderer = PIXI.autoDetectRenderer(400, 300);
document.body.appendChild(renderer.view);
window.requestAnimationFrame(animate);
var texture = PIXI.Texture.fromImage('bunny.png');
var bunny = new PIXI.Sprite(texture);
bunny.anchor.x = 0.5;
bunny.anchor.y = 0.5;
bunny.position.x = 50;
bunny.position.y = 50;
stage.addChild(bunny);
function animate() {
window.requestAnimationFrame(animate);
bunny.rotation -= 0.05;
bunny.position.x += backAndForth(0, bunny.position.x, 400);
renderer.render(stage);
}
})(window.PIXI);
function backAndForth(lowest, current, highest) {
var threshold = 25;
this.forth = (typeof this.forth === 'undefined') ? true : this.forth;
this.forth = this.forth && current < highest - threshold || current < lowest + threshold;
return this.forth ? 1 : -1;
}
| (function (PIXI) {
'use strict';
var stage = new PIXI.Stage(0x66FF99);
var renderer = PIXI.autoDetectRenderer(400, 300);
document.body.appendChild(renderer.view);
window.requestAnimationFrame(animate);
var texture = PIXI.Texture.fromImage('bunny.png');
var bunny = new PIXI.Sprite(texture);
var direction = 1;
bunny.anchor.x = 0.5;
bunny.anchor.y = 0.5;
bunny.position.x = 50;
bunny.position.y = 50;
stage.addChild(bunny);
function animate() {
window.requestAnimationFrame(animate);
direction = backAndForth(0, bunny.position.x, 400);
bunny.rotation += direction * 0.05;
bunny.position.x += direction * 1;
renderer.render(stage);
}
})(window.PIXI);
function backAndForth(lowest, current, highest) {
var threshold = 25;
this.forth = (typeof this.forth === 'undefined') ? true : this.forth;
this.forth = this.forth && current < highest - threshold || current < lowest + threshold;
return this.forth ? 1 : -1;
}
| Make the rotating direction go back and forth | Make the rotating direction go back and forth
| JavaScript | isc | ThibWeb/browser-games,ThibWeb/browser-games | ---
+++
@@ -10,6 +10,8 @@
var texture = PIXI.Texture.fromImage('bunny.png');
var bunny = new PIXI.Sprite(texture);
+ var direction = 1;
+
bunny.anchor.x = 0.5;
bunny.anchor.y = 0.5;
bunny.position.x = 50;
@@ -20,9 +22,11 @@
function animate() {
window.requestAnimationFrame(animate);
- bunny.rotation -= 0.05;
+ direction = backAndForth(0, bunny.position.x, 400);
- bunny.position.x += backAndForth(0, bunny.position.x, 400);
+ bunny.rotation += direction * 0.05;
+
+ bunny.position.x += direction * 1;
renderer.render(stage);
} |
8b4c1dac9a1611142f108839e48b59f2880cb9ba | public/democrats/signup/main.js | public/democrats/signup/main.js | requirejs.config({
shim: {
'call': {
deps: ['form', 'jquery', 'campaign'],
exports: 'call'
},
'campaign': {
deps: ['form', 'jquery'],
exports: 'campaign'
},
'form_mods': {
deps: ['jquery', 'form'],
exports: 'form_mods',
},
'form' : {
deps : ['an', 'jquery' ],
exports: 'form',
},
'heads' : {
deps : ['form', 'jquery' ],
exports: 'heads',
}
},
paths: {
an: 'https://actionnetwork.org/widgets/v2/form/stop-the-worst-of-the-worst?format=js&source=widget&style=full&clear_id=true',
},
baseUrl: '/democrats/app/'
});
//Should be able to magically turn a form into a caling form by requiring 'call'
require(['form', 'form_mods', 'heads', 'referrer_controls']); | requirejs.config({
shim: {
'call': {
deps: ['form', 'jquery', 'campaign'],
exports: 'call'
},
'campaign': {
deps: ['form', 'jquery'],
exports: 'campaign'
},
'form_mods': {
deps: ['jquery', 'form'],
exports: 'form_mods',
},
'form' : {
deps : ['an', 'jquery' ],
exports: 'form',
},
'heads' : {
deps : ['form', 'jquery' ],
exports: 'heads',
}
},
paths: {
an: 'https://actionnetwork.org/widgets/v2/form/stop-the-worst-of-the-worst?format=js&source=widget&style=full',
},
baseUrl: '/democrats/app/'
});
//Should be able to magically turn a form into a caling form by requiring 'call'
require(['form', 'form_mods', 'heads', 'referrer_controls']); | Remove clear_id for signup page | Remove clear_id for signup page
Still need it for /act so we get zip codes.
| JavaScript | agpl-3.0 | advocacycommons/advocacycommons,matinieves/advocacycommons,agustinrhcp/advocacycommons,agustinrhcp/advocacycommons,matinieves/advocacycommons,advocacycommons/advocacycommons,agustinrhcp/advocacycommons,advocacycommons/advocacycommons,matinieves/advocacycommons | ---
+++
@@ -23,7 +23,7 @@
},
paths: {
- an: 'https://actionnetwork.org/widgets/v2/form/stop-the-worst-of-the-worst?format=js&source=widget&style=full&clear_id=true',
+ an: 'https://actionnetwork.org/widgets/v2/form/stop-the-worst-of-the-worst?format=js&source=widget&style=full',
},
baseUrl: '/democrats/app/'
}); |
29f1e731c1e7f153284f637c005e12b0aeb9a2f5 | web.js | web.js | var coffee = require('coffee-script/register'),
express = require('express'),
assets = require('connect-assets'),
logfmt = require('logfmt'),
app = express();
var port = Number(process.env.PORT || 1337);
app.set('views', 'src/views');
app.set('view engine', 'jade');
require('./routes')(app);
assets = assets({
paths: [
'src/scripts',
'src/images',
'src/stylesheets',
'src/views',
'bower_components'
],
buildDir: 'dist',
gzip: true
});
assets.mincer.MacroProcessor.configure(['.js']);
app.use(assets);
app.use(logfmt.requestLogger());
app.listen(port);
console.log('Listening on port: ' + port);
| var coffee = require('coffee-script/register'),
express = require('express'),
assets = require('connect-assets'),
logfmt = require('logfmt'),
app = express();
var port = Number(process.env.PORT || 1337);
app.use(logfmt.requestLogger());
app.set('views', 'src/views');
app.set('view engine', 'jade');
require('./routes')(app);
assets = assets({
paths: [
'src/scripts',
'src/images',
'src/stylesheets',
'src/views',
'bower_components'
],
buildDir: 'dist',
gzip: true
});
assets.mincer.MacroProcessor.configure(['.js']);
app.use(assets);
app.listen(port);
console.log('Listening on port: ' + port);
| Move logging above asset serving | Move logging above asset serving
| JavaScript | mit | GeoSensorWebLab/asw-workbench,GeoSensorWebLab/Arctic-Scholar-Portal,GeoSensorWebLab/Arctic-Scholar-Portal,GeoSensorWebLab/asw-workbench,GeoSensorWebLab/asw-workbench | ---
+++
@@ -5,7 +5,7 @@
app = express();
var port = Number(process.env.PORT || 1337);
-
+app.use(logfmt.requestLogger());
app.set('views', 'src/views');
app.set('view engine', 'jade');
require('./routes')(app);
@@ -24,7 +24,6 @@
assets.mincer.MacroProcessor.configure(['.js']);
app.use(assets);
-app.use(logfmt.requestLogger());
app.listen(port);
console.log('Listening on port: ' + port); |
fc81b4a53a88ff0f04f62afb5e919098e86f20a9 | ui/src/kapacitor/constants/index.js | ui/src/kapacitor/constants/index.js | export const defaultRuleConfigs = {
deadman: {
period: '10m',
},
relative: {
change: 'change',
period: '1m',
shift: '1m',
operator: 'greater than',
value: '90',
},
threshold: {
operator: 'greater than',
value: '90',
relation: 'once',
percentile: '90',
period: '1m',
},
};
export const OPERATORS = ['greater than', 'equal to or greater', 'equal to or less than', 'less than', 'equal to', 'not equal to'];
// export const RELATIONS = ['once', 'more than ', 'less than'];
export const PERIODS = ['1m', '5m', '10m', '30m', '1h', '2h', '1d'];
export const CHANGES = ['change', '% change'];
export const SHIFTS = ['1m', '5m', '10m', '30m', '1h', '2h', '1d'];
export const ALERTS = ['hipchat', 'opsgenie', 'pagerduty', 'sensu', 'slack', 'smtp', 'talk', 'telegram', 'victorops'];
export const DEFAULT_RULE_ID = 'DEFAULT_RULE_ID';
| export const defaultRuleConfigs = {
deadman: {
period: '10m',
},
relative: {
change: 'change',
period: '1m',
shift: '1m',
operator: 'greater than',
value: '90',
},
threshold: {
operator: 'greater than',
value: '90',
relation: 'once',
percentile: '90',
period: '1m',
},
};
export const OPERATORS = ['greater than', 'equal to or greater', 'equal to or less than', 'less than', 'equal to', 'not equal to'];
// export const RELATIONS = ['once', 'more than ', 'less than'];
export const PERIODS = ['1m', '5m', '10m', '30m', '1h', '2h', '24h'];
export const CHANGES = ['change', '% change'];
export const SHIFTS = ['1m', '5m', '10m', '30m', '1h', '2h', '24h'];
export const ALERTS = ['hipchat', 'opsgenie', 'pagerduty', 'sensu', 'slack', 'smtp', 'talk', 'telegram', 'victorops'];
export const DEFAULT_RULE_ID = 'DEFAULT_RULE_ID';
| Change all 1d to 24h | Change all 1d to 24h
| JavaScript | agpl-3.0 | brianbaker/chronograf,brianbaker/chronograf,brianbaker/chronograf,brianbaker/chronograf,brianbaker/chronograf | ---
+++
@@ -20,9 +20,9 @@
export const OPERATORS = ['greater than', 'equal to or greater', 'equal to or less than', 'less than', 'equal to', 'not equal to'];
// export const RELATIONS = ['once', 'more than ', 'less than'];
-export const PERIODS = ['1m', '5m', '10m', '30m', '1h', '2h', '1d'];
+export const PERIODS = ['1m', '5m', '10m', '30m', '1h', '2h', '24h'];
export const CHANGES = ['change', '% change'];
-export const SHIFTS = ['1m', '5m', '10m', '30m', '1h', '2h', '1d'];
+export const SHIFTS = ['1m', '5m', '10m', '30m', '1h', '2h', '24h'];
export const ALERTS = ['hipchat', 'opsgenie', 'pagerduty', 'sensu', 'slack', 'smtp', 'talk', 'telegram', 'victorops'];
export const DEFAULT_RULE_ID = 'DEFAULT_RULE_ID'; |
c2936f41aa6ae9dbd5b34106e8eff8f2bbe4b292 | gulp/tasks/lint.js | gulp/tasks/lint.js | module.exports = function(gulp, config) {
var jshint = require('gulp-jshint');
var stylish = require('jshint-stylish');
var jscs = require('gulp-jscs');
var logger = require('../utils/logger');
gulp.task('av:lint', function() {
if (config && config.js && config.js.jshintrc) {
var src = [];
if (config && config.js && config.js.src) {
src = src.concat(config.js.src);
}
if (config && config.lib && config.lib.src) {
src = src.concat(config.lib.src);
}
if (src.length > 0) {
gulp.src(src)
.pipe(jscs())
.pipe(jshint(config.js.jshintrc))
.pipe(jshint.reporter(stylish));
} else {
logger.error('You must define config.js.src and/or config.lib.src.');
}
} else {
logger.error('You must define config.js.jshintrc');
}
});
};
| module.exports = function(gulp, config) {
var jshint = require('gulp-jshint');
var stylish = require('jshint-stylish');
var jscs = require('gulp-jscs');
var logger = require('../utils/logger');
gulp.task('av:lint', ['av:lint:js', 'av:lint:lib']);
gulp.task('av:lint:js', function() {
if (config && config.js && config.js.src) {
if (config && config.js && config.js.jshintrc) {
gulp.src(config.js.src)
.pipe(jscs())
.pipe(jshint(config.js.jshintrc))
.pipe(jshint.reporter(stylish));
} else {
logger.error('You must define config.js.jshintrc.');
}
} else {
logger.warn('config.js.src not defined; skipping.');
}
});
gulp.task('av:lint:lib', function() {
if (config && config.lib && config.lib.src) {
if (config && config.lib && config.lib.jshintrc) {
gulp.src(config.lib.src)
.pipe(jscs())
.pipe(jshint(config.lib.jshintrc))
.pipe(jshint.reporter(stylish));
} else {
logger.error('You must define config.lib.jshintrc.');
}
} else {
logger.warn('config.lib.src not defined; skipping.');
}
});
};
| Support separate jshintrc for lib | Support separate jshintrc for lib
| JavaScript | mit | Availity/availity-limo | ---
+++
@@ -4,26 +4,35 @@
var jscs = require('gulp-jscs');
var logger = require('../utils/logger');
- gulp.task('av:lint', function() {
- if (config && config.js && config.js.jshintrc) {
- var src = [];
- if (config && config.js && config.js.src) {
- src = src.concat(config.js.src);
- }
- if (config && config.lib && config.lib.src) {
- src = src.concat(config.lib.src);
- }
+ gulp.task('av:lint', ['av:lint:js', 'av:lint:lib']);
- if (src.length > 0) {
- gulp.src(src)
+ gulp.task('av:lint:js', function() {
+ if (config && config.js && config.js.src) {
+ if (config && config.js && config.js.jshintrc) {
+ gulp.src(config.js.src)
.pipe(jscs())
.pipe(jshint(config.js.jshintrc))
.pipe(jshint.reporter(stylish));
} else {
- logger.error('You must define config.js.src and/or config.lib.src.');
+ logger.error('You must define config.js.jshintrc.');
}
} else {
- logger.error('You must define config.js.jshintrc');
+ logger.warn('config.js.src not defined; skipping.');
+ }
+ });
+
+ gulp.task('av:lint:lib', function() {
+ if (config && config.lib && config.lib.src) {
+ if (config && config.lib && config.lib.jshintrc) {
+ gulp.src(config.lib.src)
+ .pipe(jscs())
+ .pipe(jshint(config.lib.jshintrc))
+ .pipe(jshint.reporter(stylish));
+ } else {
+ logger.error('You must define config.lib.jshintrc.');
+ }
+ } else {
+ logger.warn('config.lib.src not defined; skipping.');
}
});
}; |
36378676c7b5fc35fb84def2ddee584e376b2bb9 | main.js | main.js | /*global require: false, console: false */
(function () {
"use strict";
var proxy = require("./proxy/proxy"),
server = require("./server/server"),
cprocess = require('child_process');
var port = -1;
console.log("Staring proxy.");
proxy.start().then(function () {
server.start().then(function () {
port = proxy.getPort();
console.log("Started server on " + port);
if (port > 0) {
cprocess.exec("open http://localhost:8080/client/index.html?" + port);
} else {
console.log("Proxy does not return port: " + port);
}
});
});
}()); | /*global require: false, console: false */
(function () {
"use strict";
var proxy = require("./proxy/proxy"),
server = require("./server/server"),
cprocess = require('child_process'),
open = require("open");
var port = -1;
console.log("Staring proxy.");
proxy.start().then(function () {
server.start().then(function () {
port = proxy.getPort();
console.log("Started server on " + port);
if (port > 0) {
open("http://localhost:8080/client/index.html?" + port);
} else {
console.log("Proxy does not return port: " + port);
}
});
});
}()); | Use open to launch the browser. | Use open to launch the browser.
| JavaScript | mit | busykai/ws-rpc,busykai/ws-rpc | ---
+++
@@ -3,7 +3,8 @@
"use strict";
var proxy = require("./proxy/proxy"),
server = require("./server/server"),
- cprocess = require('child_process');
+ cprocess = require('child_process'),
+ open = require("open");
var port = -1;
@@ -13,7 +14,7 @@
port = proxy.getPort();
console.log("Started server on " + port);
if (port > 0) {
- cprocess.exec("open http://localhost:8080/client/index.html?" + port);
+ open("http://localhost:8080/client/index.html?" + port);
} else {
console.log("Proxy does not return port: " + port);
} |
5106b793f76f2ba226420e5e5078d35796487d39 | main.js | main.js | 'use strict';
var visitors = require('./vendor/fbtransform/visitors').transformVisitors;
var transform = require('jstransform').transform;
module.exports = {
transform: function(code) {
return transform(visitors.react, code).code;
}
};
| 'use strict';
var visitors = require('./vendor/fbtransform/visitors');
var transform = require('jstransform').transform;
module.exports = {
transform: function(code, options) {
var visitorList;
if (options && options.harmony) {
visitorList = visitors.getAllVisitors();
} else {
visitorList = visitors.transformVisitors.react;
}
return transform(visitorList, code).code;
}
};
| Add support for {harmony: true} to react-tools | Add support for {harmony: true} to react-tools
```
require('react-tools').transform(code, {harmony: true});
```
now enables all the harmony es6 transforms that are supported.
This is modeled after https://github.com/facebook/react/blob/master/bin/jsx#L17-L23 | JavaScript | bsd-3-clause | bspaulding/react,JasonZook/react,jkcaptain/react,jlongster/react,rickbeerendonk/react,edmellum/react,kakadiya91/react,edvinerikson/react,joaomilho/react,jordanpapaleo/react,zyt01/react,gj262/react,blue68/react,jquense/react,rricard/react,ashwin01/react,trueadm/react,usgoodus/react,DJCordhose/react,andrescarceller/react,speedyGonzales/react,patrickgoudjoako/react,inuscript/react,spicyj/react,crsr/react,tako-black/react-1,yungsters/react,rricard/react,jordanpapaleo/react,wuguanghai45/react,jdlehman/react,kamilio/react,lyip1992/react,wmydz1/react,Simek/react,terminatorheart/react,AlexJeng/react,prometheansacrifice/react,dortonway/react,BreemsEmporiumMensToiletriesFragrances/react,gfogle/react,kevinrobinson/react,christer155/react,sarvex/react,TaaKey/react,shadowhunter2/react,tarjei/react,qq316278987/react,laogong5i0/react,panhongzhi02/react,angeliaz/react,ManrajGrover/react,usgoodus/react,usgoodus/react,zigi74/react,sasumi/react,salzhrani/react,benjaffe/react,mtsyganov/react,nhunzaker/react,Simek/react,shadowhunter2/react,bruderstein/server-react,gregrperkins/react,JoshKaufman/react,arkist/react,ZhouYong10/react,ning-github/react,1234-/react,ArunTesco/react,chinakids/react,usgoodus/react,Jonekee/react,reactkr/react,algolia/react,iOSDevBlog/react,facebook/react,chinakids/react,niubaba63/react,sarvex/react,iamchenxin/react,musofan/react,speedyGonzales/react,studiowangfei/react,wushuyi/react,DigitalCoder/react,prathamesh-sonpatki/react,tako-black/react-1,laogong5i0/react,tlwirtz/react,joshbedo/react,VukDukic/react,glenjamin/react,yjyi/react,alwayrun/react,cinic/react,scottburch/react,inuscript/react,lina/react,insionng/react,venkateshdaram434/react,reactkr/react,claudiopro/react,dustin-H/react,jquense/react,lonely8rain/react,linalu1/react,alvarojoao/react,thomasboyt/react,jzmq/react,VioletLife/react,gleborgne/react,jimfb/react,jagdeesh109/react,savelichalex/react,PrecursorApp/react,roth1002/react,chenglou/react,crsr/react,zyt01/react,dilidili/react,leexiaosi/react,labs00/react,mjul/react,joon1030/react,jorrit/react,vipulnsward/react,jmacman007/react,PrecursorApp/react,billfeller/react,Galactix/react,musofan/react,jedwards1211/react,songawee/react,free-memory/react,kchia/react,zhengqiangzi/react,claudiopro/react,STRML/react,mosoft521/react,jquense/react,btholt/react,pyitphyoaung/react,linalu1/react,lyip1992/react,yungsters/react,joe-strummer/react,yjyi/react,jdlehman/react,hawsome/react,zyt01/react,soulcm/react,szhigunov/react,ABaldwinHunter/react-engines,tlwirtz/react,joshblack/react,andrescarceller/react,devonharvey/react,andrescarceller/react,thomasboyt/react,benjaffe/react,zs99/react,cody/react,dirkliu/react,nLight/react,gpbl/react,luomiao3/react,with-git/react,reggi/react,insionng/react,theseyi/react,JasonZook/react,orneryhippo/react,greyhwndz/react,lina/react,acdlite/react,apaatsio/react,1040112370/react,concerned3rdparty/react,gitoneman/react,savelichalex/react,sekiyaeiji/react,devonharvey/react,mardigtch/react,Spotinux/react,joe-strummer/react,maxschmeling/react,orneryhippo/react,trungda/react,8398a7/react,jonhester/react,tom-wang/react,empyrical/react,free-memory/react,temnoregg/react,linmic/react,Rafe/react,blainekasten/react,AnSavvides/react,demohi/react,Riokai/react,marocchino/react,jontewks/react,Rafe/react,jessebeach/react,aickin/react,ilyachenko/react,mtsyganov/react,trellowebinars/react,christer155/react,AmericanSundown/react,ABaldwinHunter/react-classic,zilaiyedaren/react,odysseyscience/React-IE-Alt,mjackson/react,roylee0704/react,staltz/react,jordanpapaleo/react,Jericho25/react,darobin/react,algolia/react,devonharvey/react,Diaosir/react,terminatorheart/react,with-git/react,concerned3rdparty/react,free-memory/react,pwmckenna/react,skyFi/react,gpazo/react,bruderstein/server-react,wjb12/react,bspaulding/react,dfosco/react,linmic/react,dariocravero/react,levibuzolic/react,afc163/react,JoshKaufman/react,ramortegui/react,terminatorheart/react,TaaKey/react,brigand/react,OculusVR/react,kalloc/react,jontewks/react,tako-black/react-1,shripadk/react,shripadk/react,perperyu/react,wmydz1/react,jedwards1211/react,mosoft521/react,ouyangwenfeng/react,zhangwei001/react,jsdf/react,pandoraui/react,linmic/react,AnSavvides/react,diegobdev/react,JoshKaufman/react,manl1100/react,jbonta/react,lennerd/react,rlugojr/react,dmatteo/react,S0lahart-AIRpanas-081905220200-Service/react,lennerd/react,syranide/react,mosoft521/react,garbles/react,Nieralyte/react,syranide/react,DJCordhose/react,glenjamin/react,zhangwei001/react,Jyrno42/react,JasonZook/react,zofuthan/react,airondumael/react,sergej-kucharev/react,richiethomas/react,conorhastings/react,nLight/react,obimod/react,dmitriiabramov/react,lonely8rain/react,1040112370/react,trueadm/react,lyip1992/react,jbonta/react,zhangwei900808/react,bhamodi/react,davidmason/react,blue68/react,gleborgne/react,jsdf/react,ThinkedCoder/react,speedyGonzales/react,qq316278987/react,kamilio/react,salier/react,trungda/react,zanjs/react,TaaKey/react,LoQIStar/react,anushreesubramani/react,javascriptit/react,patrickgoudjoako/react,pze/react,BorderTravelerX/react,dfosco/react,angeliaz/react,inuscript/react,rgbkrk/react,JungMinu/react,andrerpena/react,theseyi/react,zorojean/react,bhamodi/react,rwwarren/react,songawee/react,dgdblank/react,jeffchan/react,tomocchino/react,anushreesubramani/react,arkist/react,gleborgne/react,1040112370/react,silkapp/react,edvinerikson/react,STRML/react,0x00evil/react,brillantesmanuel/react,jkcaptain/react,savelichalex/react,bhamodi/react,DigitalCoder/react,ms-carterk/react,anushreesubramani/react,wuguanghai45/react,iammerrick/react,ajdinhedzic/react,rasj/react,patrickgoudjoako/react,chicoxyzzy/react,chrismoulton/react,miaozhirui/react,huanglp47/react,edvinerikson/react,sverrejoh/react,mcanthony/react,andrerpena/react,eoin/react,Instrument/react,dortonway/react,6feetsong/react,sverrejoh/react,dmitriiabramov/react,christer155/react,reactjs-vn/reactjs_vndev,stardev24/react,jordanpapaleo/react,iOSDevBlog/react,sebmarkbage/react,PrecursorApp/react,genome21/react,gpbl/react,S0lahart-AIRpanas-081905220200-Service/react,neomadara/react,chrisbolin/react,wzpan/react,alvarojoao/react,jfschwarz/react,1040112370/react,nickpresta/react,Duc-Ngo-CSSE/react,flarnie/react,skevy/react,AlmeroSteyn/react,ericyang321/react,dortonway/react,perterest/react,gregrperkins/react,hawsome/react,dustin-H/react,spicyj/react,wjb12/react,bspaulding/react,jmacman007/react,evilemon/react,joaomilho/react,rohannair/react,vjeux/react,tomocchino/react,restlessdesign/react,felixgrey/react,andreypopp/react,labs00/react,reactkr/react,yiminghe/react,yabhis/react,kevinrobinson/react,eoin/react,lyip1992/react,sekiyaeiji/react,bitshadow/react,mjackson/react,staltz/react,insionng/react,gajus/react,silkapp/react,shripadk/react,KevinTCoughlin/react,rickbeerendonk/react,restlessdesign/react,pswai/react,zeke/react,Furzikov/react,jabhishek/react,yuhualingfeng/react,gajus/react,insionng/react,salzhrani/react,roylee0704/react,varunparkhe/react,sdiaz/react,jameszhan/react,anushreesubramani/react,guoshencheng/react,skomski/react,prathamesh-sonpatki/react,henrik/react,mhhegazy/react,AlexJeng/react,dilidili/react,lyip1992/react,jorrit/react,greglittlefield-wf/react,orneryhippo/react,Jyrno42/react,benchling/react,bestwpw/react,jeffchan/react,ajdinhedzic/react,jdlehman/react,ZhouYong10/react,pyitphyoaung/react,IndraVikas/react,Instrument/react,lhausermann/react,glenjamin/react,chrisjallen/react,jedwards1211/react,kaushik94/react,jorrit/react,VioletLife/react,haoxutong/react,mosoft521/react,JungMinu/react,camsong/react,flarnie/react,pwmckenna/react,Chiens/react,temnoregg/react,cpojer/react,TheBlasfem/react,dirkliu/react,wesbos/react,cpojer/react,yulongge/react,jimfb/react,jakeboone02/react,jmptrader/react,ms-carterk/react,ericyang321/react,k-cheng/react,zigi74/react,facebook/react,jimfb/react,jlongster/react,MichelleTodd/react,conorhastings/react,tarjei/react,10fish/react,obimod/react,zorojean/react,jabhishek/react,kieranjones/react,pswai/react,iOSDevBlog/react,panhongzhi02/react,iammerrick/react,tomv564/react,pswai/react,atom/react,ericyang321/react,stardev24/react,sasumi/react,Instrument/react,ssyang0102/react,negativetwelve/react,demohi/react,joecritch/react,benchling/react,gregrperkins/react,roth1002/react,lastjune/react,joaomilho/react,blainekasten/react,chrismoulton/react,jabhishek/react,jzmq/react,ninjaofawesome/reaction,staltz/react,facebook/react,andrewsokolov/react,prathamesh-sonpatki/react,krasimir/react,pandoraui/react,tzq668766/react,jonhester/react,jeromjoy/react,jontewks/react,aaron-goshine/react,kamilio/react,orzyang/react,IndraVikas/react,nsimmons/react,phillipalexander/react,richiethomas/react,gregrperkins/react,rricard/react,Furzikov/react,hawsome/react,arasmussen/react,reactkr/react,jmptrader/react,billfeller/react,soulcm/react,hejld/react,iamdoron/react,bitshadow/react,ms-carterk/react,panhongzhi02/react,gold3bear/react,aickin/react,musofan/react,chenglou/react,ljhsai/react,KevinTCoughlin/react,AlexJeng/react,negativetwelve/react,acdlite/react,yabhis/react,claudiopro/react,RReverser/react,slongwang/react,andrewsokolov/react,jakeboone02/react,miaozhirui/react,thomasboyt/react,popovsh6/react,zenlambda/react,yongxu/react,studiowangfei/react,christer155/react,davidmason/react,huanglp47/react,Rafe/react,ljhsai/react,yiminghe/react,lyip1992/react,acdlite/react,chicoxyzzy/react,jbonta/react,gougouGet/react,flipactual/react,vikbert/react,flowbywind/react,arkist/react,yangshun/react,glenjamin/react,joshblack/react,liyayun/react,billfeller/react,Galactix/react,Simek/react,elquatro/react,kaushik94/react,bruderstein/server-react,brigand/react,tjsavage/react,jakeboone02/react,pze/react,mjackson/react,Datahero/react,sarvex/react,chacbumbum/react,OculusVR/react,arasmussen/react,reactjs-vn/reactjs_vndev,AnSavvides/react,niole/react,Datahero/react,ridixcr/react,mosoft521/react,concerned3rdparty/react,theseyi/react,TheBlasfem/react,willhackett/react,kchia/react,tywinstark/react,quip/react,jorrit/react,VioletLife/react,sasumi/react,wmydz1/react,haoxutong/react,microlv/react,chrisjallen/react,krasimir/react,wangyzyoga/react,TheBlasfem/react,haoxutong/react,vikbert/react,shergin/react,livepanzo/react,AlexJeng/react,neusc/react,Riokai/react,supriyantomaftuh/react,wmydz1/react,spt110/react,tom-wang/react,prometheansacrifice/react,laskos/react,yasaricli/react,kakadiya91/react,yiminghe/react,mhhegazy/react,hawsome/react,RReverser/react,tzq668766/react,k-cheng/react,AlmeroSteyn/react,BreemsEmporiumMensToiletriesFragrances/react,silvestrijonathan/react,vincentnacar02/react,angeliaz/react,MichelleTodd/react,ArunTesco/react,STRML/react,LoQIStar/react,AlmeroSteyn/react,carlosipe/react,anushreesubramani/react,usgoodus/react,hejld/react,stanleycyang/react,mcanthony/react,wushuyi/react,flarnie/react,lonely8rain/react,JanChw/react,bleyle/react,spt110/react,davidmason/react,guoshencheng/react,deepaksharmacse12/react,1yvT0s/react,MotherNature/react,cpojer/react,inuscript/react,szhigunov/react,tjsavage/react,dariocravero/react,tjsavage/react,iamdoron/react,niubaba63/react,stanleycyang/react,maxschmeling/react,KevinTCoughlin/react,lastjune/react,slongwang/react,restlessdesign/react,glenjamin/react,iammerrick/react,acdlite/react,salier/react,IndraVikas/react,getshuvo/react,sebmarkbage/react,lastjune/react,zenlambda/react,tom-wang/react,trueadm/react,yuhualingfeng/react,chacbumbum/react,guoshencheng/react,microlv/react,PrecursorApp/react,concerned3rdparty/react,alvarojoao/react,yangshun/react,joaomilho/react,willhackett/react,kevinrobinson/react,reactjs-vn/reactjs_vndev,TaaKey/react,dgladkov/react,michaelchum/react,react-china/react-docs,ericyang321/react,sugarshin/react,kay-is/react,elquatro/react,arush/react,joe-strummer/react,wmydz1/react,jagdeesh109/react,shergin/react,Jericho25/react,dittos/react,studiowangfei/react,bestwpw/react,albulescu/react,ledrui/react,tomocchino/react,lonely8rain/react,zigi74/react,jagdeesh109/react,Diaosir/react,empyrical/react,tom-wang/react,aickin/react,yut148/react,tomv564/react,apaatsio/react,getshuvo/react,kolmstead/react,Galactix/react,yulongge/react,AmericanSundown/react,andreypopp/react,howtolearntocode/react,benchling/react,elquatro/react,reggi/react,devonharvey/react,honger05/react,BreemsEmporiumMensToiletriesFragrances/react,DJCordhose/react,jonhester/react,spicyj/react,misnet/react,sejoker/react,airondumael/react,camsong/react,wangyzyoga/react,crsr/react,cmfcmf/react,restlessdesign/react,ameyms/react,DJCordhose/react,jzmq/react,yut148/react,negativetwelve/react,sugarshin/react,flowbywind/react,it33/react,stevemao/react,gold3bear/react,lonely8rain/react,marocchino/react,Simek/react,skomski/react,mingyaaaa/react,AlmeroSteyn/react,bruderstein/server-react,camsong/react,PrecursorApp/react,sugarshin/react,ropik/react,lucius-feng/react,joaomilho/react,isathish/react,linqingyicen/react,digideskio/react,Lonefy/react,ashwin01/react,dustin-H/react,gpbl/react,staltz/react,albulescu/react,kaushik94/react,orneryhippo/react,facebook/react,mhhegazy/react,jsdf/react,zhangwei001/react,garbles/react,hejld/react,kolmstead/react,eoin/react,thr0w/react,zyt01/react,ameyms/react,angeliaz/react,usgoodus/react,haoxutong/react,tywinstark/react,airondumael/react,Nieralyte/react,reactjs-vn/reactjs_vndev,brigand/react,wushuyi/react,ABaldwinHunter/react-engines,davidmason/react,jmptrader/react,chenglou/react,benchling/react,skevy/react,neomadara/react,camsong/react,TylerBrock/react,rohannair/react,tywinstark/react,garbles/react,Diaosir/react,andrescarceller/react,garbles/react,sverrejoh/react,trungda/react,Riokai/react,rickbeerendonk/react,pletcher/react,joecritch/react,DigitalCoder/react,mingyaaaa/react,patrickgoudjoako/react,yulongge/react,yisbug/react,reggi/react,STRML/react,nLight/react,nomanisan/react,rohannair/react,tywinstark/react,stanleycyang/react,rgbkrk/react,mohitbhatia1994/react,salzhrani/react,nathanmarks/react,TylerBrock/react,yjyi/react,ropik/react,felixgrey/react,ashwin01/react,jonhester/react,vipulnsward/react,lucius-feng/react,framp/react,rricard/react,gpazo/react,framp/react,tomv564/react,claudiopro/react,musofan/react,ameyms/react,terminatorheart/react,vipulnsward/react,trueadm/react,brillantesmanuel/react,empyrical/react,demohi/react,dirkliu/react,yuhualingfeng/react,felixgrey/react,mtsyganov/react,framp/react,jbonta/react,mnordick/react,panhongzhi02/react,salier/react,kaushik94/react,jontewks/react,lonely8rain/react,trueadm/react,Instrument/react,angeliaz/react,gajus/react,sasumi/react,Jonekee/react,spt110/react,JanChw/react,qq316278987/react,brillantesmanuel/react,reactkr/react,Furzikov/react,glenjamin/react,with-git/react,mingyaaaa/react,mik01aj/react,mingyaaaa/react,dmitriiabramov/react,sarvex/react,pswai/react,VioletLife/react,panhongzhi02/react,silkapp/react,isathish/react,prometheansacrifice/react,tomv564/react,Lonefy/react,apaatsio/react,pwmckenna/react,bitshadow/react,salzhrani/react,kevinrobinson/react,dittos/react,kakadiya91/react,cmfcmf/react,PeterWangPo/react,tako-black/react-1,Spotinux/react,vikbert/react,TaaKey/react,ledrui/react,deepaksharmacse12/react,yisbug/react,yisbug/react,claudiopro/react,dgreensp/react,ABaldwinHunter/react-engines,alexanther1012/react,willhackett/react,laogong5i0/react,ramortegui/react,pyitphyoaung/react,chrisbolin/react,elquatro/react,leexiaosi/react,leohmoraes/react,ipmobiletech/react,ms-carterk/react,sergej-kucharev/react,billfeller/react,cpojer/react,tomocchino/react,zs99/react,dgreensp/react,ABaldwinHunter/react-engines,sverrejoh/react,apaatsio/react,MotherNature/react,chippieTV/react,airondumael/react,ridixcr/react,jmptrader/react,yuhualingfeng/react,benchling/react,AlmeroSteyn/react,wjb12/react,PeterWangPo/react,skevy/react,iammerrick/react,slongwang/react,yuhualingfeng/react,tlwirtz/react,dmatteo/react,patrickgoudjoako/react,chippieTV/react,andrerpena/react,linmic/react,eoin/react,jasonwebster/react,james4388/react,iamdoron/react,Simek/react,pze/react,gold3bear/react,ropik/react,Furzikov/react,ericyang321/react,rlugojr/react,10fish/react,linqingyicen/react,gitoneman/react,cpojer/react,dariocravero/react,Jyrno42/react,silvestrijonathan/react,zs99/react,albulescu/react,hzoo/react,crsr/react,leohmoraes/react,yut148/react,flipactual/react,Simek/react,benjaffe/react,dfosco/react,react-china/react-docs,framp/react,anushreesubramani/react,genome21/react,MotherNature/react,jameszhan/react,Zeboch/react-tap-event-plugin,linalu1/react,gxr1020/react,rwwarren/react,trellowebinars/react,jessebeach/react,henrik/react,zenlambda/react,trueadm/react,gitoneman/react,Lonefy/react,dariocravero/react,negativetwelve/react,yulongge/react,wjb12/react,garbles/react,richiethomas/react,ajdinhedzic/react,dgreensp/react,ridixcr/react,yiminghe/react,shergin/react,skevy/react,honger05/react,zeke/react,carlosipe/react,jmptrader/react,shripadk/react,leeleo26/react,thomasboyt/react,livepanzo/react,microlv/react,gfogle/react,zanjs/react,tlwirtz/react,prometheansacrifice/react,alvarojoao/react,cody/react,chicoxyzzy/react,vincentnacar02/react,btholt/react,vikbert/react,SpencerCDixon/react,nickdima/react,ilyachenko/react,bspaulding/react,salier/react,joon1030/react,miaozhirui/react,pyitphyoaung/react,yasaricli/react,ropik/react,jsdf/react,iamdoron/react,jonhester/react,JoshKaufman/react,it33/react,Diaosir/react,sasumi/react,dariocravero/react,rgbkrk/react,10fish/react,patrickgoudjoako/react,jmacman007/react,VukDukic/react,gfogle/react,Flip120/react,ThinkedCoder/react,tomocchino/react,rickbeerendonk/react,crsr/react,chrisbolin/react,Spotinux/react,ramortegui/react,misnet/react,Simek/react,rricard/react,stanleycyang/react,ipmobiletech/react,iammerrick/react,agileurbanite/react,nhunzaker/react,conorhastings/react,dilidili/react,wjb12/react,easyfmxu/react,howtolearntocode/react,sejoker/react,gpbl/react,MoOx/react,agideo/react,roth1002/react,jmacman007/react,pyitphyoaung/react,quip/react,hawsome/react,richiethomas/react,labs00/react,inuscript/react,neusc/react,mgmcdermott/react,nickpresta/react,roylee0704/react,jakeboone02/react,gitignorance/react,pandoraui/react,BorderTravelerX/react,mnordick/react,savelichalex/react,flarnie/react,JungMinu/react,trellowebinars/react,dmitriiabramov/react,Chiens/react,jquense/react,gitoneman/react,empyrical/react,yhagio/react,jlongster/react,marocchino/react,brian-murray35/react,pletcher/react,jonhester/react,ZhouYong10/react,jasonwebster/react,btholt/react,nickdima/react,richiethomas/react,Jonekee/react,joaomilho/react,brigand/react,marocchino/react,ABaldwinHunter/react-engines,SpencerCDixon/react,tzq668766/react,yut148/react,dfosco/react,apaatsio/react,krasimir/react,pze/react,jorrit/react,1234-/react,gajus/react,Duc-Ngo-CSSE/react,mnordick/react,musofan/react,jdlehman/react,jessebeach/react,edmellum/react,honger05/react,mohitbhatia1994/react,yhagio/react,lastjune/react,chenglou/react,jeromjoy/react,zhangwei001/react,vincentnacar02/react,evilemon/react,slongwang/react,gpazo/react,billfeller/react,MotherNature/react,scottburch/react,pyitphyoaung/react,acdlite/react,getshuvo/react,deepaksharmacse12/react,10fish/react,ZhouYong10/react,cody/react,zhangwei900808/react,ilyachenko/react,brillantesmanuel/react,jameszhan/react,lhausermann/react,andreypopp/react,digideskio/react,airondumael/react,sdiaz/react,javascriptit/react,ridixcr/react,roth1002/react,songawee/react,wushuyi/react,ZhouYong10/react,perperyu/react,manl1100/react,ABaldwinHunter/react-classic,agideo/react,laskos/react,stanleycyang/react,kieranjones/react,haoxutong/react,magalhas/react,atom/react,andrewsokolov/react,OculusVR/react,silvestrijonathan/react,dmitriiabramov/react,honger05/react,evilemon/react,temnoregg/react,ianb/react,yongxu/react,gougouGet/react,quip/react,mfunkie/react,vipulnsward/react,zenlambda/react,atom/react,joshbedo/react,bhamodi/react,yungsters/react,lhausermann/react,jagdeesh109/react,BreemsEmporiumMensToiletriesFragrances/react,mjul/react,zhangwei001/react,framp/react,jessebeach/react,TheBlasfem/react,alvarojoao/react,livepanzo/react,perterest/react,bitshadow/react,tako-black/react-1,odysseyscience/React-IE-Alt,stevemao/react,andrerpena/react,claudiopro/react,quip/react,dilidili/react,AmericanSundown/react,levibuzolic/react,TylerBrock/react,yungsters/react,trungda/react,yongxu/react,yasaricli/react,linqingyicen/react,ianb/react,ianb/react,rlugojr/react,zhengqiangzi/react,sejoker/react,kamilio/react,prathamesh-sonpatki/react,pod4g/react,henrik/react,0x00evil/react,mcanthony/react,thomasboyt/react,levibuzolic/react,ericyang321/react,livepanzo/react,billfeller/react,nomanisan/react,dgdblank/react,darobin/react,studiowangfei/react,diegobdev/react,jiangzhixiao/react,leexiaosi/react,jdlehman/react,mik01aj/react,orneryhippo/react,flowbywind/react,jorrit/react,ning-github/react,lennerd/react,ZhouYong10/react,jameszhan/react,ouyangwenfeng/react,juliocanares/react,gpazo/react,skyFi/react,rohannair/react,zeke/react,reactjs-vn/reactjs_vndev,Flip120/react,MichelleTodd/react,zofuthan/react,zigi74/react,silppuri/react,nsimmons/react,lhausermann/react,joshbedo/react,camsong/react,nLight/react,anushreesubramani/react,silvestrijonathan/react,cinic/react,andrescarceller/react,jlongster/react,bhamodi/react,yongxu/react,k-cheng/react,gxr1020/react,leeleo26/react,richiethomas/react,trellowebinars/react,prometheansacrifice/react,ABaldwinHunter/react-classic,Furzikov/react,aickin/react,reactkr/react,qq316278987/react,AlexJeng/react,facebook/react,acdlite/react,dgdblank/react,laskos/react,theseyi/react,rlugojr/react,atom/react,tom-wang/react,joe-strummer/react,greyhwndz/react,yhagio/react,yut148/react,chacbumbum/react,chacbumbum/react,niole/react,it33/react,jfschwarz/react,ssyang0102/react,Jericho25/react,Riokai/react,perterest/react,blainekasten/react,isathish/react,lennerd/react,Flip120/react,nickdima/react,marocchino/react,ninjaofawesome/reaction,kaushik94/react,tlwirtz/react,mik01aj/react,yangshun/react,SpencerCDixon/react,silppuri/react,spicyj/react,obimod/react,AlmeroSteyn/react,empyrical/react,luomiao3/react,ManrajGrover/react,cesine/react,trueadm/react,salier/react,thomasboyt/react,gajus/react,andrerpena/react,sebmarkbage/react,jordanpapaleo/react,deepaksharmacse12/react,pswai/react,jquense/react,Rafe/react,michaelchum/react,zigi74/react,ropik/react,Flip120/react,jlongster/react,yisbug/react,varunparkhe/react,aaron-goshine/react,conorhastings/react,roth1002/react,ninjaofawesome/reaction,rgbkrk/react,ameyms/react,vjeux/react,ABaldwinHunter/react-classic,zilaiyedaren/react,chrisjallen/react,bruderstein/server-react,kevin0307/react,jessebeach/react,syranide/react,sverrejoh/react,JasonZook/react,linmic/react,S0lahart-AIRpanas-081905220200-Service/react,yangshun/react,edvinerikson/react,vincentism/react,yut148/react,hawsome/react,reggi/react,patryknowak/react,gpazo/react,cmfcmf/react,hzoo/react,stardev24/react,DJCordhose/react,Zeboch/react-tap-event-plugin,gj262/react,kay-is/react,yisbug/react,Riokai/react,terminatorheart/react,niubaba63/react,alvarojoao/react,with-git/react,pdaddyo/react,spt110/react,mjackson/react,cmfcmf/react,nickdima/react,orneryhippo/react,dortonway/react,temnoregg/react,greglittlefield-wf/react,ArunTesco/react,KevinTCoughlin/react,digideskio/react,Diaosir/react,restlessdesign/react,levibuzolic/react,0x00evil/react,1234-/react,sugarshin/react,dmatteo/react,miaozhirui/react,RReverser/react,nLight/react,roylee0704/react,microlv/react,dirkliu/react,savelichalex/react,thr0w/react,jfschwarz/react,davidmason/react,brian-murray35/react,isathish/react,AmericanSundown/react,tarjei/react,Jyrno42/react,manl1100/react,kchia/react,kevinrobinson/react,VioletLife/react,manl1100/react,rickbeerendonk/react,thr0w/react,agileurbanite/react,kay-is/react,edvinerikson/react,kevin0307/react,rohannair/react,nickdima/react,isathish/react,gregrperkins/react,roth1002/react,jeffchan/react,kevinrobinson/react,genome21/react,AlexJeng/react,jorrit/react,MoOx/react,niole/react,0x00evil/react,jontewks/react,misnet/react,kaushik94/react,eoin/react,perperyu/react,psibi/react,nickpresta/react,varunparkhe/react,james4388/react,zeke/react,sitexa/react,levibuzolic/react,AnSavvides/react,Instrument/react,gfogle/react,iamchenxin/react,james4388/react,react-china/react-docs,1040112370/react,jfschwarz/react,ridixcr/react,cmfcmf/react,sarvex/react,zyt01/react,concerned3rdparty/react,rricard/react,rickbeerendonk/react,spt110/react,shergin/react,niubaba63/react,ropik/react,kolmstead/react,dmitriiabramov/react,ThinkedCoder/react,JasonZook/react,hejld/react,arasmussen/react,rohannair/react,prathamesh-sonpatki/react,obimod/react,8398a7/react,STRML/react,blue68/react,mcanthony/react,brigand/react,jontewks/react,yangshun/react,Nieralyte/react,panhongzhi02/react,sugarshin/react,microlv/react,mjackson/react,pdaddyo/react,JoshKaufman/react,scottburch/react,maxschmeling/react,thr0w/react,dgdblank/react,jlongster/react,nhunzaker/react,supriyantomaftuh/react,Flip120/react,insionng/react,chacbumbum/react,popovsh6/react,MoOx/react,neusc/react,yasaricli/react,nLight/react,ssyang0102/react,carlosipe/react,ashwin01/react,jordanpapaleo/react,brigand/react,jiangzhixiao/react,dgladkov/react,6feetsong/react,kalloc/react,scottburch/react,brillantesmanuel/react,ms-carterk/react,davidmason/react,dirkliu/react,neomadara/react,jimfb/react,Furzikov/react,silvestrijonathan/react,nomanisan/react,cpojer/react,greysign/react,dittos/react,honger05/react,felixgrey/react,facebook/react,lhausermann/react,jasonwebster/react,chicoxyzzy/react,cesine/react,christer155/react,skevy/react,nathanmarks/react,camsong/react,magalhas/react,arasmussen/react,pdaddyo/react,dustin-H/react,joe-strummer/react,nhunzaker/react,staltz/react,sugarshin/react,JoshKaufman/react,howtolearntocode/react,quip/react,huanglp47/react,mik01aj/react,camsong/react,hzoo/react,neusc/react,yasaricli/react,wushuyi/react,nhunzaker/react,maxschmeling/react,vincentism/react,silppuri/react,1yvT0s/react,maxschmeling/react,PeterWangPo/react,zorojean/react,vipulnsward/react,eoin/react,ameyms/react,kolmstead/react,cpojer/react,iOSDevBlog/react,cinic/react,manl1100/react,Jericho25/react,james4388/react,savelichalex/react,laogong5i0/react,niole/react,ramortegui/react,stardev24/react,andrerpena/react,inuscript/react,cmfcmf/react,negativetwelve/react,mhhegazy/react,jedwards1211/react,mhhegazy/react,wudouxingjun/react,trungda/react,zs99/react,IndraVikas/react,dittos/react,apaatsio/react,tomocchino/react,nhunzaker/react,dustin-H/react,elquatro/react,yungsters/react,gpazo/react,pletcher/react,jeffchan/react,ledrui/react,niole/react,silvestrijonathan/react,rwwarren/react,pwmckenna/react,mosoft521/react,insionng/react,lhausermann/react,dgreensp/react,leohmoraes/react,dustin-H/react,lastjune/react,Jericho25/react,linqingyicen/react,brillantesmanuel/react,neusc/react,RReverser/react,reggi/react,easyfmxu/react,greysign/react,temnoregg/react,tom-wang/react,aaron-goshine/react,dgdblank/react,jakeboone02/react,tlwirtz/react,niubaba63/react,zofuthan/react,jfschwarz/react,pswai/react,prathamesh-sonpatki/react,dmatteo/react,felixgrey/react,chippieTV/react,nsimmons/react,Riokai/react,ledrui/react,zenlambda/react,kamilio/react,billfeller/react,odysseyscience/React-IE-Alt,perterest/react,jiangzhixiao/react,JanChw/react,mfunkie/react,greglittlefield-wf/react,trellowebinars/react,guoshencheng/react,Rafe/react,dfosco/react,kevin0307/react,ramortegui/react,arkist/react,gxr1020/react,james4388/react,ManrajGrover/react,reactjs-vn/reactjs_vndev,jedwards1211/react,zenlambda/react,jameszhan/react,mcanthony/react,rlugojr/react,terminatorheart/react,maxschmeling/react,pletcher/react,hzoo/react,maxschmeling/react,krasimir/react,BreemsEmporiumMensToiletriesFragrances/react,miaozhirui/react,cesine/react,facebook/react,supriyantomaftuh/react,TaaKey/react,benchling/react,levibuzolic/react,bitshadow/react,trungda/react,thr0w/react,MichelleTodd/react,musofan/react,bleyle/react,venkateshdaram434/react,dgdblank/react,bestwpw/react,acdlite/react,joecritch/react,sekiyaeiji/react,shergin/react,agileurbanite/react,livepanzo/react,OculusVR/react,jquense/react,mtsyganov/react,btholt/react,jzmq/react,gpbl/react,tomocchino/react,zhangwei001/react,jsdf/react,javascriptit/react,magalhas/react,psibi/react,1234-/react,huanglp47/react,bspaulding/react,ABaldwinHunter/react-engines,zorojean/react,skevy/react,ashwin01/react,zhangwei900808/react,wudouxingjun/react,jeffchan/react,joecritch/react,cody/react,krasimir/react,KevinTCoughlin/react,soulcm/react,jdlehman/react,AnSavvides/react,TaaKey/react,pdaddyo/react,vincentism/react,dittos/react,niubaba63/react,leohmoraes/react,jmacman007/react,blainekasten/react,yungsters/react,btholt/react,lucius-feng/react,pandoraui/react,roylee0704/react,VioletLife/react,MoOx/react,joecritch/react,alwayrun/react,studiowangfei/react,1234-/react,nickpresta/react,gajus/react,afc163/react,mgmcdermott/react,sitexa/react,iamchenxin/react,flarnie/react,silkapp/react,kakadiya91/react,qq316278987/react,IndraVikas/react,TheBlasfem/react,nickpresta/react,chippieTV/react,obimod/react,skomski/react,digideskio/react,kolmstead/react,zhengqiangzi/react,bspaulding/react,orzyang/react,rlugojr/react,gxr1020/react,Duc-Ngo-CSSE/react,iOSDevBlog/react,yabhis/react,mjackson/react,k-cheng/react,magalhas/react,songawee/react,microlv/react,gold3bear/react,guoshencheng/react,gfogle/react,digideskio/react,szhigunov/react,magalhas/react,it33/react,shergin/react,dortonway/react,jkcaptain/react,edvinerikson/react,zorojean/react,mosoft521/react,8398a7/react,Jyrno42/react,empyrical/react,laskos/react,chenglou/react,gitignorance/react,joshblack/react,rohannair/react,phillipalexander/react,Spotinux/react,dilidili/react,linqingyicen/react,jordanpapaleo/react,mardigtch/react,empyrical/react,mhhegazy/react,with-git/react,Spotinux/react,alexanther1012/react,haoxutong/react,devonharvey/react,garbles/react,darobin/react,ms-carterk/react,stanleycyang/react,laskos/react,supriyantomaftuh/react,mohitbhatia1994/react,phillipalexander/react,vjeux/react,neusc/react,blainekasten/react,ABaldwinHunter/react-classic,silkapp/react,trellowebinars/react,juliocanares/react,jzmq/react,howtolearntocode/react,devonharvey/react,6feetsong/react,lina/react,psibi/react,diegobdev/react,zofuthan/react,pwmckenna/react,skyFi/react,wzpan/react,stardev24/react,zs99/react,qq316278987/react,claudiopro/react,MoOx/react,nathanmarks/react,mcanthony/react,howtolearntocode/react,it33/react,luomiao3/react,rgbkrk/react,mjul/react,conorhastings/react,greysign/react,shripadk/react,mik01aj/react,wuguanghai45/react,rlugojr/react,easyfmxu/react,BorderTravelerX/react,leohmoraes/react,edmellum/react,dgreensp/react,wudouxingjun/react,chrisjallen/react,zorojean/react,sebmarkbage/react,ning-github/react,Lonefy/react,hejld/react,andreypopp/react,slongwang/react,marocchino/react,MotherNature/react,iOSDevBlog/react,VukDukic/react,dgladkov/react,k-cheng/react,aaron-goshine/react,flarnie/react,perterest/react,sergej-kucharev/react,concerned3rdparty/react,sdiaz/react,AnSavvides/react,mfunkie/react,scottburch/react,TaaKey/react,wesbos/react,salzhrani/react,arush/react,ipmobiletech/react,k-cheng/react,framp/react,jasonwebster/react,bruderstein/server-react,mjul/react,sejoker/react,shergin/react,roth1002/react,miaozhirui/react,TheBlasfem/react,wmydz1/react,dariocravero/react,gpbl/react,edmellum/react,dirkliu/react,venkateshdaram434/react,pod4g/react,chinakids/react,yiminghe/react,vjeux/react,ericyang321/react,STRML/react,pyitphyoaung/react,neomadara/react,aaron-goshine/react,jzmq/react,wmydz1/react,S0lahart-AIRpanas-081905220200-Service/react,nickpresta/react,1040112370/react,bspaulding/react,0x00evil/react,mgmcdermott/react,edmellum/react,pandoraui/react,ninjaofawesome/reaction,aickin/react,0x00evil/react,jagdeesh109/react,jameszhan/react,patryknowak/react,kieranjones/react,sarvex/react,dortonway/react,quip/react,pletcher/react,edvinerikson/react,kaushik94/react,IndraVikas/react,gougouGet/react,tywinstark/react,jameszhan/react,joecritch/react,chrismoulton/react,pdaddyo/react,guoshencheng/react,silvestrijonathan/react,orzyang/react,jdlehman/react,iamchenxin/react,linmic/react,brian-murray35/react,salier/react,joe-strummer/react,mingyaaaa/react,theseyi/react,it33/react,conorhastings/react,ABaldwinHunter/react-classic,dgreensp/react,arasmussen/react,flipactual/react,dmatteo/react,blainekasten/react,yongxu/react,neomadara/react,ledrui/react,andreypopp/react,iamdoron/react,elquatro/react,MichelleTodd/react,kchia/react,magalhas/react,zilaiyedaren/react,1yvT0s/react,ridixcr/react,DJCordhose/react,OculusVR/react,ameyms/react,cody/react,dilidili/react,jmacman007/react,jbonta/react,Spotinux/react,Jyrno42/react,iamchenxin/react,pze/react,staltz/react,VukDukic/react,gregrperkins/react,tarjei/react,niubaba63/react,sitexa/react,aickin/react,tarjei/react,iamdoron/react,prometheansacrifice/react,1234-/react,spt110/react,mardigtch/react,nathanmarks/react,juliocanares/react,joecritch/react,TaaKey/react,greyhwndz/react,afc163/react,digideskio/react,jsdf/react,theseyi/react,jedwards1211/react,agideo/react,vikbert/react,joshblack/react,mjackson/react,KevinTCoughlin/react,arkist/react,kamilio/react,brigand/react,syranide/react,jimfb/react,glenjamin/react,yungsters/react,LoQIStar/react,roylee0704/react,bleyle/react,wesbos/react,nathanmarks/react,dittos/react,TaaKey/react,tomv564/react,pod4g/react,mgmcdermott/react,VioletLife/react,odysseyscience/React-IE-Alt,patryknowak/react,zyt01/react,liyayun/react,laogong5i0/react,jimfb/react,reggi/react,jeffchan/react,xiaxuewuhen001/react,Chiens/react,shadowhunter2/react,laskos/react,vincentism/react,apaatsio/react,with-git/react,aickin/react,xiaxuewuhen001/react,vikbert/react,mfunkie/react,kalloc/react,chicoxyzzy/react,chenglou/react,bhamodi/react,ThinkedCoder/react,edmellum/react,gxr1020/react,gfogle/react,salzhrani/react,yulongge/react,huanglp47/react,rasj/react,stardev24/react,shripadk/react,krasimir/react,vincentism/react,algolia/react,jzmq/react,rasj/react,psibi/react,joon1030/react,chippieTV/react,kakadiya91/react,lennerd/react,zeke/react,zeke/react,jquense/react,ouyangwenfeng/react,vincentism/react,michaelchum/react,angeliaz/react,yisbug/react,ljhsai/react,yiminghe/react,howtolearntocode/react,psibi/react,react-china/react-docs,alwayrun/react,joshbedo/react,wangyzyoga/react,VukDukic/react,afc163/react,jbonta/react,yangshun/react,gitignorance/react,yiminghe/react,krasimir/react,prometheansacrifice/react,alexanther1012/react,with-git/react,varunparkhe/react,zofuthan/react,bitshadow/react,gj262/react,aaron-goshine/react,chrisjallen/react,sejoker/react,dilidili/react,odysseyscience/React-IE-Alt,jeromjoy/react,andreypopp/react,TaaKey/react,zanjs/react,iamchenxin/react,mhhegazy/react,flarnie/react,easyfmxu/react,afc163/react,stevemao/react,gitoneman/react,chicoxyzzy/react,ashwin01/react,mgmcdermott/react,chippieTV/react,MichelleTodd/react,tako-black/react-1,Jericho25/react,quip/react,richiethomas/react,chenglou/react,sverrejoh/react,chicoxyzzy/react,gold3bear/react,cody/react,deepaksharmacse12/react,hejld/react,arasmussen/react,Datahero/react,AlmeroSteyn/react,easyfmxu/react,wzpan/react,nathanmarks/react,Instrument/react,yangshun/react,thr0w/react,restlessdesign/react,arush/react,AmericanSundown/react,supriyantomaftuh/react,mgmcdermott/react,zigi74/react,kakadiya91/react,hzoo/react,popovsh6/react,S0lahart-AIRpanas-081905220200-Service/react,joshblack/react,james4388/react,leeleo26/react,xiaxuewuhen001/react,nhunzaker/react,rickbeerendonk/react,zs99/react,STRML/react,ThinkedCoder/react,liyayun/react,vipulnsward/react,easyfmxu/react,arkist/react | ---
+++
@@ -1,10 +1,16 @@
'use strict';
-var visitors = require('./vendor/fbtransform/visitors').transformVisitors;
+var visitors = require('./vendor/fbtransform/visitors');
var transform = require('jstransform').transform;
module.exports = {
- transform: function(code) {
- return transform(visitors.react, code).code;
+ transform: function(code, options) {
+ var visitorList;
+ if (options && options.harmony) {
+ visitorList = visitors.getAllVisitors();
+ } else {
+ visitorList = visitors.transformVisitors.react;
+ }
+ return transform(visitorList, code).code;
}
}; |
d126cd694e312aa862a2d0d0260e6974ea7cd6f6 | src/containers/NewsFeedContainer.js | src/containers/NewsFeedContainer.js | /* NewsFeedContainer.js
* Container for our NewsFeed as a view
* Dependencies: ActionTypes
* Modules: NewsActions, and NewsFeed
* Author: Tiffany Tse
* Created: July 29, 2017
*/
//import dependencie
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
//import modules
import { loadNews } from '../actions/NewsActions';
import NewsFeed from '../component/NewsFeed'
//create state for mapStateToProps which exposes state tree's news property as a prop
//to NewsFeed called news
const mapStateToProps = state ({
news: state.news
});
//create the dispatcher for actions as a prop
const mapDispatchToProps = dispatch => (
bindActionCreators({ loadNews}, dispatch)
);
//export mapStateToProps and mapDispatchToProps as props to to newsFeed
export default connect(mapStateToProps, mapDispatchToProps)(NewsFeed); | /* NewsFeedContainer.js
* Container for our NewsFeed as a view
* Dependencies: ActionTypes
* Modules: NewsActions, and NewsFeed
* Author: Tiffany Tse
* Created: July 29, 2017
*/
//import dependencie
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
//import modules
import { loadNews } from '../actions/NewsActions';
import NewsFeed from '../component/NewsFeed'
import { reshapeNewsData } from '../util/dataTransformations';
//create state for mapStateToProps which exposes state tree's news property as a prop
//to NewsFeed called news
const mapStateToProps = state ({
news: reshapeNewsData(state.news);
});
//create the dispatcher for actions as a prop
const mapDispatchToProps = dispatch => (
bindActionCreators({ loadNews}, dispatch)
);
//export mapStateToProps and mapDispatchToProps as props to to newsFeed
export default connect(mapStateToProps, mapDispatchToProps)(NewsFeed); | Refactor mapStateToProps to use reshapeNewsData | Refactor mapStateToProps to use reshapeNewsData
| JavaScript | mit | titse/NYTimes-Clone,titse/NYTimes-Clone,titse/NYTimes-Clone | ---
+++
@@ -11,11 +11,12 @@
//import modules
import { loadNews } from '../actions/NewsActions';
import NewsFeed from '../component/NewsFeed'
+import { reshapeNewsData } from '../util/dataTransformations';
//create state for mapStateToProps which exposes state tree's news property as a prop
//to NewsFeed called news
const mapStateToProps = state ({
- news: state.news
+ news: reshapeNewsData(state.news);
});
//create the dispatcher for actions as a prop |
943cbe5cb8e1ca0d2fc10dd04d6c300d60e34da3 | seasoned_api/src/cache/redis.js | seasoned_api/src/cache/redis.js | const redis = require("redis")
const client = redis.createClient()
class Cache {
/**
* Retrieve an unexpired cache entry by key.
* @param {String} key of the cache entry
* @returns {Promise}
*/
get(key) {
return new Promise((resolve, reject) => {
client.get(key, (error, reply) => {
if (reply == null) {
reject()
}
resolve(JSON.parse(reply))
})
})
}
/**
* Insert cache entry with key and value.
* @param {String} key of the cache entry
* @param {String} value of the cache entry
* @param {Number} timeToLive the number of seconds before entry expires
* @returns {Object}
*/
set(key, value, timeToLive = 10800) {
const json = JSON.stringify(value);
client.set(key, json, (error, reply) => {
if (reply == 'OK') {
// successfully set value with key, now set TTL for key
client.expire(key, timeToLive, (e) => {
if (e)
console.error('Unexpected error while setting expiration for key:', key, '. Error:', error)
})
}
})
return value
}
}
module.exports = Cache;
| const redis = require("redis")
const client = redis.createClient()
class Cache {
/**
* Retrieve an unexpired cache entry by key.
* @param {String} key of the cache entry
* @returns {Promise}
*/
get(key) {
return new Promise((resolve, reject) => {
client.get(key, (error, reply) => {
if (reply == null) {
return reject()
}
resolve(JSON.parse(reply))
})
})
}
/**
* Insert cache entry with key and value.
* @param {String} key of the cache entry
* @param {String} value of the cache entry
* @param {Number} timeToLive the number of seconds before entry expires
* @returns {Object}
*/
set(key, value, timeToLive = 10800) {
if (value == null || key == null)
return null
const json = JSON.stringify(value);
client.set(key, json, (error, reply) => {
if (reply == 'OK') {
// successfully set value with key, now set TTL for key
client.expire(key, timeToLive, (e) => {
if (e)
console.error('Unexpected error while setting expiration for key:', key, '. Error:', error)
})
}
})
return value
}
}
module.exports = Cache;
| Return rejected promise and don't set cache if key or value is null. | Return rejected promise and don't set cache if key or value is null.
| JavaScript | mit | KevinMidboe/seasonedShows,KevinMidboe/seasonedShows,KevinMidboe/seasonedShows,KevinMidboe/seasonedShows | ---
+++
@@ -11,7 +11,7 @@
return new Promise((resolve, reject) => {
client.get(key, (error, reply) => {
if (reply == null) {
- reject()
+ return reject()
}
resolve(JSON.parse(reply))
@@ -27,6 +27,9 @@
* @returns {Object}
*/
set(key, value, timeToLive = 10800) {
+ if (value == null || key == null)
+ return null
+
const json = JSON.stringify(value);
client.set(key, json, (error, reply) => {
if (reply == 'OK') { |
891bccd617b93507a9d9d554b253730e1b4d92e8 | test/can_test.js | test/can_test.js | steal('can/util/mvc.js')
.then('funcunit/qunit',
'can/test/fixture.js')
.then(function() {
// Set the test timeout to five minutes
QUnit.config.testTimeout = 300000;
})
.then('./mvc_test.js',
'can/construct/construct_test.js',
'can/observe/observe_test.js',
'can/view/view_test.js',
'can/control/control_test.js',
'can/model/model_test.js',
'can/view/ejs/ejs_test.js')
| steal('can/util/mvc.js')
.then('funcunit/qunit',
'can/test/fixture.js')
.then(function() {
// Set the test timeout to five minutes
QUnit.config.testTimeout = 300000;
var oldmodule = module,
library = 'jQuery';
if (window.STEALDOJO){
library = 'Dojo';
} else if( window.STEALMOO) {
library = 'Mootools';
} else if(window.STEALYUI){
library = 'YUI';
} else if(window.STEALZEPTO){
library = 'Zepto';
}
window.module = function(name, testEnvironment) {
oldmodule(library + '/' + name, testEnvironment);
}
})
.then('./mvc_test.js',
'can/construct/construct_test.js',
'can/observe/observe_test.js',
'can/view/view_test.js',
'can/control/control_test.js',
'can/model/model_test.js',
'can/view/ejs/ejs_test.js')
| Make QUnit module declarations append the name of the library being used | Make QUnit module declarations append the name of the library being used
| JavaScript | mit | beno/canjs,asavoy/canjs,UXsree/canjs,airhadoken/canjs,Psykoral/canjs,ackl/canjs,bitovi/canjs,rjgotten/canjs,thomblake/canjs,patrick-steele-idem/canjs,juristr/canjs,dimaf/canjs,cohuman/canjs,rjgotten/canjs,mindscratch/canjs,shiftplanning/canjs,schmod/canjs,sporto/canjs,yusufsafak/canjs,gsmeets/canjs,sporto/canjs,Psykoral/canjs,yusufsafak/canjs,janza/canjs,jebaird/canjs,bitovi/canjs,juristr/canjs,thecountofzero/canjs,cohuman/canjs,whitecolor/canjs,beno/canjs,WearyMonkey/canjs,rasjani/canjs,gsmeets/canjs,schmod/canjs,ackl/canjs,asavoy/canjs,cohuman/canjs,azazel75/canjs,rjgotten/canjs,scorphus/canjs,dispatchrabbi/canjs,Psykoral/canjs,jebaird/canjs,thomblake/canjs,tracer99/canjs,WearyMonkey/canjs,SpredfastLegacy/canjs,airhadoken/canjs,whitecolor/canjs,rjgotten/canjs,Psykoral/canjs,shiftplanning/canjs,patrick-steele-idem/canjs,dimaf/canjs,SpredfastLegacy/canjs,scorphus/canjs,tracer99/canjs,rasjani/canjs,jebaird/canjs,rasjani/canjs,tracer99/canjs,mindscratch/canjs,WearyMonkey/canjs,azazel75/canjs,sporto/canjs,beno/canjs,whitecolor/canjs,bitovi/canjs,bitovi/canjs,gsmeets/canjs,UXsree/canjs,patrick-steele-idem/canjs,ackl/canjs,dispatchrabbi/canjs,schmod/canjs,thecountofzero/canjs,rasjani/canjs,janza/canjs | ---
+++
@@ -4,6 +4,20 @@
.then(function() {
// Set the test timeout to five minutes
QUnit.config.testTimeout = 300000;
+ var oldmodule = module,
+ library = 'jQuery';
+ if (window.STEALDOJO){
+ library = 'Dojo';
+ } else if( window.STEALMOO) {
+ library = 'Mootools';
+ } else if(window.STEALYUI){
+ library = 'YUI';
+ } else if(window.STEALZEPTO){
+ library = 'Zepto';
+ }
+ window.module = function(name, testEnvironment) {
+ oldmodule(library + '/' + name, testEnvironment);
+ }
})
.then('./mvc_test.js',
'can/construct/construct_test.js', |
c766b6c025278b79a6e9daaaeb7728bb59ede9c9 | template/browser-sync.config.js | template/browser-sync.config.js | module.exports = {
port: 3001,
{{#notServer}}server: true,
startPath: {{#lib}}"demo.html"{{/lib}}{{#client}}"index.html"{{/client}},
{{/notServer}}files: [ 'build/*'{{#lib}}, 'demo.html'{{/lib}}{{#server}}, "src/views/index.html"{{/server}}{{#clientOnly}}, "index.html"{{/clientOnly}} ]
};
| module.exports = {
port: 3001,
ghostMode: false,
notify: false,
{{#notServer}}server: true,
startPath: {{#lib}}"demo.html"{{/lib}}{{#client}}"index.html"{{/client}},
{{/notServer}}files: [ 'build/*'{{#lib}}, 'demo.html'{{/lib}}{{#server}}, "src/views/index.html"{{/server}}{{#clientOnly}}, "index.html"{{/clientOnly}} ]
};
| Disable browsersync ghostMode (user actions mirroring) and notify (corner notifications) | Disable browsersync ghostMode (user actions mirroring) and notify
(corner notifications)
| JavaScript | mit | maxkfranz/slush-js,maxkfranz/slush-js | ---
+++
@@ -1,5 +1,7 @@
module.exports = {
port: 3001,
+ ghostMode: false,
+ notify: false,
{{#notServer}}server: true,
startPath: {{#lib}}"demo.html"{{/lib}}{{#client}}"index.html"{{/client}},
{{/notServer}}files: [ 'build/*'{{#lib}}, 'demo.html'{{/lib}}{{#server}}, "src/views/index.html"{{/server}}{{#clientOnly}}, "index.html"{{/clientOnly}} ] |
d70463cd29560573006a61b9b558de2db84bbce4 | javascript/router.js | javascript/router.js | angular.module('Gistter')
.config([$routeProvider, function($routeProvider) {
$routeProvider
.when('/', {
controller: 'TwitterController',
templateUrl: 'templates/index/index.html'
});
}]);
| angular.module('Gistter')
.config(['$routeProvider', function($routeProvider) {
$routeProvider
.when('/', {
controller: 'TwitterController',
templateUrl: 'templates/index/index.html'
});
}]);
| Fix route provider to be string for minification | Fix route provider to be string for minification
| JavaScript | mit | Thrashmandicoot/Gistter,Thrashmandicoot/Gistter | ---
+++
@@ -1,6 +1,6 @@
angular.module('Gistter')
-.config([$routeProvider, function($routeProvider) {
+.config(['$routeProvider', function($routeProvider) {
$routeProvider
.when('/', { |
7c422706dc38f151a0cf2c1172c1371f4ccbcf9f | app/app.js | app/app.js | 'use strict';
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
// Top-level React (pure functional) component:
const App = () => (
<div>
Hello, World!
</div>
);
// Inject into #app HTML element:
ReactDOM.render(<App />, document.getElementById('app'));
| Introduce main React component DOM injector | feat: Introduce main React component DOM injector
| JavaScript | mit | IsenrichO/DaviePoplarCapital,IsenrichO/DaviePoplarCapital | ---
+++
@@ -0,0 +1,13 @@
+'use strict';
+import React, { Component } from 'react';
+import ReactDOM from 'react-dom';
+
+// Top-level React (pure functional) component:
+const App = () => (
+ <div>
+ Hello, World!
+ </div>
+);
+
+// Inject into #app HTML element:
+ReactDOM.render(<App />, document.getElementById('app')); | |
a2779a379a4df0237e515c4b77845a672b47e9de | protractor-conf.js | protractor-conf.js | var url = 'http://127.0.0.1:8000/'; // This should be local webserver
var capabilities = {
'browserName': 'firefox'
},
if (process.env.TRAVIS) {
url = 'https://b3ncr.github.io/angular-xeditable/' // Change to your dev server
capabilities["tunnel-identifier"] = process.env.TRAVIS_JOB_NUMBER; // this is required by saucelabs
}
exports.config = {
baseUrl: url,
seleniumAddress: 'http://localhost:4444/wd/hub',
capabilities: capabilities,
specs: ['docs/demos/text-simple/test-spec.js']
};
| var url = 'http://127.0.0.1:8000/'; // This should be local webserver
var capabilities = {
'browserName': 'firefox'
};
if (process.env.TRAVIS) {
url = 'https://b3ncr.github.io/angular-xeditable/'; // Change to your dev server
capabilities["tunnel-identifier"] = process.env.TRAVIS_JOB_NUMBER; // this is required by saucelabs
}
exports.config = {
baseUrl: url,
seleniumAddress: 'http://localhost:4444/wd/hub',
capabilities: capabilities,
specs: ['docs/demos/text-simple/test-spec.js']
};
| Fix syntax errors in protractor.conf.js | Fix syntax errors in protractor.conf.js
| JavaScript | mit | B3nCr/angular-xeditable,B3nCr/angular-xeditable | ---
+++
@@ -1,9 +1,9 @@
var url = 'http://127.0.0.1:8000/'; // This should be local webserver
var capabilities = {
'browserName': 'firefox'
-},
+};
if (process.env.TRAVIS) {
- url = 'https://b3ncr.github.io/angular-xeditable/' // Change to your dev server
+ url = 'https://b3ncr.github.io/angular-xeditable/'; // Change to your dev server
capabilities["tunnel-identifier"] = process.env.TRAVIS_JOB_NUMBER; // this is required by saucelabs
}
|
0332a515299bb4325e8ba97640b25ec5d5b9e35c | controllers/movies.js | controllers/movies.js | import models from '../models';
import express from 'express';
import _ from 'lodash';
let router = express.Router();
const defaults = {
limit: 10,
page: 1,
category: null
};
router.get('/', (req, res) => {
let params = _.defaults(req.query, defaults);
let category = params.category ? {'name': params.category} : {};
models.Movie.findAndCountAll({
include: [ models.Torrent,
{ model: models.Category, where: category }
],
offset: (params.limit * params.page) - params.limit,
limit: params.limit
}).then(movies => {
res.json({
data: {
total: movies.count,
page: parseInt(params.page, 10),
limit: parseInt(params.limit, 10)
},
movies: movies.rows
});
});
});
export default router;
| import models from '../models';
import express from 'express';
import _ from 'lodash';
let router = express.Router();
const defaults = {
limit: 10,
page: 1,
category: null
};
router.get('/', (req, res) => {
let params = _.defaults(req.query, defaults);
let category = params.category ? {'name': params.category} : {};
models.Movie.findAndCountAll({
include: [ models.Torrent,
{ model: models.Category, where: category }
],
offset: (params.limit * params.page) - params.limit,
limit: params.limit
}).then(movies => {
res.json({
data: {
total: movies.count,
page: parseInt(params.page, 10),
limit: parseInt(params.limit, 10)
},
movies: movies.rows
});
});
});
router.get('/:movie_id', (req, res) => {
models.MovieDetails.findOne({
include: [models.MovieArtwork, models.Director, models.Actor],
where: {
'MovieId': req.params.movie_id
}
}).then(movie => {
models.Torrent.findAll({
where: {
'MovieId': movie.MovieId
}
}).then(torrent => {
let data = movie.dataValues;
data.Torrents = torrent;
res.json(movie.dataValues);
});
}).catch(err => {
res.json(err);
});
});
export default router;
| Add get movie details endpoint | Add get movie details endpoint
| JavaScript | mit | sabarasaba/moviez.city-server,sabarasaba/moviezio-server,sabarasaba/moviez.city-server,sabarasaba/moviezio-server | ---
+++
@@ -32,4 +32,28 @@
});
});
+router.get('/:movie_id', (req, res) => {
+
+ models.MovieDetails.findOne({
+ include: [models.MovieArtwork, models.Director, models.Actor],
+ where: {
+ 'MovieId': req.params.movie_id
+ }
+ }).then(movie => {
+ models.Torrent.findAll({
+ where: {
+ 'MovieId': movie.MovieId
+ }
+ }).then(torrent => {
+ let data = movie.dataValues;
+ data.Torrents = torrent;
+
+ res.json(movie.dataValues);
+ });
+ }).catch(err => {
+ res.json(err);
+ });
+
+});
+
export default router; |
75baec7f3797772247970f7e3842764880ae5d93 | site/src/components/introduction/decorate-bars.js | site/src/components/introduction/decorate-bars.js | var width = 500, height = 250;
var container = d3.select('#decorate-bars')
.append('svg')
.attr({'width': width, 'height': height});
var dataGenerator = fc.data.random.financial()
.startDate(new Date(2014, 1, 1));
var data = dataGenerator(20);
var xScale = fc.scale.dateTime()
.domain(fc.util.extent().fields('date')(data))
.range([0, width]);
var yScale = d3.scale.linear()
.domain(fc.util.extent().fields(['high', 'low'])(data))
.range([height, 0]);
//START
var color = d3.scale.category10();
var bar = fc.series.bar()
.xScale(xScale)
.yScale(yScale)
.decorate(function(s) {
s.enter()
.select('.bar > path')
.style('fill', function(d, i) {
return color(i);
});
});
//END
container.append('g')
.datum(data)
.call(bar);
| var width = 500, height = 250;
var container = d3.select('#decorate-bars')
.append('svg')
.attr({'width': width, 'height': height});
var dataGenerator = fc.data.random.financial()
.startDate(new Date(2014, 1, 1));
var data = dataGenerator(20);
var xScale = fc.scale.dateTime()
.domain(fc.util.extent().fields('date').pad(0.1)(data))
.range([0, width]);
var yScale = d3.scale.linear()
.domain(fc.util.extent().fields(['high', 'low'])(data))
.range([height, 0]);
//START
var color = d3.scale.category10();
var bar = fc.series.bar()
.xScale(xScale)
.yScale(yScale)
.xValue(function(d) { return d.date; })
.yValue(function(d) { return d.close; })
.decorate(function(s) {
s.enter()
.select('.bar > path')
.style('fill', function(d, i) {
return color(i);
});
});
//END
container.append('g')
.datum(data)
.call(bar);
| Fix site bar decorate example - specify correct accessors and pad x-domain | Fix site bar decorate example - specify correct accessors and pad x-domain
| JavaScript | mit | alisd23/d3fc-d3v4,djmiley/d3fc,alisd23/d3fc-d3v4,alisd23/d3fc-d3v4,djmiley/d3fc,djmiley/d3fc | ---
+++
@@ -8,7 +8,7 @@
var data = dataGenerator(20);
var xScale = fc.scale.dateTime()
- .domain(fc.util.extent().fields('date')(data))
+ .domain(fc.util.extent().fields('date').pad(0.1)(data))
.range([0, width]);
var yScale = d3.scale.linear()
@@ -21,6 +21,8 @@
var bar = fc.series.bar()
.xScale(xScale)
.yScale(yScale)
+ .xValue(function(d) { return d.date; })
+ .yValue(function(d) { return d.close; })
.decorate(function(s) {
s.enter()
.select('.bar > path') |
2ee0d06764f0033c767d2a143dd8b6e59e58006c | bin/cli.js | bin/cli.js | #!/usr/bin/env node
var minimist = require('minimist');
if (process.argv.length < 3) {
printUsage();
process.exit(1);
}
var command = process.argv[2];
var args = minimist(process.argv.slice(3));
var pwd = process.cwd();
switch (command) {
case 'help':
printUsage();
break;
case 'new':
if (args._.length !== 1) {
printUsage();
process.exit(1);
}
var create = require('../lib/create.js').default;
create(pwd, args._[0], args.rust || args.r || 'default');
break;
}
function printUsage() {
console.log("Usage:");
console.log();
console.log(" neon new <name> [--rust|-r nightly|stable|default]");
console.log(" create a new Neon project");
console.log();
console.log(" neon help");
console.log(" print this usage information");
console.log();
}
| #!/usr/bin/env node
var path = require('path')
var minimist = require('minimist');
var pkg = require(path.resolve(__dirname, '../package.json'));
if (process.argv.length < 3) {
printUsage();
process.exit(1);
}
var command = process.argv[2];
var args = minimist(process.argv.slice(3));
var pwd = process.cwd();
switch (command) {
case 'version':
console.log(pkg.version)
break;
case 'help':
printUsage();
break;
case 'new':
if (args._.length !== 1) {
printUsage();
process.exit(1);
}
var create = require('../lib/create.js').default;
create(pwd, args._[0], args.rust || args.r || 'default');
break;
}
function printUsage() {
console.log();
console.log("Usage:");
console.log();
console.log(" neon new <name> [--rust|-r nightly|stable|default]");
console.log(" create a new Neon project");
console.log();
console.log(" neon help");
console.log(" print this usage information");
console.log();
console.log(" neon version");
console.log(" print neon-cli version");
console.log();
console.log("neon-cli@" + pkg.version + " " + path.dirname(__dirname));
}
| Add neon version and print the package version in the usage info | Add neon version and print the package version in the usage info
| JavaScript | apache-2.0 | rustbridge/neon-cli,dherman/rust-bindings,dherman/neon-cli,neon-bindings/neon-cli,dherman/rust-bindings,rustbridge/neon,rustbridge/neon,neon-bindings/neon,neon-bindings/neon,neon-bindings/neon,rustbridge/neon,rustbridge/neon,dherman/neon-cli,neon-bindings/neon-cli,dherman/nanny,rustbridge/neon,neon-bindings/neon,neon-bindings/neon-cli,dherman/nanny,dherman/nanny,dherman/neon-cli,rustbridge/neon,dherman/nanny,rustbridge/neon-cli | ---
+++
@@ -1,6 +1,8 @@
#!/usr/bin/env node
+var path = require('path')
var minimist = require('minimist');
+var pkg = require(path.resolve(__dirname, '../package.json'));
if (process.argv.length < 3) {
printUsage();
@@ -12,6 +14,9 @@
var pwd = process.cwd();
switch (command) {
+case 'version':
+ console.log(pkg.version)
+ break;
case 'help':
printUsage();
break;
@@ -27,6 +32,7 @@
}
function printUsage() {
+ console.log();
console.log("Usage:");
console.log();
console.log(" neon new <name> [--rust|-r nightly|stable|default]");
@@ -35,4 +41,8 @@
console.log(" neon help");
console.log(" print this usage information");
console.log();
+ console.log(" neon version");
+ console.log(" print neon-cli version");
+ console.log();
+ console.log("neon-cli@" + pkg.version + " " + path.dirname(__dirname));
} |
5d47571ac1c7e72b2772af48b3a260fb5e08b441 | components/ionLoading/ionLoading.js | components/ionLoading/ionLoading.js | IonLoading = {
show: function (userOptions) {
var userOptions = userOptions || {};
var options = _.extend({
delay: 0,
duration: null,
customTemplate: null,
backdrop: false
}, userOptions);
if (options.backdrop) {
IonBackdrop.retain();
$('.backdrop').addClass('backdrop-loading');
}
Meteor.setTimeout(function () {
this.template = Template['ionLoading'];
this.view = Blaze.renderWithData(this.template, {template: options.customTemplate}, $('.ionic-body').get(0));
var $loadingEl = $(this.view.firstNode());
$loadingEl.addClass('visible');
Meteor.setTimeout(function () {
$loadingEl.addClass('active');
}, 10);
}.bind(this), options.delay);
if (options.duration) {
Meteor.setTimeout(function () {
this.hide();
}.bind(this), options.duration);
}
},
hide: function () {
var $loadingEl = $(this.view.firstNode());
$loadingEl.removeClass('active');
Meteor.setTimeout(function () {
IonBackdrop.release();
$loadingEl.removeClass('visible');
Blaze.remove(this.view);
}.bind(this), 400);
}
};
| IonLoading = {
show: function (userOptions) {
var userOptions = userOptions || {};
var options = _.extend({
delay: 0,
duration: null,
customTemplate: null,
backdrop: false
}, userOptions);
if (options.backdrop) {
IonBackdrop.retain();
$('.backdrop').addClass('backdrop-loading');
}
Meteor.setTimeout(function () {
this.template = Template['ionLoading'];
this.view = Blaze.renderWithData(this.template, {template: options.customTemplate}, $('.ionic-body').get(0));
var $loadingEl = $(this.view.firstNode());
$loadingEl.addClass('visible');
Meteor.setTimeout(function () {
$loadingEl.addClass('active');
}, 10);
}.bind(this), options.delay);
if (options.duration) {
Meteor.setTimeout(function () {
this.hide();
}.bind(this), options.duration);
}
},
hide: function () {
if (this.view) {
var $loadingEl = $(this.view.firstNode());
$loadingEl.removeClass('active');
Meteor.setTimeout(function () {
IonBackdrop.release();
$loadingEl.removeClass('visible');
Blaze.remove(this.view);
this.view = null;
}.bind(this), 400);
}
}
};
| Fix for ion-modal spurious blaze errors | Fix for ion-modal spurious blaze errors
| JavaScript | mit | gnmfcastro/meteor-ionic,ludiculous/meteor-ionic,kalyneramon/meteor-ionic,JoeyAndres/meteor-ionic,kabaros/meteor-ionic,txs/meteor-wecare-ionic-flow,Tarang/meteor-ionic,kalyneramon/meteor-ionic,zhonglijunyi/meteor-ionic,vieko/meteor-ionic,kabaros/meteor-ionic,txs/meteor-wecare-ionic-flow,zhonglijunyi/meteor-ionic,kevohagan/meteor-ionic,johnnymitch/meteor-ionic,flyawayliwei/meteor-ionic,Paulyoufu/meteor-ionic,markoshust/meteor-ionic,srounce/meteor-ionic,ludiculous/meteor-ionic,Iced-Tea/meteor-ionic,Profab/meteor-ionic,Eynaliyev/meteor-ionic,meticulo3366/meteor-ionic,elGusto/meteor-ionic,dcsan/meteor-ionic,omeid/meteor-ionic-1,meteoric124/meteoric,kevohagan/meteor-ionic,divramod/meteor-ionic,liangsun/meteor-ionic,dcsan/meteor-ionic,jackyzonewen/meteor-ionic,jason-c-child/meteor-ionic,Eynaliyev/meteor-ionic,Tarang/meteor-ionic,meticulo3366/meteor-ionic,gwendall/meteor-ionic,jason-c-child/meteor-ionic,elGusto/meteor-ionic,srounce/meteor-ionic,meteoric/meteor-ionic,gnmfcastro/meteor-ionic,gwendall/meteor-ionic,rclai/meteor-ionic,divramod/meteor-ionic,markoshust/meteor-ionic,dcsan/meteor-ionic,johnnymitch/meteor-ionic,jackyzonewen/meteor-ionic,meteoric124/meteoric,Iced-Tea/meteor-ionic,rclai/meteor-ionic,rengokantai/meteor-ionic,omeid/meteor-ionic-1,JoeyAndres/meteor-ionic,elie222/meteor-ionic,Paulyoufu/meteor-ionic,liangsun/meteor-ionic,elie222/meteor-ionic,rengokantai/meteor-ionic,meteoric/meteor-ionic,flyawayliwei/meteor-ionic,Profab/meteor-ionic,vieko/meteor-ionic | ---
+++
@@ -33,13 +33,16 @@
},
hide: function () {
- var $loadingEl = $(this.view.firstNode());
- $loadingEl.removeClass('active');
+ if (this.view) {
+ var $loadingEl = $(this.view.firstNode());
+ $loadingEl.removeClass('active');
- Meteor.setTimeout(function () {
- IonBackdrop.release();
- $loadingEl.removeClass('visible');
- Blaze.remove(this.view);
- }.bind(this), 400);
+ Meteor.setTimeout(function () {
+ IonBackdrop.release();
+ $loadingEl.removeClass('visible');
+ Blaze.remove(this.view);
+ this.view = null;
+ }.bind(this), 400);
+ }
}
}; |
a1129daa792c56b88db0ae2248e522b458aec0d8 | tools/middleware/liveReloadMiddleware.js | tools/middleware/liveReloadMiddleware.js | /**
* Copyright 2017-present, Callstack.
* All rights reserved.
*
* MIT License
*
* Copyright (c) 2017 Mike Grabowski
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* Updated by Victor Vlasenko (SysGears INC) to prevent memory leaks and slow down,
* due to new compiler plugin registration on each HTTP request
*/
/**
* Live reload middleware
*/
function liveReloadMiddleware(compiler) {
let watchers = [];
/**
* On new `build`, notify all registered watchers to reload
*/
compiler.plugin('done', () => {
const headers = {
'Content-Type': 'application/json; charset=UTF-8',
};
watchers.forEach(watcher => {
watcher.res.writeHead(205, headers);
watcher.res.end(JSON.stringify({ changed: true }));
});
watchers = [];
});
return (req, res, next) => {
/**
* React Native client opens connection at `/onchange`
* and awaits reload signal (http status code - 205)
*/
if (req.path === '/onchange') {
const watcher = { req, res };
watchers.push(watcher);
req.on('close', () => {
watchers.splice(watchers.indexOf(watcher), 1);
});
return;
}
next();
};
}
module.exports = liveReloadMiddleware;
| function liveReloadMiddleware(compiler) {
let watchers = [];
compiler.plugin('done', () => {
const headers = {
'Content-Type': 'application/json; charset=UTF-8',
};
watchers.forEach(watcher => {
watcher.writeHead(205, headers);
watcher.end(JSON.stringify({ changed: true }));
});
watchers = [];
});
return (req, res, next) => {
if (req.path === '/onchange') {
const watcher = res;
watchers.push(watcher);
req.on('close', () => {
watchers.splice(watchers.indexOf(watcher), 1);
});
} else {
next();
}
};
}
module.exports = liveReloadMiddleware;
| Use own implementation of live reload RN middleware | Use own implementation of live reload RN middleware
| JavaScript | mit | sysgears/apollo-universal-starter-kit,sysgears/apollo-universal-starter-kit,sysgears/apollo-universal-starter-kit,sysgears/apollo-fullstack-starter-kit,sysgears/apollo-universal-starter-kit | ---
+++
@@ -1,73 +1,31 @@
-/**
- * Copyright 2017-present, Callstack.
- * All rights reserved.
- *
- * MIT License
- *
- * Copyright (c) 2017 Mike Grabowski
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Updated by Victor Vlasenko (SysGears INC) to prevent memory leaks and slow down,
- * due to new compiler plugin registration on each HTTP request
- */
-
-/**
- * Live reload middleware
- */
function liveReloadMiddleware(compiler) {
let watchers = [];
- /**
- * On new `build`, notify all registered watchers to reload
- */
compiler.plugin('done', () => {
const headers = {
'Content-Type': 'application/json; charset=UTF-8',
};
watchers.forEach(watcher => {
- watcher.res.writeHead(205, headers);
- watcher.res.end(JSON.stringify({ changed: true }));
+ watcher.writeHead(205, headers);
+ watcher.end(JSON.stringify({ changed: true }));
});
watchers = [];
});
return (req, res, next) => {
- /**
- * React Native client opens connection at `/onchange`
- * and awaits reload signal (http status code - 205)
- */
if (req.path === '/onchange') {
- const watcher = { req, res };
+ const watcher = res;
watchers.push(watcher);
req.on('close', () => {
watchers.splice(watchers.indexOf(watcher), 1);
});
-
- return;
+ } else {
+ next();
}
-
- next();
};
}
|
cfa4fec100e8597c20ce17f7cce349d065f899ca | src/main/web/florence/js/functions/_checkPathParsed.js | src/main/web/florence/js/functions/_checkPathParsed.js | function checkPathParsed (uri) {
if (uri.charAt(uri.length-1) === '/') {
uri = uri.slice(0, -1);
}
if (path.charAt(0) !== '/') {
path = '/' + path;
}
var myUrl = parseURL(uri);
return myUrl.pathname;
}
| function checkPathParsed (uri) {
if (uri.charAt(uri.length-1) === '/') {
uri = uri.slice(0, -1);
}
if (uri.charAt(0) !== '/') {
uri = '/' + uri;
}
var myUrl = parseURL(uri);
return myUrl.pathname;
}
| Refactor to ensure pathnames are all the same | Refactor to ensure pathnames are all the same
| JavaScript | mit | ONSdigital/florence,ONSdigital/florence,ONSdigital/florence,ONSdigital/florence | ---
+++
@@ -2,8 +2,8 @@
if (uri.charAt(uri.length-1) === '/') {
uri = uri.slice(0, -1);
}
- if (path.charAt(0) !== '/') {
- path = '/' + path;
+ if (uri.charAt(0) !== '/') {
+ uri = '/' + uri;
}
var myUrl = parseURL(uri);
return myUrl.pathname; |
6e34d25b98fda1cd249817bfe829583848e732dc | lib/border-radius.js | lib/border-radius.js | var _ = require('lodash')
var fs = require('fs')
var gzip = require('gzip-size')
var filesize = require('filesize')
var cssstats = require('cssstats')
var module = require('tachyons-border-radius/package.json')
var moduleCss = fs.readFileSync('node_modules/tachyons-border-radius/tachyons-border-radius.min.css', 'utf8')
var moduleObj = cssstats(moduleCss)
var moduleSize = filesize(moduleObj.gzipSize)
var srcCSS = fs.readFileSync('./src/_border-radius.css', 'utf8')
var navDocs = fs.readFileSync('./templates/nav_docs.html', 'utf8')
var template = fs.readFileSync('./templates/docs/border-radius/index.html', 'utf8')
var tpl = _.template(template)
var html = tpl({
moduleVersion: module.version,
moduleSize: moduleSize,
moduleObj: moduleObj,
srcCSS: srcCSS,
navDocs: navDocs
})
fs.writeFileSync('./docs/themes/border-radius/index.html', html)
| var _ = require('lodash')
var fs = require('fs')
var gzip = require('gzip-size')
var filesize = require('filesize')
var cssstats = require('cssstats')
var module = require('tachyons-border-radius/package.json')
var moduleCss = fs.readFileSync('node_modules/tachyons-border-radius/tachyons-border-radius.min.css', 'utf8')
var moduleObj = cssstats(moduleCss)
var moduleSize = filesize(moduleObj.gzipSize)
var srcCSS = fs.readFileSync('./src/_border-radius.css', 'utf8')
var navDocs = fs.readFileSync('./templates/nav_docs.html', 'utf8')
var siteFooter = fs.readFileSync('./templates/footer.html', 'utf8')
var template = fs.readFileSync('./templates/docs/border-radius/index.html', 'utf8')
var tpl = _.template(template)
var html = tpl({
moduleVersion: module.version,
moduleSize: moduleSize,
moduleObj: moduleObj,
srcCSS: srcCSS,
navDocs: navDocs,
siteFooter: siteFooter
})
fs.writeFileSync('./docs/themes/border-radius/index.html', html)
| Add site footer to each documentation generator | Add site footer to each documentation generator
| JavaScript | mit | tachyons-css/tachyons,cwonrails/tachyons,fenderdigital/css-utilities,getfrank/tachyons,topherauyeung/portfolio,topherauyeung/portfolio,topherauyeung/portfolio,matyikriszta/moonlit-landing-page,fenderdigital/css-utilities,pietgeursen/pietgeursen.github.io | ---
+++
@@ -11,7 +11,7 @@
var srcCSS = fs.readFileSync('./src/_border-radius.css', 'utf8')
var navDocs = fs.readFileSync('./templates/nav_docs.html', 'utf8')
-
+var siteFooter = fs.readFileSync('./templates/footer.html', 'utf8')
var template = fs.readFileSync('./templates/docs/border-radius/index.html', 'utf8')
var tpl = _.template(template)
@@ -20,7 +20,8 @@
moduleSize: moduleSize,
moduleObj: moduleObj,
srcCSS: srcCSS,
- navDocs: navDocs
+ navDocs: navDocs,
+ siteFooter: siteFooter
})
fs.writeFileSync('./docs/themes/border-radius/index.html', html) |
c37ff6db05d2e428e6ec55100321b134e7e15a65 | src/backend/routes/api/files.js | src/backend/routes/api/files.js | var express = require('express');
var router = module.exports = express.Router();
router.post('/url', function(req, res, next) {
var data = req.body,
model;
if (data.type === 'expense_attachment') {
model = req.app.get('bookshelf').models.ExpenseAttachment;
}
if (!model) return res.status(400).send({error: 'Unknown file type'});
model.forge({environment_id: req.user.get('environment_id'), id: data.id}).fetch().then(function(model) {
if (!model) return res.status(401).send({error: 'Forbidden'});
var params = {
Bucket: process.env.AWS_S3_BUCKET,
Key: model.get('s3path')
};
var url = req.s3.getSignedUrl('getObject', params);
return res.send({url: url});
}).catch(next);
});
| 'use strict';
var express = require('express');
var router = module.exports = express.Router();
router.post('/url', function(req, res, next) {
var data = req.body,
model;
if (data.type === 'expense_attachment') {
model = req.app.get('bookshelf').models.ExpenseAttachment;
} else if (data.type === 'inbox_attachment') {
model = req.app.get('bookshelf').models.InboxItemAttachment;
}
if (!model) return res.status(400).send({error: 'Unknown file type'});
model.forge({environment_id: req.user.get('environment_id'), id: data.id}).fetch().then(function(model) {
if (!model) return res.status(401).send({error: 'Forbidden'});
var params = {
Bucket: process.env.AWS_S3_BUCKET,
Key: model.get('s3path')
};
var url = req.s3.getSignedUrl('getObject', params);
return res.send({url: url});
}).catch(next);
});
| Support fetching urls for inbox attachments | Support fetching urls for inbox attachments
| JavaScript | agpl-3.0 | nnarhinen/nerve,nnarhinen/nerve | ---
+++
@@ -1,3 +1,4 @@
+'use strict';
var express = require('express');
var router = module.exports = express.Router();
@@ -7,6 +8,8 @@
model;
if (data.type === 'expense_attachment') {
model = req.app.get('bookshelf').models.ExpenseAttachment;
+ } else if (data.type === 'inbox_attachment') {
+ model = req.app.get('bookshelf').models.InboxItemAttachment;
}
if (!model) return res.status(400).send({error: 'Unknown file type'});
model.forge({environment_id: req.user.get('environment_id'), id: data.id}).fetch().then(function(model) { |
094204663537a8f9f631de79c0f98dc447029448 | Gruntfile.js | Gruntfile.js | /*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
// Metadata.
pkg: grunt.file.readJSON('package.json'),
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
// Task configuration.
uglify: {
options: {
banner: '<%= banner %>'
},
dist: {
files: {
'dist/ng-mobile-menu.min.js' : ['src/ng-mobile-menu.js']
}
}
},
less: {
dist: {
options: {
compress: true
},
files: {
"dist/ng-mobile-menu.min.css" : "src/ng-mobile-menu.less"
}
}
}
});
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-less');
// Default task.
grunt.registerTask('default', ['uglify', 'less']);
};
| /*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
// Metadata.
pkg: grunt.file.readJSON('package.json'),
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
// Task configuration.
uglify: {
options: {
banner: '<%= banner %>'
},
dist: {
files: {
'dist/ng-mobile-menu.min.js' : ['src/ng-mobile-menu.js']
}
}
},
less: {
dist: {
options: {
compress: true,
banner: '<%= banner %>'
},
files: {
"dist/ng-mobile-menu.min.css" : "src/ng-mobile-menu.less"
}
}
}
});
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-less');
// Default task.
grunt.registerTask('default', ['uglify', 'less']);
};
| Add banner to CSS files | Add banner to CSS files
| JavaScript | mit | ShoppinPal/ng-mobile-menu,Malkiat-Singh/ng-mobile-menu,ShoppinPal/ng-mobile-menu,Malkiat-Singh/ng-mobile-menu | ---
+++
@@ -24,7 +24,8 @@
less: {
dist: {
options: {
- compress: true
+ compress: true,
+ banner: '<%= banner %>'
},
files: {
"dist/ng-mobile-menu.min.css" : "src/ng-mobile-menu.less" |
2055de5634fb1daa265ca5c1845ea0b247330ea7 | Gruntfile.js | Gruntfile.js | 'use strict';
module.exports = function (grunt) {
// Load grunt tasks automatically
require('load-grunt-tasks')(grunt);
// Configure tasks
grunt.initConfig({
// Project settings
project: {
app: 'app'
},
// Watch files and execute tasks when they change
watch: {
livereload: {
options: {
livereload: '<%= connect.options.livereload %>'
},
files: [
'<%= project.app %>/*.html'
]
}
},
// Grunt servers
connect: {
options: {
port: 9000,
hostname: 'localhost',
livereload: true
},
livereload: {
options: {
open: true,
base: '<%= project.app %>'
}
}
},
wiredep: {
app: {
src: ['<%= project.app %>/index.html']
}
}
});
grunt.registerTask('serve', ['wiredep', 'connect:livereload', 'watch']);
}; | 'use strict';
module.exports = function (grunt) {
// Load grunt tasks automatically
require('load-grunt-tasks')(grunt);
// Configure tasks
grunt.initConfig({
// Project settings
project: {
app: 'app'
},
// Watch files and execute tasks when they change
watch: {
bower: {
files: ['bower.json'],
tasks: ['wiredep']
},
livereload: {
options: {
livereload: '<%= connect.options.livereload %>'
},
files: [
'<%= project.app %>/*.html'
]
}
},
// Grunt servers
connect: {
options: {
port: 9000,
hostname: 'localhost',
livereload: true
},
livereload: {
options: {
open: true,
base: '<%= project.app %>'
}
}
},
wiredep: {
app: {
src: ['<%= project.app %>/index.html']
}
}
});
grunt.registerTask('serve', ['wiredep', 'connect:livereload', 'watch']);
}; | Watch bower.json and run wiredep | Watch bower.json and run wiredep
| JavaScript | mit | thewildandy/life-graph | ---
+++
@@ -15,6 +15,10 @@
// Watch files and execute tasks when they change
watch: {
+ bower: {
+ files: ['bower.json'],
+ tasks: ['wiredep']
+ },
livereload: {
options: {
livereload: '<%= connect.options.livereload %>' |
82964068366aa00f4ffc768058eed8b423450aca | src/resolvers/ParameterResolver.js | src/resolvers/ParameterResolver.js | import BaseResolver from './BaseResolver';
import { STRING } from '../parsers/Types';
/**
* @classdesc Options resolver for command parameter definitions.
* @extends BaseResolver
*/
export default class ParameterResolver extends BaseResolver {
/**
* Constructor.
*/
constructor() {
super();
this.resolver.setRequired('name')
.setDefaults({
description: null,
optional: false,
type: STRING,
repeatable: false,
literal: false,
defaultValue: options => (options.repeatable ? [] : null),
})
.setAllowedTypes('name', 'string')
.setAllowedTypes('optional', 'boolean')
.setAllowedTypes('type', 'string')
.setAllowedTypes('repeatable', 'boolean')
.setAllowedTypes('literal', 'boolean');
}
}
| import BaseResolver from './BaseResolver';
import { STRING } from '../parsers/Types';
/**
* @classdesc Options resolver for command parameter definitions.
* @extends BaseResolver
*/
export default class ParameterResolver extends BaseResolver {
/**
* Constructor.
*/
constructor() {
super();
this.resolver.setRequired('name')
.setDefaults({
description: null,
optional: false,
type: STRING,
repeatable: false,
literal: false,
defaultValue: options => (options.repeatable ? [] : null),
})
.setAllowedTypes('name', 'string')
.setAllowedTypes('description', ['string', 'null'])
.setAllowedTypes('optional', 'boolean')
.setAllowedTypes('type', 'string')
.setAllowedTypes('repeatable', 'boolean')
.setAllowedTypes('literal', 'boolean');
}
}
| Fix resolver failing for default param descriptions. | Fix resolver failing for default param descriptions.
| JavaScript | mit | hkwu/ghastly | ---
+++
@@ -22,6 +22,7 @@
defaultValue: options => (options.repeatable ? [] : null),
})
.setAllowedTypes('name', 'string')
+ .setAllowedTypes('description', ['string', 'null'])
.setAllowedTypes('optional', 'boolean')
.setAllowedTypes('type', 'string')
.setAllowedTypes('repeatable', 'boolean') |
fc2a0b966a8c7796ff06653f4f9bc4a70101e43e | Gruntfile.js | Gruntfile.js | module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
banner: '/*! <%= pkg.name %> <%= pkg.version %> | Copyright <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> | <%= pkg.license %> License */\n',
concat: {
options: {
stripBanners: { block: true },
banner: '<%= banner %>'
},
dist: {
src: [ 'correctingInterval.js' ],
dest: 'correctingInterval.js'
}
},
uglify: {
options: {
banner: '<%= banner %>'
},
dist: {
files: {
'correctingInterval.min.js': [ 'correctingInterval.js' ]
}
}
},
jshint: {
files: [
'correctingInterval.js'
]
},
mocha: {
index: ['test/index.html'],
options: {
run: true
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-mocha');
grunt.registerTask('test', [ 'jshint', 'mocha' ]);
grunt.registerTask('compile', [ 'test', 'concat', 'uglify' ]);
grunt.registerTask('default', [ 'compile' ]);
};
| module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
banner: '/*! <%= pkg.name %> <%= pkg.version %> | Copyright <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> | <%= pkg.license %> License */\n',
concat: {
options: {
stripBanners: {
block: true
},
banner: '<%= banner %>'
},
dist: {
src: [ 'correctingInterval.js' ],
dest: 'correctingInterval.js'
}
},
uglify: {
options: {
banner: '<%= banner %>'
},
dist: {
files: {
'correctingInterval.min.js': [ 'correctingInterval.js' ]
}
}
},
jshint: {
files: [
'correctingInterval.js'
]
},
mocha: {
index: ['test/index.html'],
options: {
run: true
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-mocha');
grunt.registerTask('test', [ 'jshint', 'mocha' ]);
grunt.registerTask('compile', [ 'test', 'concat', 'uglify' ]);
grunt.registerTask('default', [ 'compile' ]);
};
| Apply consistent tabbing to gruntfile | Apply consistent tabbing to gruntfile
2 space tabs
| JavaScript | mit | aduth/correctingInterval | ---
+++
@@ -1,51 +1,53 @@
module.exports = function(grunt) {
- grunt.initConfig({
- pkg: grunt.file.readJSON('package.json'),
+ grunt.initConfig({
+ pkg: grunt.file.readJSON('package.json'),
- banner: '/*! <%= pkg.name %> <%= pkg.version %> | Copyright <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> | <%= pkg.license %> License */\n',
+ banner: '/*! <%= pkg.name %> <%= pkg.version %> | Copyright <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> | <%= pkg.license %> License */\n',
- concat: {
- options: {
- stripBanners: { block: true },
- banner: '<%= banner %>'
- },
- dist: {
- src: [ 'correctingInterval.js' ],
- dest: 'correctingInterval.js'
- }
+ concat: {
+ options: {
+ stripBanners: {
+ block: true
},
+ banner: '<%= banner %>'
+ },
+ dist: {
+ src: [ 'correctingInterval.js' ],
+ dest: 'correctingInterval.js'
+ }
+ },
- uglify: {
- options: {
- banner: '<%= banner %>'
- },
- dist: {
- files: {
- 'correctingInterval.min.js': [ 'correctingInterval.js' ]
- }
- }
- },
+ uglify: {
+ options: {
+ banner: '<%= banner %>'
+ },
+ dist: {
+ files: {
+ 'correctingInterval.min.js': [ 'correctingInterval.js' ]
+ }
+ }
+ },
- jshint: {
- files: [
- 'correctingInterval.js'
- ]
- },
+ jshint: {
+ files: [
+ 'correctingInterval.js'
+ ]
+ },
- mocha: {
- index: ['test/index.html'],
- options: {
- run: true
- }
- }
- });
+ mocha: {
+ index: ['test/index.html'],
+ options: {
+ run: true
+ }
+ }
+ });
- grunt.loadNpmTasks('grunt-contrib-uglify');
- grunt.loadNpmTasks('grunt-contrib-concat');
- grunt.loadNpmTasks('grunt-contrib-jshint');
- grunt.loadNpmTasks('grunt-mocha');
+ grunt.loadNpmTasks('grunt-contrib-uglify');
+ grunt.loadNpmTasks('grunt-contrib-concat');
+ grunt.loadNpmTasks('grunt-contrib-jshint');
+ grunt.loadNpmTasks('grunt-mocha');
- grunt.registerTask('test', [ 'jshint', 'mocha' ]);
- grunt.registerTask('compile', [ 'test', 'concat', 'uglify' ]);
- grunt.registerTask('default', [ 'compile' ]);
+ grunt.registerTask('test', [ 'jshint', 'mocha' ]);
+ grunt.registerTask('compile', [ 'test', 'concat', 'uglify' ]);
+ grunt.registerTask('default', [ 'compile' ]);
}; |
a98a9b7401212661ca170551cb3cede388fa0623 | Gruntfile.js | Gruntfile.js | module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-browserify');
grunt.registerTask('default', ['browserify']);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
browserify: {
main: {
src: 'lib/vjs-hls.js',
dest: 'debug/vjs-hls.js',
options: {
transform: ['babelify'],
browserifyOptions: {
debug: true
},
watch: true,
keepAlive: true
}
}
}
});
}
| module.exports = function(grunt) {
require("matchdep").filterDev("grunt-*").forEach(grunt.loadNpmTasks);
grunt.registerTask('default', ['browserify']);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
browserify: {
main: {
src: 'lib/vjs-hls.js',
dest: 'debug/vjs-hls.js',
options: {
transform: ['babelify'],
browserifyOptions: {
debug: true
},
watch: true,
keepAlive: true
}
}
}
});
}
| Load grunt-* dependencies with matchdep | Load grunt-* dependencies with matchdep
| JavaScript | mit | catenoid-company/videojs5-hlsjs-source-handler,streamroot/videojs5-hlsjs-source-handler,catenoid-company/videojs5-hlsjs-source-handler,streamroot/videojs5-hlsjs-source-handler | ---
+++
@@ -1,6 +1,5 @@
module.exports = function(grunt) {
- grunt.loadNpmTasks('grunt-contrib-watch');
- grunt.loadNpmTasks('grunt-browserify');
+ require("matchdep").filterDev("grunt-*").forEach(grunt.loadNpmTasks);
grunt.registerTask('default', ['browserify']);
|
801f4d56a217cee39eb08249a20c8dbd577dc030 | src/modules/filters/ThreadFilter.js | src/modules/filters/ThreadFilter.js | import FilterModule from "../FilterModule";
import { dependencies as Inject, singleton as Singleton } from "needlepoint";
import Promise from "bluebird";
import Threads from "../../util/Threads";
@Singleton
@Inject(Threads)
export default class ThreadFilter extends FilterModule {
/**
* @param {Threads} threads
*/
constructor(threads) {
super();
this.threadsToListen = threads.getThreadIds();
}
filter(msg) {
const threadId = parseInt(msg.threadID);
const shouldListen = this.threadsToListen.includes(threadId);
if (shouldListen) {
return Promise.resolve(msg);
} else {
return Promise.reject("Received message from thread (" + threadId + ") we're not listening to");
}
}
} | import FilterModule from "../FilterModule";
import { dependencies as Inject, singleton as Singleton } from "needlepoint";
import Promise from "bluebird";
import Threads from "../../util/Threads";
@Singleton
@Inject(Threads)
export default class ThreadFilter extends FilterModule {
/**
* @param {Threads} threads
*/
constructor(threads) {
super();
this.threadsToListen = threads.getThreadIds();
}
filter(msg) {
const threadId = parseInt(msg.threadID);
const shouldListen = this.threadsToListen.indexOf(threadId) !== -1;
if (shouldListen) {
return Promise.resolve(msg);
} else {
return Promise.reject("Received message from thread (" + threadId + ") we're not listening to");
}
}
} | Fix use of Array.includes not supported in current node version | Fix use of Array.includes not supported in current node version
| JavaScript | apache-2.0 | ivkos/botyo | ---
+++
@@ -17,7 +17,7 @@
filter(msg) {
const threadId = parseInt(msg.threadID);
- const shouldListen = this.threadsToListen.includes(threadId);
+ const shouldListen = this.threadsToListen.indexOf(threadId) !== -1;
if (shouldListen) {
return Promise.resolve(msg); |
152821d211418870dc90f98077a43e8c51e3f426 | lib/remove.js | lib/remove.js | "use strict";
const fs = require("./utils/fs");
const validate = require("./utils/validate");
const validateInput = (methodName, path) => {
const methodSignature = `${methodName}([path])`;
validate.argument(methodSignature, "path", path, ["string", "undefined"]);
};
// ---------------------------------------------------------
// Sync
// ---------------------------------------------------------
const removeSync = path => {
fs.rmSync(path, {
recursive: true,
force: true
});
};
// ---------------------------------------------------------
// Async
// ---------------------------------------------------------
const removeAsync = path => {
return fs.rm(path, {
recursive: true,
force: true
});
};
// ---------------------------------------------------------
// API
// ---------------------------------------------------------
exports.validateInput = validateInput;
exports.sync = removeSync;
exports.async = removeAsync;
| "use strict";
const fs = require("./utils/fs");
const validate = require("./utils/validate");
const validateInput = (methodName, path) => {
const methodSignature = `${methodName}([path])`;
validate.argument(methodSignature, "path", path, ["string", "undefined"]);
};
// ---------------------------------------------------------
// Sync
// ---------------------------------------------------------
const removeSync = path => {
fs.rmSync(path, {
recursive: true,
force: true,
maxRetries: 3
});
};
// ---------------------------------------------------------
// Async
// ---------------------------------------------------------
const removeAsync = path => {
return fs.rm(path, {
recursive: true,
force: true,
maxRetries: 3
});
};
// ---------------------------------------------------------
// API
// ---------------------------------------------------------
exports.validateInput = validateInput;
exports.sync = removeSync;
exports.async = removeAsync;
| Use same maxRetries as rimraf did | Use same maxRetries as rimraf did
| JavaScript | mit | szwacz/fs-jetpack,szwacz/fs-jetpack | ---
+++
@@ -15,7 +15,8 @@
const removeSync = path => {
fs.rmSync(path, {
recursive: true,
- force: true
+ force: true,
+ maxRetries: 3
});
};
@@ -26,7 +27,8 @@
const removeAsync = path => {
return fs.rm(path, {
recursive: true,
- force: true
+ force: true,
+ maxRetries: 3
});
};
|
ba08a8b9d3cadd484a0d3fee6a7bfc15b70f36fd | src/scripts/services/auth/config.js | src/scripts/services/auth/config.js | 'use strict';
module.exports =
/*@ngInject*/
function ($httpProvider, $stateProvider) {
$httpProvider.interceptors.push(require('./oauth_interceptor.js'));
$stateProvider.state('access_token', {
url: '/access_token={accessToken}&token_type={tokenType}&expires_in={expiresIn}',
template: '',
controller: function ($stateParams, AccessToken, $location, $state, Storage) {
var hashStr = [
'access_token=' + $stateParams.accessToken,
'token_type=' + $stateParams.tokenType,
'expires_in=' + $stateParams.expiresIn
].join('&');
AccessToken.setTokenFromString(hashStr);
var postAuthenticationRedirect = Storage.delete('postAuthenticationRedirect');
$state.go(postAuthenticationRedirect.stateName, postAuthenticationRedirect.stateParams);
}
});
};
| 'use strict';
module.exports =
/*@ngInject*/
function ($httpProvider, $stateProvider) {
$httpProvider.interceptors.push(require('./oauth_interceptor.js'));
$stateProvider.state('access_token', {
url: '/access_token={accessToken}&token_type={tokenType}&expires_in={expiresIn}',
template: '',
controller: function ($stateParams, AccessToken, $location, $state, Storage) {
var hashStr = [
'access_token=' + $stateParams.accessToken,
'token_type=' + $stateParams.tokenType,
'expires_in=' + $stateParams.expiresIn
].join('&');
AccessToken.setTokenFromString(hashStr);
var postAuthenticationRedirect = Storage.delete('postAuthenticationRedirect');
if (postAuthenticationRedirect === undefined) {
throw new Error('No Post Authentication Redirect state or params found.');
}
$state.go(postAuthenticationRedirect.stateName, postAuthenticationRedirect.stateParams);
}
});
};
| Throw error is there are now state params to redirect to upon authentication | Throw error is there are now state params to redirect to upon authentication | JavaScript | agpl-3.0 | empirical-org/Quill-Grammar,ddmck/Quill-Grammar,ddmck/Quill-Grammar,ddmck/Quill-Grammar,empirical-org/Quill-Grammar,empirical-org/Quill-Grammar | ---
+++
@@ -17,6 +17,9 @@
].join('&');
AccessToken.setTokenFromString(hashStr);
var postAuthenticationRedirect = Storage.delete('postAuthenticationRedirect');
+ if (postAuthenticationRedirect === undefined) {
+ throw new Error('No Post Authentication Redirect state or params found.');
+ }
$state.go(postAuthenticationRedirect.stateName, postAuthenticationRedirect.stateParams);
}
}); |
78e76784231ee7f9fdc9e0926bc985617b012f7e | test.js | test.js | var log = require('./log');
var TunerTwitter = require('./tuner_twitter');
var tt = TunerTwitter.create({twitterName: 'L2G', keywords: 'test'});
//var tt = TunerTwitter.create({twitterID: 14641869});
log.debug('created new TunerTwitter');
tt.on('ready', function () {
log.debug('TwitterTuner is ready');
tt.tuneIn();
});
tt.on('tunedIn', function () {
log.debug('Twitter tuner is tuned in and listening for messages');
});
tt.on('message', function (message) {
log.debug('Message from Twitter: ' + message);
});
tt.on('error', function (message) {
log.debug('Twitter tuner raised an error: ' + message);
});
tt.on('lost', function (message) {
log.debug('Twitter tuner lost its signal: ' + message);
});
tt.setup();
| var log = require('./log');
var TunerTwitter = require('./tuner_twitter');
var tt = TunerTwitter.create({twitterName: 'L2G', keywords: 'test'});
//var tt = TunerTwitter.create({twitterID: 14641869});
log.debug('created new TunerTwitter');
tt.on('ready', function () {
log.debug('TwitterTuner is ready');
tt.tuneIn();
});
tt.on('tunedIn', function () {
log.info('Twitter tuner is tuned in and listening for messages');
});
tt.on('message', function (message) {
log.info('Message from Twitter: ' + message);
});
tt.on('error', function (message) {
log.debug('Twitter tuner raised an error: ' + message);
});
tt.on('lost', function (message) {
log.debug('Twitter tuner lost its signal: ' + message);
});
tt.setup();
| Change some "debug" level log messages to "info" | Change some "debug" level log messages to "info"
| JavaScript | mit | L2G/batsig | ---
+++
@@ -9,10 +9,10 @@
tt.tuneIn();
});
tt.on('tunedIn', function () {
- log.debug('Twitter tuner is tuned in and listening for messages');
+ log.info('Twitter tuner is tuned in and listening for messages');
});
tt.on('message', function (message) {
- log.debug('Message from Twitter: ' + message);
+ log.info('Message from Twitter: ' + message);
});
tt.on('error', function (message) {
log.debug('Twitter tuner raised an error: ' + message); |
b2ef3f8fd40be85ea931a03f81dfcb2b502cbec5 | client/routes/controllers/admin_logon.js | client/routes/controllers/admin_logon.js | /**
* AdminLogonController: Creates a endpoint where a user can log
* into the system. It renders the login template only if user is
* not already logged in.
*/
AdminLogonController = RouteController.extend({
waitOn: function () {
return Meteor.user();
},
onBeforeAction: function(pause) {
// Redirects user if allready logged in
if (Meteor.user()) {
if (!Meteor.loggingIn()) {
this.redirect(Router.path('Reports', {page:0}));
}
}
},
action: function () {
// if user is not logged in, render the login template
if (!Meteor.user() && !Meteor.loggingIn()) {
this.render();
}
}
});
| /**
* AdminLogonController: Creates a endpoint where a user can log
* into the system. It renders the login template only if user is
* not already logged in.
*/
AdminLogonController = RouteController.extend({
onBeforeAction: function(pause) {
// Redirects user if allready logged in
if (Meteor.user()) {
if (!Meteor.loggingIn()) {
this.redirect(Router.path('Reports', {page:0}));
}
}
},
action: function () {
// if user is not logged in, render the login template
if (!Meteor.user() && !Meteor.loggingIn()) {
this.render();
}
}
});
| Fix a bug where the user was not redirected because of wrong use of waitOn | Fix a bug where the user was not redirected because of wrong use of waitOn
| JavaScript | apache-2.0 | bompi88/concept,bompi88/concept,bompi88/concept | ---
+++
@@ -4,10 +4,6 @@
* not already logged in.
*/
AdminLogonController = RouteController.extend({
- waitOn: function () {
- return Meteor.user();
- },
-
onBeforeAction: function(pause) {
// Redirects user if allready logged in
if (Meteor.user()) { |
b529cb8fe16a6f899c92d0153b13c6d471733f5e | run-benchmarks.js | run-benchmarks.js | #!/usr/bin/env node
/*
Copyright (C) 2010, Oleg Efimov <efimovov@gmail.com>
See license text in LICENSE file
*/
var
bindings_list = ['Sannis-node-mysql-libmysqlclient', 'felixge-node-mysql', /*'stevebest-node-mysql',*/ 'PHP-MySQL'],
sys = require('sys'),
default_factor = 1,
factor = default_factor,
cfg;
if (process.argv[2] !== undefined) {
factor = Math.abs(process.argv[2]);
if (isNaN(factor)) {
factor = default_factor;
}
}
cfg = require("./src/config").getConfig(factor);
function runNextBenchmark() {
if (bindings_list.length > 0) {
var binding_name = bindings_list.shift();
sys.puts("\033[1mBenchmarking " + binding_name + ":\033[22m");
var benchmark = require("./src/" + binding_name);
benchmark.run(function () {
runNextBenchmark();
}, cfg);
} else {
sys.puts("\033[1mAll benchmarks finished\033[22m");
}
}
runNextBenchmark();
| #!/usr/bin/env node
/*
Copyright (C) 2010, Oleg Efimov <efimovov@gmail.com>
See license text in LICENSE file
*/
var
bindings_list = ['Sannis-node-mysql-libmysqlclient', 'felixge-node-mysql', /*'stevebest-node-mysql',*/ 'PHP-MySQL'],
//bindings_list = ['sidorares-nodejs-mysql-native'],
sys = require('sys'),
default_factor = 1,
factor = default_factor,
cfg;
if (process.argv[2] !== undefined) {
factor = Math.abs(process.argv[2]);
if (isNaN(factor)) {
factor = default_factor;
}
}
cfg = require("./src/config").getConfig(factor);
function runNextBenchmark() {
if (bindings_list.length > 0) {
var binding_name = bindings_list.shift();
sys.puts("\033[1mBenchmarking " + binding_name + ":\033[22m");
var benchmark = require("./src/" + binding_name);
benchmark.run(function () {
runNextBenchmark();
}, cfg);
} else {
sys.puts("\033[1mAll benchmarks finished\033[22m");
}
}
runNextBenchmark();
| Add //bindings_list = ['sidorares-nodejs-mysql-native'] for tests | Add //bindings_list = ['sidorares-nodejs-mysql-native'] for tests
| JavaScript | mit | Sannis/node-mysql-benchmarks,Sannis/node-mysql-benchmarks,Sannis/node-mysql-benchmarks,Sannis/node-mysql-benchmarks | ---
+++
@@ -7,6 +7,7 @@
var
bindings_list = ['Sannis-node-mysql-libmysqlclient', 'felixge-node-mysql', /*'stevebest-node-mysql',*/ 'PHP-MySQL'],
+ //bindings_list = ['sidorares-nodejs-mysql-native'],
sys = require('sys'),
default_factor = 1,
factor = default_factor, |
67f6b0dd9cae88debab6a350f84f4dff0d13eefc | Engine/engine.js | Engine/engine.js | var Game = (function () {
var Game = function (canvasRenderer,svgRenderer ) {
};
return Game;
}());
| var canvasDrawer = new CanvasDrawer();
var player = new Player('Pesho', 20, 180, 15);
var disc = new Disc(canvasDrawer.canvasWidth / 2, canvasDrawer.canvasHeight / 2, 12);
function startGame() {
canvasDrawer.clear();
canvasDrawer.drawPlayer(player);
canvasDrawer.drawDisc(disc);
player.move();
disc.move();
detectCollisionWithDisc(player, disc);
function detectCollisionWithDisc(player, disc) {
var dx = player.x - disc.x,
dy = player.y - disc.y,
distance = Math.sqrt(dx * dx + dy * dy);
if (distance < player.radius + disc.radius) {
if (distance === 0) {
distance = 0.1;
}
var unitX = dx / distance,
unitY = dy / distance,
force = -2,
forceX = unitX * force,
forceY = unitY * force;
disc.velocity.x += forceX + player.speed / 2;
disc.velocity.y += forceY + player.speed / 2;
return true;
} else {
return false;
}
}
// bounce off the floor
if (disc.y > canvasDrawer.canvasHeight - disc.radius) {
disc.y = canvasDrawer.canvasHeight - disc.radius;
disc.velocity.y = -Math.abs(disc.velocity.y);
}
// bounce off ceiling
if (disc.y < disc.radius + 0) {
disc.y = disc.radius + 0;
disc.velocity.y = Math.abs(disc.velocity.y);
}
// bounce off right wall
if (disc.x > canvasDrawer.canvasWidth - disc.radius) {
disc.x = canvasDrawer.canvasWidth - disc.radius;
disc.velocity.x = -Math.abs(disc.velocity.x);
}
// bounce off left wall
if (disc.x < disc.radius) {
disc.x = disc.radius;
disc.velocity.x = Math.abs(disc.velocity.x);
}
requestAnimationFrame(function () {
startGame();
});
}
startGame(); | Implement logic for player and disc movements and collision between them | Implement logic for player and disc movements and collision between them
| JavaScript | mit | TeamBarracuda-Telerik/JustDiscBattle,TeamBarracuda-Telerik/JustDiscBattle | ---
+++
@@ -1,7 +1,67 @@
-var Game = (function () {
- var Game = function (canvasRenderer,svgRenderer ) {
+var canvasDrawer = new CanvasDrawer();
+var player = new Player('Pesho', 20, 180, 15);
+var disc = new Disc(canvasDrawer.canvasWidth / 2, canvasDrawer.canvasHeight / 2, 12);
- };
+function startGame() {
+ canvasDrawer.clear();
+ canvasDrawer.drawPlayer(player);
+ canvasDrawer.drawDisc(disc);
+ player.move();
+ disc.move();
+ detectCollisionWithDisc(player, disc);
- return Game;
-}());
+ function detectCollisionWithDisc(player, disc) {
+
+ var dx = player.x - disc.x,
+ dy = player.y - disc.y,
+ distance = Math.sqrt(dx * dx + dy * dy);
+
+ if (distance < player.radius + disc.radius) {
+ if (distance === 0) {
+ distance = 0.1;
+ }
+
+ var unitX = dx / distance,
+ unitY = dy / distance,
+
+ force = -2,
+ forceX = unitX * force,
+ forceY = unitY * force;
+
+ disc.velocity.x += forceX + player.speed / 2;
+ disc.velocity.y += forceY + player.speed / 2;
+
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ // bounce off the floor
+ if (disc.y > canvasDrawer.canvasHeight - disc.radius) {
+ disc.y = canvasDrawer.canvasHeight - disc.radius;
+ disc.velocity.y = -Math.abs(disc.velocity.y);
+ }
+
+ // bounce off ceiling
+ if (disc.y < disc.radius + 0) {
+ disc.y = disc.radius + 0;
+ disc.velocity.y = Math.abs(disc.velocity.y);
+ }
+ // bounce off right wall
+ if (disc.x > canvasDrawer.canvasWidth - disc.radius) {
+ disc.x = canvasDrawer.canvasWidth - disc.radius;
+ disc.velocity.x = -Math.abs(disc.velocity.x);
+ }
+ // bounce off left wall
+ if (disc.x < disc.radius) {
+ disc.x = disc.radius;
+ disc.velocity.x = Math.abs(disc.velocity.x);
+ }
+
+ requestAnimationFrame(function () {
+ startGame();
+ });
+}
+
+startGame(); |
b379a4293d67349cecf026221938c4ca65efc453 | reporters/index.js | reporters/index.js | var gutil = require('gulp-util'),
fs = require('fs');
/**
* Loads reporter by its name.
*
* The function works only with reporters that shipped with the plugin.
*
* @param {String} name Name of a reporter to load.
* @param {Object} options Custom options object that will be passed to
* a reporter.
* @returns {Function}
*/
module.exports = function(name, options) {
if (typeof name !== 'string') {
throw new gutil.PluginError('gulp-phpcs', 'Reporter name must be a string');
}
if (name === 'index') {
throw new gutil.PluginError('gulp-phpcs', 'Reporter cannot be named "index"');
}
var fileName = __dirname + '/' + name + '.js',
reporter = null;
try {
reporter = require(fileName)(options || {});
} catch(error) {
if (error.code !== 'MODULE_NOT_FOUND') {
throw error;
}
throw new gutil.PluginError('gulp-phpcs', 'There is no reporter "' + name + '"');
}
return reporter;
};
| var gutil = require('gulp-util'),
fs = require('fs');
/**
* Loads reporter by its name.
*
* The function works only with reporters that shipped with the plugin.
*
* @param {String} name Name of a reporter to load.
* @param {Object} options Custom options object that will be passed to
* a reporter.
* @returns {Function}
*/
module.exports = function(name, options) {
if (typeof name !== 'string') {
throw new gutil.PluginError('gulp-phpcs', 'Reporter name must be a string');
}
if (name === 'index') {
throw new gutil.PluginError('gulp-phpcs', 'Reporter cannot be named "index"');
}
var fileName = './' + name + '.js',
reporter = null;
try {
reporter = require(fileName)(options || {});
} catch(error) {
if (error.code !== 'MODULE_NOT_FOUND') {
throw error;
}
throw new gutil.PluginError('gulp-phpcs', 'There is no reporter "' + name + '"');
}
return reporter;
};
| Make reporters' loader work on windows | Make reporters' loader work on windows
| JavaScript | mit | JustBlackBird/gulp-phpcs,JustBlackBird/gulp-phpcs | ---
+++
@@ -20,7 +20,7 @@
throw new gutil.PluginError('gulp-phpcs', 'Reporter cannot be named "index"');
}
- var fileName = __dirname + '/' + name + '.js',
+ var fileName = './' + name + '.js',
reporter = null;
try {
reporter = require(fileName)(options || {}); |
5f8c42f6c0360547ece990855256d3480ba3546c | website/static/js/tests/tests.webpack.js | website/static/js/tests/tests.webpack.js | // Generate a single webpack bundle for all tests for faster testing
// See https://github.com/webpack/karma-webpack#alternative-usage
// Configure raven with a fake DSN to avoid errors in test output
var Raven = require('raven-js');
Raven.config('http://abc@example.com:80/2');
// Include all files that end with .test.js (core tests)
var context = require.context('.', true, /.*test\.js$/); //make sure you have your directory and regex test set correctly!
context.keys().forEach(context);
// Include all files in the addons directory that end with .test.js
var addonContext = require.context('../../../addons/', true, /.*test\.js$/); //make sure you have your directory and regex test set correctly!
addonContext.keys().forEach(addonContext);
| // Generate a single webpack bundle for all tests for faster testing
// See https://github.com/webpack/karma-webpack#alternative-usage
// Configure raven with a fake DSN to avoid errors in test output
var Raven = require('raven-js');
Raven.config('http://abc@example.com:80/2');
// Include all files that end with .test.js (core tests)
var context = require.context('.', true, /.*test\.js$/); //make sure you have your directory and regex test set correctly!
context.keys().forEach(context);
// Include all files in the addons directory that end with .test.js
var addonContext = require.context('../../../../addons/', true, /.*test\.js$/); //make sure you have your directory and regex test set correctly!
addonContext.keys().forEach(addonContext);
| Update line that was pointing to the erstwhile ./website/addons now ./addons | Update line that was pointing to the erstwhile ./website/addons now ./addons
| JavaScript | apache-2.0 | CenterForOpenScience/osf.io,aaxelb/osf.io,Johnetordoff/osf.io,erinspace/osf.io,mfraezz/osf.io,mattclark/osf.io,crcresearch/osf.io,laurenrevere/osf.io,adlius/osf.io,aaxelb/osf.io,laurenrevere/osf.io,CenterForOpenScience/osf.io,CenterForOpenScience/osf.io,brianjgeiger/osf.io,saradbowman/osf.io,chennan47/osf.io,pattisdr/osf.io,crcresearch/osf.io,caseyrollins/osf.io,chrisseto/osf.io,felliott/osf.io,caseyrollins/osf.io,felliott/osf.io,felliott/osf.io,chennan47/osf.io,chrisseto/osf.io,adlius/osf.io,brianjgeiger/osf.io,HalcyonChimera/osf.io,caneruguz/osf.io,leb2dg/osf.io,felliott/osf.io,aaxelb/osf.io,icereval/osf.io,mattclark/osf.io,laurenrevere/osf.io,binoculars/osf.io,saradbowman/osf.io,leb2dg/osf.io,baylee-d/osf.io,chennan47/osf.io,aaxelb/osf.io,mattclark/osf.io,erinspace/osf.io,icereval/osf.io,TomBaxter/osf.io,icereval/osf.io,cslzchen/osf.io,adlius/osf.io,mfraezz/osf.io,mfraezz/osf.io,pattisdr/osf.io,caneruguz/osf.io,cslzchen/osf.io,pattisdr/osf.io,baylee-d/osf.io,Johnetordoff/osf.io,binoculars/osf.io,adlius/osf.io,mfraezz/osf.io,TomBaxter/osf.io,caneruguz/osf.io,TomBaxter/osf.io,HalcyonChimera/osf.io,chrisseto/osf.io,leb2dg/osf.io,Johnetordoff/osf.io,crcresearch/osf.io,chrisseto/osf.io,sloria/osf.io,sloria/osf.io,HalcyonChimera/osf.io,HalcyonChimera/osf.io,baylee-d/osf.io,brianjgeiger/osf.io,CenterForOpenScience/osf.io,Johnetordoff/osf.io,cslzchen/osf.io,erinspace/osf.io,caneruguz/osf.io,sloria/osf.io,caseyrollins/osf.io,leb2dg/osf.io,brianjgeiger/osf.io,cslzchen/osf.io,binoculars/osf.io | ---
+++
@@ -10,5 +10,5 @@
context.keys().forEach(context);
// Include all files in the addons directory that end with .test.js
-var addonContext = require.context('../../../addons/', true, /.*test\.js$/); //make sure you have your directory and regex test set correctly!
+var addonContext = require.context('../../../../addons/', true, /.*test\.js$/); //make sure you have your directory and regex test set correctly!
addonContext.keys().forEach(addonContext); |
128a3d691d9be875ca5a53fbbc7237d3ba4f234a | main.js | main.js | var Bind = require("github/jillix/bind");
var Events = require("github/jillix/events");
module.exports = function(config) {
var self = this;
Events.call(self, config);
for (var i in config.roles) {
$("." + config.roles[i]).hide();
}
var cache;
self.updateLinks = function (data) {
cache = cache || data;
data = cache || {};
data.role = data.role || config.publicRole;
$("." + data.role).fadeIn();
var index = config.roles.indexOf(data.role);
if (index !== -1) {
config.roles.splice(index, 1);
}
for (var i in config.roles) {
$("." + config.roles[i]).remove();
}
self.emit("updatedLinks", data);
};
};
| var Bind = require("github/jillix/bind");
var Events = require("github/jillix/events");
module.exports = function(config) {
var self = this;
Events.call(self, config);
for (var i in config.roles) {
$("." + config.roles[i]).hide();
}
var cache;
self.updateLinks = function (data) {
cache = cache || data;
data = cache || {};
data.role = data.role || config.publicRole;
$("." + data.role).fadeIn();
var index = config.roles.indexOf(data.role);
if (index !== -1) {
config.roles.splice(index, 1);
}
for (var i in config.roles) {
$("." + config.roles[i] + ":not('." + data.role + "')").remove();
}
self.emit("updatedLinks", data);
};
};
| Remove only links that have not the data.role class. | Remove only links that have not the data.role class.
| JavaScript | mit | jxmono/links | ---
+++
@@ -27,7 +27,7 @@
}
for (var i in config.roles) {
- $("." + config.roles[i]).remove();
+ $("." + config.roles[i] + ":not('." + data.role + "')").remove();
}
self.emit("updatedLinks", data); |
2d99515fd22cf92c7d47a15434eb89d6d26ce525 | src/shared/urls.js | src/shared/urls.js | const trimStart = (str) => {
// NOTE String.trimStart is available on Firefox 61
return str.replace(/^\s+/, '');
};
const SUPPORTED_PROTOCOLS = ['http:', 'https:', 'ftp:', 'mailto:'];
const searchUrl = (keywords, searchSettings) => {
try {
let u = new URL(keywords);
if (SUPPORTED_PROTOCOLS.includes(u.protocol.toLowerCase())) {
return u.href;
}
} catch (e) {
// fallthrough
}
if (keywords.includes('.') && !keywords.includes(' ')) {
return 'http://' + keywords;
}
let template = searchSettings.engines[searchSettings.default];
let query = keywords;
let first = trimStart(keywords).split(' ')[0];
if (Object.keys(searchSettings.engines).includes(first)) {
template = searchSettings.engines[first];
query = trimStart(trimStart(keywords).slice(first.length));
}
return template.replace('{}', encodeURIComponent(query));
};
const normalizeUrl = (url) => {
try {
let u = new URL(url);
if (SUPPORTED_PROTOCOLS.includes(u.protocol.toLowerCase())) {
return u.href;
}
} catch (e) {
// fallthrough
}
return 'http://' + url;
};
const homepageUrls = (value) => {
return value.split('|').map(normalizeUrl);
};
export { searchUrl, normalizeUrl, homepageUrls };
| const trimStart = (str) => {
// NOTE String.trimStart is available on Firefox 61
return str.replace(/^\s+/, '');
};
const SUPPORTED_PROTOCOLS = ['http:', 'https:', 'ftp:', 'mailto:', 'about:'];
const searchUrl = (keywords, searchSettings) => {
try {
let u = new URL(keywords);
if (SUPPORTED_PROTOCOLS.includes(u.protocol.toLowerCase())) {
return u.href;
}
} catch (e) {
// fallthrough
}
if (keywords.includes('.') && !keywords.includes(' ')) {
return 'http://' + keywords;
}
let template = searchSettings.engines[searchSettings.default];
let query = keywords;
let first = trimStart(keywords).split(' ')[0];
if (Object.keys(searchSettings.engines).includes(first)) {
template = searchSettings.engines[first];
query = trimStart(trimStart(keywords).slice(first.length));
}
return template.replace('{}', encodeURIComponent(query));
};
const normalizeUrl = (url) => {
try {
let u = new URL(url);
if (SUPPORTED_PROTOCOLS.includes(u.protocol.toLowerCase())) {
return u.href;
}
} catch (e) {
// fallthrough
}
return 'http://' + url;
};
const homepageUrls = (value) => {
return value.split('|').map(normalizeUrl);
};
export { searchUrl, normalizeUrl, homepageUrls };
| Add about: pages to open home page | Add about: pages to open home page
| JavaScript | mit | ueokande/vim-vixen,ueokande/vim-vixen,ueokande/vim-vixen | ---
+++
@@ -3,7 +3,7 @@
return str.replace(/^\s+/, '');
};
-const SUPPORTED_PROTOCOLS = ['http:', 'https:', 'ftp:', 'mailto:'];
+const SUPPORTED_PROTOCOLS = ['http:', 'https:', 'ftp:', 'mailto:', 'about:'];
const searchUrl = (keywords, searchSettings) => {
try { |
d69b7e3eaecb1a38cce45e12abdb64ecd36ce13c | static/js/contest-details.js | static/js/contest-details.js | $(document).ready(function(){
$('.entries').slick({
slidesToShow: 3,
variableWidth: true,
autoplay: true,
lazyLoad: 'ondemand'
});
Dropzone.options.dropzoneSubmitPhoto = {
paramName: "image",
maxFilesize: 2 // MB
};
});
| $(document).ready(function(){
$('.entries').slick({
slidesToShow: 3,
variableWidth: true,
autoplay: true,
lazyLoad: 'ondemand'
});
Dropzone.options.dropzoneSubmitPhoto = {
paramName: "image",
maxFilesize: 2, // MB
init: function() {
this.on("success", function(file) {
// Refresh the page to see uploaded contents
location.reload();
});
}
};
});
| Refresh the page when successfully uploading a photo | Refresh the page when successfully uploading a photo
| JavaScript | isc | RevolutionTech/flamingo,RevolutionTech/flamingo,RevolutionTech/flamingo,RevolutionTech/flamingo | ---
+++
@@ -7,6 +7,12 @@
});
Dropzone.options.dropzoneSubmitPhoto = {
paramName: "image",
- maxFilesize: 2 // MB
+ maxFilesize: 2, // MB
+ init: function() {
+ this.on("success", function(file) {
+ // Refresh the page to see uploaded contents
+ location.reload();
+ });
+ }
};
}); |
b451fd49780ad69869b4cc4087bdd4a95a066b0f | src/components/NewMealForm.js | src/components/NewMealForm.js | import React, { Component } from 'react'
import { reduxForm, Field } from 'redux-form'
class NewMealForm extends Component {
render() {
return (
<form onSubmit={this.props.handleSubmit}>
<label htmlFor="name">Meal Name</label>
<Field name="name" component="input" type="text" />
<button>Create Meal</button>
</form>
)
}
}
export default reduxForm({
form: 'newMeal'
})(NewMealForm) | import React, { Component } from 'react'
import { reduxForm, Field } from 'redux-form'
import { css } from 'glamor'
class NewMealForm extends Component {
render() {
return (
<form onSubmit={this.props.handleSubmit}>
<ul {...ul}>
<li {...styles}>
<label {...styles2} htmlFor="name">Meal Name</label>
<Field {...styles3} name="name" component="input" type="text" />
</li>
<li {...styles}>
<button {...btnStyle} >Create Meal</button>
</li>
</ul>
</form>
)
}
}
const styles3 = css({
flex: '1 0 220px',
padding: '15px',
borderRadius: '15px',
border: '2px solid gray',
':focus': {
outline: 'none'
}
})
const ul = css({
maxWidth: '800px',
margin: '0 auto'
})
const styles = css({
display: 'flex',
flexWrap: 'wrap',
alignItems: 'center',
justifyContent: 'space-between',
// maxWidth: '800px',
marginBottom: '20px'
})
const btnStyle = css({
marginLeft: 'auto',
padding: '8px 16px',
border: 'none',
background: '#333',
color: '#f2f2f2',
textTransform: 'uppercase',
letterSpacing: '.09em',
borderRadius: '2px'
})
const styles2 = css({
flex: '1 0 120px',
maxWidth: '220px'
})
export default reduxForm({
form: 'newMeal'
})(NewMealForm) | Add styling for new meal form | Add styling for new meal form
| JavaScript | mit | cernanb/personal-chef-react-app,cernanb/personal-chef-react-app | ---
+++
@@ -1,19 +1,67 @@
import React, { Component } from 'react'
import { reduxForm, Field } from 'redux-form'
+import { css } from 'glamor'
class NewMealForm extends Component {
render() {
return (
<form onSubmit={this.props.handleSubmit}>
- <label htmlFor="name">Meal Name</label>
- <Field name="name" component="input" type="text" />
- <button>Create Meal</button>
+ <ul {...ul}>
+ <li {...styles}>
+ <label {...styles2} htmlFor="name">Meal Name</label>
+ <Field {...styles3} name="name" component="input" type="text" />
+ </li>
+ <li {...styles}>
+ <button {...btnStyle} >Create Meal</button>
+ </li>
+ </ul>
</form>
)
}
}
+const styles3 = css({
+ flex: '1 0 220px',
+ padding: '15px',
+ borderRadius: '15px',
+ border: '2px solid gray',
+ ':focus': {
+ outline: 'none'
+ }
+})
+
+const ul = css({
+ maxWidth: '800px',
+ margin: '0 auto'
+})
+
+const styles = css({
+ display: 'flex',
+ flexWrap: 'wrap',
+ alignItems: 'center',
+ justifyContent: 'space-between',
+ // maxWidth: '800px',
+ marginBottom: '20px'
+})
+
+const btnStyle = css({
+ marginLeft: 'auto',
+ padding: '8px 16px',
+ border: 'none',
+ background: '#333',
+ color: '#f2f2f2',
+ textTransform: 'uppercase',
+ letterSpacing: '.09em',
+ borderRadius: '2px'
+})
+
+const styles2 = css({
+ flex: '1 0 120px',
+ maxWidth: '220px'
+})
+
+
export default reduxForm({
form: 'newMeal'
})(NewMealForm) |
6e53504d4fa4c5add94f4df61b2c96d96db3906d | site/code.js | site/code.js | $(window).scroll
( function ()
{
$( "header" ).css
( "top"
, Math.max(-280, Math.min(0, -$("body").scrollTop()))
);
}
);
$("nav a").click
( function (ev)
{
var target = $("*[name=" + $(ev.target).attr("href").substr(1) + "]");
$("html, body").animate({ scrollTop: $(target).offset().top - 80 });
ev.preventDefault();
ev.stopPropagation();
}
);
$("header > div").click
( function (ev)
{
$("html, body").animate({ scrollTop: 0 });
}
);
| $(window).scroll
( function ()
{
$( "header" ).css
( "top"
, Math.max(-280, Math.min(0, -$("body").scrollTop()))
);
}
);
$("nav a").click
( function (ev)
{
var target = $("*[name=" + $(ev.target).attr("href").substr(1) + "]");
$("html, body").animate
( { scrollTop : $(target).offset().top - 80 }
, ev.shiftKey ? 2500 : 500
);
ev.preventDefault();
ev.stopPropagation();
}
);
$("header > div").click
( function (ev)
{
$("html, body").animate({ scrollTop: 0 });
}
);
| Allow slow scrolling with shift. | Allow slow scrolling with shift.
Because we can. | JavaScript | bsd-3-clause | bergmark/clay,rbros/clay,rbros/clay | ---
+++
@@ -13,7 +13,10 @@
{
var target = $("*[name=" + $(ev.target).attr("href").substr(1) + "]");
- $("html, body").animate({ scrollTop: $(target).offset().top - 80 });
+ $("html, body").animate
+ ( { scrollTop : $(target).offset().top - 80 }
+ , ev.shiftKey ? 2500 : 500
+ );
ev.preventDefault();
ev.stopPropagation();
} |
1946b1e6190e9b374f323f6b99bfe8790f879ef0 | tasks/html-hint.js | tasks/html-hint.js | /**
* Hint HTML
*/
'use strict';
const gulp = require('gulp'),
htmlhint = require('gulp-htmlhint'),
notify = require('gulp-notify');
module.exports = function(options) {
return cb => {
gulp.src('./*.html')
.pipe(htmlhint())
.pipe(htmlhint.reporter('htmlhint-stylish'))
.pipe(htmlhint.failReporter({
suppress: true
}))
.on('error', notify.onError({
title: 'HTML'
}));
cb();
};
}; | /**
* Hint HTML
*/
'use strict';
const gulp = require('gulp'),
htmlhint = require('gulp-htmlhint'),
notify = require('gulp-notify');
module.exports = function(options) {
return cb => {
gulp.src('./*.html')
.pipe(htmlhint({
'attr-lowercase': ['viewBox']
}))
.pipe(htmlhint.reporter('htmlhint-stylish'))
.pipe(htmlhint.failReporter({
suppress: true
}))
.on('error', notify.onError({
title: 'HTML'
}));
cb();
};
}; | Add the 'viewBox' attribute to htmlhint ignore list | Add the 'viewBox' attribute to htmlhint ignore list
| JavaScript | mit | justcoded/web-starter-kit,vodnycheck/justcoded,KirillPd/web-starter-kit,justcoded/web-starter-kit,vodnycheck/justcoded,KirillPd/web-starter-kit | ---
+++
@@ -11,7 +11,9 @@
return cb => {
gulp.src('./*.html')
- .pipe(htmlhint())
+ .pipe(htmlhint({
+ 'attr-lowercase': ['viewBox']
+ }))
.pipe(htmlhint.reporter('htmlhint-stylish'))
.pipe(htmlhint.failReporter({
suppress: true |
35c2111792ca6f6a0cd0ef0468c43afd13e54693 | test/repl-tests.js | test/repl-tests.js | const assert = require("assert");
// Masquerade as the REPL module.
module.filename = null;
module.id = "<repl>";
module.loaded = false;
module.parent = void 0;
delete require.cache[require.resolve("../node/repl-hook.js")];
describe("Node REPL", () => {
import "../node/repl-hook.js";
import { createContext } from "vm";
import { enable } from "../lib/runtime";
import repl from "repl";
it("should work with global context", (done) => {
const r = repl.start({ useGlobal: true });
enable(r.context.module);
assert.strictEqual(typeof assertStrictEqual, "undefined");
r.eval(
'import { strictEqual as assertStrictEqual } from "assert"',
null, // Context
"repl", // Filename
(err, result) => {
// Use the globally defined assertStrictEqual to test itself!
assertStrictEqual(typeof assertStrictEqual, "function");
done();
}
);
});
it("should work with non-global context", (done) => {
const r = repl.start({ useGlobal: false });
const context = createContext({ module, require });
r.eval(
'import { strictEqual } from "assert"',
context,
"repl", // Filename
(err, result) => {
// Use context.strictEqual to test itself!
context.strictEqual(typeof context.strictEqual, "function");
done();
}
);
});
});
| const assert = require("assert");
// Masquerade as the REPL module.
module.filename = null;
module.id = "<repl>";
module.loaded = false;
module.parent = void 0;
delete require.cache[require.resolve("../node/repl-hook.js")];
describe("Node REPL", () => {
import "../node/repl-hook.js";
import { createContext } from "vm";
import { enable } from "../lib/runtime";
import repl from "repl";
it("should work with global context", (done) => {
const r = repl.start({ useGlobal: true });
enable(r.context.module);
assert.strictEqual(typeof assertStrictEqual, "undefined");
r.eval(
'import { strictEqual as assertStrictEqual } from "assert"',
null, // Context
"repl", // Filename
(err, result) => {
// Use the globally defined assertStrictEqual to test itself!
assertStrictEqual(typeof assertStrictEqual, "function");
if (typeof r.close === "function") {
r.close();
}
done();
}
);
});
it("should work with non-global context", (done) => {
const r = repl.start({ useGlobal: false });
const context = createContext({ module, require });
r.eval(
'import { strictEqual } from "assert"',
context,
"repl", // Filename
(err, result) => {
// Use context.strictEqual to test itself!
context.strictEqual(typeof context.strictEqual, "function");
if (typeof r.close === "function") {
r.close();
}
done();
}
);
});
});
| Make sure to close REPLs started by tests. | Make sure to close REPLs started by tests.
| JavaScript | mit | benjamn/reify,benjamn/reify | ---
+++
@@ -27,6 +27,9 @@
(err, result) => {
// Use the globally defined assertStrictEqual to test itself!
assertStrictEqual(typeof assertStrictEqual, "function");
+ if (typeof r.close === "function") {
+ r.close();
+ }
done();
}
);
@@ -43,6 +46,9 @@
(err, result) => {
// Use context.strictEqual to test itself!
context.strictEqual(typeof context.strictEqual, "function");
+ if (typeof r.close === "function") {
+ r.close();
+ }
done();
}
); |
102b53a7b6390f7854556fc529615a1c4a86057b | src/services/config/config.service.js | src/services/config/config.service.js | 'use strict';
// Service for the spec config.
// We keep this separate so that changes are kept even if the spec changes.
angular.module('vlui')
.factory('Config', function() {
var Config = {};
Config.data = {};
Config.config = {};
Config.getConfig = function() {
return {};
};
Config.getData = function() {
return Config.data;
};
Config.large = function() {
return {
cell: {
width: 300,
height: 300
},
facet: {
cell: {
width: 150,
height: 150
}
}
};
};
Config.small = function() {
return {
facet: {
cell: {
width: 150,
height: 150
}
}
};
};
Config.updateDataset = function(dataset, type) {
if (dataset.values) {
Config.data.values = dataset.values;
delete Config.data.url;
Config.data.formatType = undefined;
} else {
Config.data.url = dataset.url;
delete Config.data.values;
Config.data.formatType = type;
}
};
return Config;
});
| 'use strict';
// Service for the spec config.
// We keep this separate so that changes are kept even if the spec changes.
angular.module('vlui')
.factory('Config', function() {
var Config = {};
Config.data = {};
Config.config = {};
Config.getConfig = function() {
return {};
};
Config.getData = function() {
return Config.data;
};
Config.large = function() {
return {
cell: {
width: 300,
height: 300
},
facet: {
cell: {
width: 150,
height: 150
}
},
scale: {useRawDomain: false}
};
};
Config.small = function() {
return {
facet: {
cell: {
width: 150,
height: 150
}
}
};
};
Config.updateDataset = function(dataset, type) {
if (dataset.values) {
Config.data.values = dataset.values;
delete Config.data.url;
Config.data.formatType = undefined;
} else {
Config.data.url = dataset.url;
delete Config.data.values;
Config.data.formatType = type;
}
};
return Config;
});
| Make polestar's config useRawDomain = false | Make polestar's config useRawDomain = false
Fix https://github.com/uwdata/voyager2/issues/202
| JavaScript | bsd-3-clause | vega/vega-lite-ui,vega/vega-lite-ui,uwdata/vega-lite-ui,vega/vega-lite-ui,uwdata/vega-lite-ui,uwdata/vega-lite-ui | ---
+++
@@ -28,7 +28,8 @@
width: 150,
height: 150
}
- }
+ },
+ scale: {useRawDomain: false}
};
};
|
59148c34d125d0eafb45e0b2516e3cd08bb37735 | src/systems/tracked-controls-webxr.js | src/systems/tracked-controls-webxr.js | var registerSystem = require('../core/system').registerSystem;
/**
* Tracked controls system.
* Maintain list with available tracked controllers.
*/
module.exports.System = registerSystem('tracked-controls-webxr', {
init: function () {
this.addSessionEventListeners = this.addSessionEventListeners.bind(this);
this.onInputSourcesChange = this.onInputSourcesChange.bind(this);
this.addSessionEventListeners();
this.el.sceneEl.addEventListener('enter-vr', this.addSessionEventListeners);
},
addSessionEventListeners: function () {
var sceneEl = this.el;
if (!sceneEl.xrSession) { return; }
this.onInputSourcesChange();
sceneEl.xrSession.addEventListener('inputsourceschange', this.onInputSourcesChange);
},
onInputSourcesChange: function () {
this.controllers = this.el.xrSession.getInputSources();
this.el.emit('controllersupdated', undefined, false);
}
});
| var registerSystem = require('../core/system').registerSystem;
/**
* Tracked controls system.
* Maintain list with available tracked controllers.
*/
module.exports.System = registerSystem('tracked-controls-webxr', {
init: function () {
this.controllers = [];
this.addSessionEventListeners = this.addSessionEventListeners.bind(this);
this.onInputSourcesChange = this.onInputSourcesChange.bind(this);
this.addSessionEventListeners();
this.el.sceneEl.addEventListener('enter-vr', this.addSessionEventListeners);
},
addSessionEventListeners: function () {
var sceneEl = this.el;
if (!sceneEl.xrSession) { return; }
this.onInputSourcesChange();
sceneEl.xrSession.addEventListener('inputsourceschange', this.onInputSourcesChange);
},
onInputSourcesChange: function () {
this.controllers = this.el.xrSession.getInputSources();
this.el.emit('controllersupdated', undefined, false);
}
});
| Initialize controllers to empty array | Initialize controllers to empty array
| JavaScript | mit | chenzlabs/aframe,ngokevin/aframe,chenzlabs/aframe,ngokevin/aframe,aframevr/aframe,aframevr/aframe | ---
+++
@@ -6,6 +6,7 @@
*/
module.exports.System = registerSystem('tracked-controls-webxr', {
init: function () {
+ this.controllers = [];
this.addSessionEventListeners = this.addSessionEventListeners.bind(this);
this.onInputSourcesChange = this.onInputSourcesChange.bind(this);
this.addSessionEventListeners(); |
11c7e21ad172de2e3197ef871191731602f33269 | src/index.js | src/index.js | import React from 'react';
function allMustExist(props) {
Object.keys(props).every(propName => props[propName] != null);
}
export default function pending(NotReadyComponent) {
return (hasLoaded = allMustExist) => (ReadyComponent, ErrorComponent) => ({ error, ...props }) => {
if (error) {
return <ErrorComponent error={ error } { ...props } />;
}
else if (hasLoaded(props, ReadyComponent)) {
return <ReadyComponent { ...props } />;
}
else {
return <NotReadyComponent />;
}
}
}
| import React from 'react';
function allMustExist(props) {
Object.keys(props).every(propName => props[propName] != null);
}
function propTypesMustExist(props, { propTypes, displayName }) {
Object.keys(propTypes).every(propName => propTypes[propName](props, propName, displayName) == null);
}
export default function pending(NotReadyComponent) {
return (hasLoaded = propTypesMustExist) => (ReadyComponent, ErrorComponent) => ({ error, ...props }) => {
if (error) {
return <ErrorComponent error={ error } { ...props } />;
}
else if (hasLoaded(props, ReadyComponent)) {
return <ReadyComponent { ...props } />;
}
else {
return <NotReadyComponent />;
}
}
}
| Add required prop types checker, and make it default loaded tester | Add required prop types checker, and make it default loaded tester
| JavaScript | mit | BurntCaramel/react-pending | ---
+++
@@ -4,8 +4,12 @@
Object.keys(props).every(propName => props[propName] != null);
}
+function propTypesMustExist(props, { propTypes, displayName }) {
+ Object.keys(propTypes).every(propName => propTypes[propName](props, propName, displayName) == null);
+}
+
export default function pending(NotReadyComponent) {
- return (hasLoaded = allMustExist) => (ReadyComponent, ErrorComponent) => ({ error, ...props }) => {
+ return (hasLoaded = propTypesMustExist) => (ReadyComponent, ErrorComponent) => ({ error, ...props }) => {
if (error) {
return <ErrorComponent error={ error } { ...props } />;
} |
740a375cc37975c57f8f88f0f14630a6021e7494 | src/index.js | src/index.js | // @flow
export {default as ChartData} from './chartdata/ChartData';
export {default as LineCanvas} from './component/canvas/LineCanvas';
export {default as ColumnCanvas} from './component/canvas/ColumnCanvas';
export {default as ScatterCanvas} from './component/canvas/ScatterCanvas';
| // @flow
export {default as ChartData} from './chartdata/ChartData';
export {default as Canvas} from './component/canvas/Canvas';
export {default as LineCanvas} from './component/canvas/LineCanvas';
export {default as ColumnCanvas} from './component/canvas/ColumnCanvas';
export {default as ScatterCanvas} from './component/canvas/ScatterCanvas';
| Add canvas to export seeing as it is part of public api | Add canvas to export seeing as it is part of public api
| JavaScript | mit | bigdatr/pnut,bigdatr/pnut | ---
+++
@@ -1,6 +1,7 @@
// @flow
export {default as ChartData} from './chartdata/ChartData';
+export {default as Canvas} from './component/canvas/Canvas';
export {default as LineCanvas} from './component/canvas/LineCanvas';
export {default as ColumnCanvas} from './component/canvas/ColumnCanvas';
export {default as ScatterCanvas} from './component/canvas/ScatterCanvas'; |
868d729ea7f3b928e811b0196598f09b0d11b3a3 | src/index.js | src/index.js |
var fs = require('fs'),
Path = require('path'),
scripts;
scripts = [
'pokemonfusion.js',
'catoverflow.js',
'nugme.coffee',
'mta.coffee',
'spot.js',
'hr.js'
];
module.exports = function (robot) {
var path = Path.resolve(__dirname, 'scripts');
fs.exists(path, function (exists) {
if (exists) {
scripts.forEach(function (file) {
robot.loadFile(path, file);
});
}
});
};
|
var fs = require('fs'),
Path = require('path'),
scripts;
scripts = [
'pokemonfusion.js',
'catoverflow.js',
'nugme.coffee',
'mta.coffee',
'spot.js',
'hr.js',
'jenkins-notifier.coffee'
];
module.exports = function (robot) {
var path = Path.resolve(__dirname, 'scripts');
fs.exists(path, function (exists) {
if (exists) {
scripts.forEach(function (file) {
robot.loadFile(path, file);
});
}
});
};
| Enable our version of the jenkins-notifier script | Enable our version of the jenkins-notifier script
| JavaScript | mit | josephcarmello/hubot-scripts,dyg2104/hubot-scripts,Tyriont/hubot-scripts,amhorton/hubot-scripts,1stdibs/hubot-scripts | ---
+++
@@ -9,7 +9,8 @@
'nugme.coffee',
'mta.coffee',
'spot.js',
- 'hr.js'
+ 'hr.js',
+ 'jenkins-notifier.coffee'
];
module.exports = function (robot) { |
0a029c055211315536b53a1960838dbf7d9ef610 | src/index.js | src/index.js | import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { createStore, applyMiddleware } from 'redux';
import App from './components/app';
import reducers from './reducers';
const createStoreWithMiddleware = applyMiddleware()(createStore);
ReactDOM.render(
<Provider store={createStoreWithMiddleware(reducers)}>
<App />
</Provider>
, document.querySelector('.container'));
| import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { createStore, applyMiddleware } from 'redux';
import { BrowserRouter, Route } from 'react-router-dom';
import App from './components/app';
import reducers from './reducers';
const createStoreWithMiddleware = applyMiddleware()(createStore);
class Hello extends React.Component {
render() {
return (
<div>Hello</div>
)
}
}
class Goodbye extends React.Component {
render() {
return (
<div>Goodbye</div>
)
}
}
ReactDOM.render(
<Provider store={createStoreWithMiddleware(reducers)}>
<BrowserRouter>
<div>
<Route path='/hello' component={Hello}/>
<Route path='/goodbye' component={Goodbye} />
</div>
</BrowserRouter>
</Provider>
, document.querySelector('.container'));
| Add dummy routes to try react-router-dom | Add dummy routes to try react-router-dom
| JavaScript | mit | monsteronfire/redux-learning-blog,monsteronfire/redux-learning-blog | ---
+++
@@ -2,14 +2,37 @@
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { createStore, applyMiddleware } from 'redux';
+import { BrowserRouter, Route } from 'react-router-dom';
import App from './components/app';
import reducers from './reducers';
const createStoreWithMiddleware = applyMiddleware()(createStore);
+class Hello extends React.Component {
+ render() {
+ return (
+ <div>Hello</div>
+ )
+ }
+}
+
+class Goodbye extends React.Component {
+ render() {
+ return (
+ <div>Goodbye</div>
+ )
+ }
+}
+
+
ReactDOM.render(
<Provider store={createStoreWithMiddleware(reducers)}>
- <App />
+ <BrowserRouter>
+ <div>
+ <Route path='/hello' component={Hello}/>
+ <Route path='/goodbye' component={Goodbye} />
+ </div>
+ </BrowserRouter>
</Provider>
, document.querySelector('.container')); |
2e28d6f1578b9fe68a8d6bea3e7fbd7a61d8dbff | Resources/js/admin.js | Resources/js/admin.js |
$(document).ready(function() {
$('select[multiple]').each(function() {
var select = $(this),
search = $('<button/>', {
'class': 'btn'
}).append(
$('<span/>', {
'class': 'icon-search'
}));
select.removeAttr('required');
select.parent().parent().find('span').remove();
select.wrap($('<div/>', {
'class': 'input-append'
}));
select.after(search);
select.select2({
'width': '350px'
});
search.on('click', function() {
select.select2('open');
return false;
});
});
$('form').on('submit', function() {
if ($(this).get(0).checkValidity() === false) {
return;
}
$(this).find('a, input[type=submit], button').addClass('disabled');
});
$('.click-disable').on('click', function() {
if ($(this).closest('form').length > 0) {
if ($(this).closest('form').get(0).checkValidity() === false) {
return;
}
}
$(this).addClass('disabled');
$(this).find('span').attr('class', 'icon-spinner icon-spin');
});
$('.datepicker').css('width', '100px').datepicker({
'format': 'dd-mm-yyyy',
'language': 'nl'
});
});
| $(document).ready(function() {
if(!/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {
$('select[multiple]').each(function() {
var select = $(this),
search = $('<button/>', {
'class': 'btn'
}).append(
$('<span/>', {
'class': 'icon-search'
}));
select.removeAttr('required');
select.parent().parent().find('span').remove();
select.wrap($('<div/>', {
'class': 'input-append'
}));
select.after(search);
select.select2({
'width': '350px'
});
search.on('click', function() {
select.select2('open');
return false;
});
});
}
$('form').on('submit', function() {
if ($(this).get(0).checkValidity() === false) {
return;
}
$(this).find('a, input[type=submit], button').addClass('disabled');
});
$('.click-disable').on('click', function() {
if ($(this).closest('form').length > 0) {
if ($(this).closest('form').get(0).checkValidity() === false) {
return;
}
}
$(this).addClass('disabled');
$(this).find('span').attr('class', 'icon-spinner icon-spin');
});
$('.datepicker').css('width', '100px').datepicker({
'format': 'dd-mm-yyyy',
'language': 'nl'
});
});
| Disable select2 on mobile devices | Disable select2 on mobile devices | JavaScript | mit | bravesheep/crudify-bundle,bravesheep/crudify-bundle | ---
+++
@@ -1,28 +1,29 @@
-
$(document).ready(function() {
- $('select[multiple]').each(function() {
- var select = $(this),
- search = $('<button/>', {
- 'class': 'btn'
- }).append(
- $('<span/>', {
- 'class': 'icon-search'
+ if(!/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {
+ $('select[multiple]').each(function() {
+ var select = $(this),
+ search = $('<button/>', {
+ 'class': 'btn'
+ }).append(
+ $('<span/>', {
+ 'class': 'icon-search'
+ }));
+ select.removeAttr('required');
+ select.parent().parent().find('span').remove();
+ select.wrap($('<div/>', {
+ 'class': 'input-append'
}));
- select.removeAttr('required');
- select.parent().parent().find('span').remove();
- select.wrap($('<div/>', {
- 'class': 'input-append'
- }));
- select.after(search);
- select.select2({
- 'width': '350px'
+ select.after(search);
+ select.select2({
+ 'width': '350px'
+ });
+ search.on('click', function() {
+ select.select2('open');
+ return false;
+ });
});
- search.on('click', function() {
- select.select2('open');
- return false;
- });
- });
+ }
$('form').on('submit', function() {
if ($(this).get(0).checkValidity() === false) { |
611cc4009fa09351c2a012ab472affa2ec455cb8 | cli.es6.js | cli.es6.js | #!/usr/bin/env node
'use strict';
import fs from 'fs';
import snfe from './index';
import { name, version } from './package.json';
let printHelpMesage = () => {
console.log(`\nStrip Named Function Expression\n`);
console.log(`Usage:\n`);
console.log(` snfe [input file] > [output file]`);
console.log(`\n${name}@${version} ${process.argv[1]}\n`);
};
if (process.argv.indexOf(`-h`) !== -1 ||
process.argv.indexOf(`--help`) !== -1 ||
process.argv.length === 2 ) {
printHelpMesage();
process.exit(0);
} else if (process.argv.indexOf(`-v`) !== -1 || process.argv.indexOf(`--version`) !== -1) {
console.log(version);
process.exit(0);
}
if (input) {
process.stdout.write(strip(fs.readFileSync(input, `utf8`)).toString());
process.exit(0);
} | #!/usr/bin/env node
'use strict';
import fs from 'fs';
import snfe from './index';
import { name, version } from './package.json';
let printHelpMesage = () => {
console.log(`\nStrip Named Function Expression\n`);
console.log(`Usage:\n`);
console.log(` snfe [input file] > [output file]`);
console.log(`\n${name}@${version} ${process.argv[1]}\n`);
};
if (process.argv.indexOf(`-h`) !== -1 ||
process.argv.indexOf(`--help`) !== -1 ||
process.argv.length === 2 ) {
printHelpMesage();
process.exit(0);
} else if (process.argv.indexOf(`-v`) !== -1 || process.argv.indexOf(`--version`) !== -1) {
console.log(version);
process.exit(0);
}
let input = process.argv[2];
if (input) {
let inputString = fs.readFileSync(input, `utf8`);
let result = snfe(inputString);
process.stdout.write(result);
process.exit(0);
}
process.exit(0); | Refactor the main logic block | Refactor the main logic block
| JavaScript | mit | ajhsu/snfe | ---
+++
@@ -21,7 +21,14 @@
process.exit(0);
}
+
+let input = process.argv[2];
+
if (input) {
- process.stdout.write(strip(fs.readFileSync(input, `utf8`)).toString());
+ let inputString = fs.readFileSync(input, `utf8`);
+ let result = snfe(inputString);
+ process.stdout.write(result);
process.exit(0);
}
+
+process.exit(0); |
a502cf7fb2052263a2b0bb7d84e4cbfe91b70f86 | Build/Grunt-Tasks/Compilers/Javascript.js | Build/Grunt-Tasks/Compilers/Javascript.js | /**
* Compile:JS task.
* Uglify and merge all javascript files in 'Public/Javascripts/Sources/'.
*/
var config = require("../../Config");
module.exports = function(grunt) {
"use strict";
grunt.registerTask("compile:js", function() {
// Optimize all js files if the 'useSingleFileBuild' option is 'false'.
if(!config.JavaScripts.requireJS.useSingleFileBuild || grunt.option('env') === 'travis') {
grunt.task.run("uglify:all");
}
// Optimize the project via the r.js optimizer.
grunt.task.run("requirejs");
});
};
| /**
* Compile:JS task.
* Uglify and merge all javascript files in 'Public/Javascripts/Sources/'.
*/
var config = require("../../Config");
module.exports = function(grunt) {
"use strict";
grunt.registerTask("compile:js", function() {
// Optimize all js files if the 'useSingleFileBuild' option is 'false'.
if(!config.JavaScripts.requireJS.useSingleFileBuild || grunt.option('env') === 'travis') {
grunt.task.run("uglify:js");
}
// Optimize the project via the r.js optimizer.
grunt.task.run("requirejs");
});
};
| Set the correct sub-task name for the uglify task | [BUGFIX] Set the correct sub-task name for the uglify task
| JavaScript | mit | t3b/t3b_template,t3b/t3b_template,t3b/t3b_template,t3b/t3b_template,t3b/t3b_template | ---
+++
@@ -11,7 +11,7 @@
grunt.registerTask("compile:js", function() {
// Optimize all js files if the 'useSingleFileBuild' option is 'false'.
if(!config.JavaScripts.requireJS.useSingleFileBuild || grunt.option('env') === 'travis') {
- grunt.task.run("uglify:all");
+ grunt.task.run("uglify:js");
}
// Optimize the project via the r.js optimizer. |
6591d7a6e52433519bb79678db85e015e3b50104 | src/index.js | src/index.js | import React from 'react';
import Logo from './components/logo'
import SocialButtons from './components/social-buttons'
import Navigation from './components/navigation'
import Home from './components/home';
import Footer from './components/footer';
import AppUrl from './appurl'
class Page {
render() {
let appUrl = new AppUrl();
const siteComponent = this.props.siteComponent;
return (
<div id="wrapper" className="pure-g">
<header className="pure-u-2-3">
<Logo/>
<SocialButtons/>
<Navigation appUrl={appUrl} />
</header>
{siteComponent}
<Footer />
</div>
)
}
}
const rerender = (siteComponent = <Home />) => {
React.render(<Page siteComponent={siteComponent} />, document.getElementById('app'));
};
import {parse as parseUrl} from 'url';
import Chronicle from './lexicon/chronicle'
window.addEventListener('hashchange', ({newURL: newUrl}) => {
const parsedUrl = parseUrl(newUrl);
processUrl(parsedUrl);
});
function processUrl(parsedUrl) {
if (parsedUrl && parsedUrl.hash && parsedUrl.hash.startsWith('#/')) {
if (parsedUrl.hash.match(/^#\/chronicle/)) {
Chronicle.componentWithData((chronicleComponent) => {
rerender(chronicleComponent);
});
}
} else {
rerender(<Home />);
}
}
processUrl();
| import React from 'react';
import 'babel/polyfill';
import Logo from './components/logo'
import SocialButtons from './components/social-buttons'
import Navigation from './components/navigation'
import Home from './components/home';
import Footer from './components/footer';
import AppUrl from './appurl'
class Page {
render() {
let appUrl = new AppUrl();
const siteComponent = this.props.siteComponent;
return (
<div id="wrapper" className="pure-g">
<header className="pure-u-2-3">
<Logo/>
<SocialButtons/>
<Navigation appUrl={appUrl} />
</header>
{siteComponent}
<Footer />
</div>
)
}
}
const rerender = (siteComponent = <Home />) => {
React.render(<Page siteComponent={siteComponent} />, document.getElementById('app'));
};
import {parse as parseUrl} from 'url';
import Chronicle from './lexicon/chronicle'
window.addEventListener('hashchange', ({newURL: newUrl}) => {
const parsedUrl = parseUrl(newUrl);
processUrl(parsedUrl);
});
function processUrl(parsedUrl) {
if (parsedUrl && parsedUrl.hash && parsedUrl.hash.startsWith('#/')) {
if (parsedUrl.hash.match(/^#\/chronicle/)) {
Chronicle.componentWithData((chronicleComponent) => {
rerender(chronicleComponent);
});
}
} else {
rerender(<Home />);
}
}
processUrl();
| Load babel polyfills, to work in less ES6 ready browsers. | Load babel polyfills, to work in less ES6 ready browsers. | JavaScript | mit | cosmowiki/cosmowiki,cosmowiki/cosmowiki,cosmowiki/cosmowiki,cosmowiki/cosmowiki | ---
+++
@@ -1,4 +1,5 @@
import React from 'react';
+import 'babel/polyfill';
import Logo from './components/logo'
import SocialButtons from './components/social-buttons' |
52a3703073c1a96d1056bd8be38228f530769971 | planner/static/planner/js/new_step_form.js | planner/static/planner/js/new_step_form.js | $(function () {
$(".inline." + formset_prefix).formset({
prefix: formset_prefix, // The form prefix for your django formset
addCssClass: "btn btn-block btn-primary bordered inline-form-add", // CSS class applied to the add link
deleteCssClass: "btn btn-block btn-primary bordered", // CSS class applied to the delete link
addText: 'Add another question', // Text for the add link
deleteText: 'Remove question above', // Text for the delete link
formCssClass: 'inline-form', // CSS class applied to each form in a formset
added: function (row) {
add_autocomplete(row);
}
})
}); | $(function () {
$(".inline." + formset_prefix).formset({
prefix: formset_prefix, // The form prefix for your django formset
addCssClass: "btn btn-block btn-primary bordered inline-form-add", // CSS class applied to the add link
deleteCssClass: "btn btn-block btn-primary bordered", // CSS class applied to the delete link
addText: 'Add another question', // Text for the add link
deleteText: 'Remove question above', // Text for the delete link
formCssClass: 'inline-form', // CSS class applied to each form in a formset
added: function (row) {
add_autocomplete(row);
row.find("input").first().prop('disabled', true);
},
removed: function (row) {
if ($('#id_' + formset_prefix + '-TOTAL_FORMS').val() == 1) {
$(".inline." + formset_prefix).find("input").prop("disabled", false);
}
}
})
}); | Disable origin textfield for forms != first one | Disable origin textfield for forms != first one
It will be automatically set to previous form's destination
| JavaScript | mit | livingsilver94/getaride,livingsilver94/getaride,livingsilver94/getaride | ---
+++
@@ -8,6 +8,12 @@
formCssClass: 'inline-form', // CSS class applied to each form in a formset
added: function (row) {
add_autocomplete(row);
+ row.find("input").first().prop('disabled', true);
+ },
+ removed: function (row) {
+ if ($('#id_' + formset_prefix + '-TOTAL_FORMS').val() == 1) {
+ $(".inline." + formset_prefix).find("input").prop("disabled", false);
+ }
}
})
}); |
dd0d1022cba70a3504d131c7d48a825be574b30b | src/index.js | src/index.js | require('./lib/whatwg-fetch/fetch.js')
require('./lib/kube-6.0.1/kube.min.css')
import 'react-hot-loader/patch'
import React from 'react'
import ReactDOM from 'react-dom'
import Root from './components/Root'
import configureStore from './configureStore'
const store = configureStore()
// import { AppContainer } from 'react-hot-loader'
ReactDOM.render(
<Root store={ store } />,
document.getElementById('app')
)
// if (module.hot) {
// module.hot.accept('./containers/CashmereAppContainer', () => {
// const NextCashmereAppContainer = require('./containers/CashmereAppContainer').CashmereAppContainer
// ReactDOM.render(
// // <AppContainer>
// <Provider store={ store }>
// <NextCashmereAppContainer />
// </Provider>,
// // </AppContainer>,
// rootEl
// )
// })
// }
| require('./lib/whatwg-fetch/fetch.js')
//require('./lib/kube-6.0.1/kube.min.css')
// Needed for onTouchTap
// http://stackoverflow.com/a/34015469/988941
import injectTapEventPlugin from 'react-tap-event-plugin';
injectTapEventPlugin();
import 'react-hot-loader/patch'
import React from 'react'
import ReactDOM from 'react-dom'
import Root from './components/Root'
import configureStore from './configureStore'
const store = configureStore()
// import { AppContainer } from 'react-hot-loader'
ReactDOM.render(
<Root store={ store } />,
document.getElementById('app')
)
// if (module.hot) {
// module.hot.accept('./containers/CashmereAppContainer', () => {
// const NextCashmereAppContainer = require('./containers/CashmereAppContainer').CashmereAppContainer
// ReactDOM.render(
// // <AppContainer>
// <Provider store={ store }>
// <NextCashmereAppContainer />
// </Provider>,
// // </AppContainer>,
// rootEl
// )
// })
// }
| Remove kube and add react touch events | Remove kube and add react touch events
| JavaScript | mit | rjbernaldo/expensetracker-react-redux,rjbernaldo/expensetracker-react-redux | ---
+++
@@ -1,5 +1,10 @@
require('./lib/whatwg-fetch/fetch.js')
-require('./lib/kube-6.0.1/kube.min.css')
+//require('./lib/kube-6.0.1/kube.min.css')
+
+// Needed for onTouchTap
+// http://stackoverflow.com/a/34015469/988941
+import injectTapEventPlugin from 'react-tap-event-plugin';
+injectTapEventPlugin();
import 'react-hot-loader/patch'
import React from 'react' |
89bc200fc4d9db76e74d0524a69bbcc805317e13 | src/index.js | src/index.js | import Player from './components/Player';
import Video from './components/Video';
import BigPlayButton from './components/BigPlayButton';
import LoadingSpinner from './components/LoadingSpinner';
import PosterImage from './components/PosterImage';
import ControlBar from './components/control-bar/ControlBar';
import ForwardControl from './components/control-bar/ForwardControl';
import ReplayControl from './components/control-bar/ReplayControl';
import ForwardReplayControl from './components/control-bar/ForwardReplayControl';
import ProgressControl from './components/control-bar/ProgressControl';
import MouseTimeDisplay from './components/control-bar/MouseTimeDisplay';
import PlayToggle from './components/control-bar/PlayToggle';
import Slider from './components/Slider';
export {
Player,
Video,
BigPlayButton,
LoadingSpinner,
PosterImage,
ControlBar,
ForwardControl,
ReplayControl,
MouseTimeDisplay,
PlayToggle,
ForwardReplayControl,
ProgressControl,
Slider,
};
| import Player from './components/Player';
import Video from './components/Video';
import BigPlayButton from './components/BigPlayButton';
import LoadingSpinner from './components/LoadingSpinner';
import PosterImage from './components/PosterImage';
import ControlBar from './components/control-bar/ControlBar';
import ForwardControl from './components/control-bar/ForwardControl';
import ReplayControl from './components/control-bar/ReplayControl';
import ForwardReplayControl from './components/control-bar/ForwardReplayControl';
import ProgressControl from './components/control-bar/ProgressControl';
import MouseTimeDisplay from './components/control-bar/MouseTimeDisplay';
import PlayToggle from './components/control-bar/PlayToggle';
import SeekBar from './components/control-bar/SeekBar';
import FullscreenToggle from './components/control-bar/FullscreenToggle';
import PlayProgressBar from './components/control-bar/PlayProgressBar';
import LoadProgressBar from './components/control-bar/LoadProgressBar';
import Slider from './components/Slider';
export {
Player,
Video,
BigPlayButton,
LoadingSpinner,
PosterImage,
ControlBar,
ForwardControl,
ReplayControl,
MouseTimeDisplay,
PlayToggle,
ForwardReplayControl,
ProgressControl,
SeekBar,
FullscreenToggle,
PlayProgressBar,
LoadProgressBar,
Slider,
};
| Update Index.js to import new components | Update Index.js to import new components
Update Index.js to import new components
| JavaScript | mit | video-react/video-react,video-react/video-react | ---
+++
@@ -10,6 +10,10 @@
import ProgressControl from './components/control-bar/ProgressControl';
import MouseTimeDisplay from './components/control-bar/MouseTimeDisplay';
import PlayToggle from './components/control-bar/PlayToggle';
+import SeekBar from './components/control-bar/SeekBar';
+import FullscreenToggle from './components/control-bar/FullscreenToggle';
+import PlayProgressBar from './components/control-bar/PlayProgressBar';
+import LoadProgressBar from './components/control-bar/LoadProgressBar';
import Slider from './components/Slider';
@@ -27,5 +31,9 @@
PlayToggle,
ForwardReplayControl,
ProgressControl,
+ SeekBar,
+ FullscreenToggle,
+ PlayProgressBar,
+ LoadProgressBar,
Slider,
}; |
f611aeddab1b5510669080cbab1b8692e80764c4 | src/lib/searchengine/graph.js | src/lib/searchengine/graph.js | var environment = require('../environment'),
offload = require('../../graphworker/standalone');
module.exports.search = function (options, recordcb, facetcb) {
if (typeof options.query !== 'undefined') {
if (typeof options.query.plan === 'undefined') {
options.query.plan = environment.querybuilder.build(options.query.ast);
}
options.query.offset = options.offset;
options.query.size = options.perpage;
}
offload('search', options, function (results) {
recordcb(results.search);
});
if (typeof facetcb === 'function') {
offload('facet', options, function (results) {
facetcb(results.facet);
});
}
};
module.exports.facet = function (options, facetcb) {
if (typeof options.query !== 'undefined' && typeof options.query.plan === 'undefined') {
options.query.plan = environment.querybuilder.build(options.query.ast);
}
offload('facet', options, function (results) {
facetcb(results.facet);
});
};
| var environment = require('../environment'),
offload = require('../../graphworker/standalone');
module.exports.search = function (options, recordcb, facetcb) {
if (typeof options.query !== 'undefined') {
options.query.plan = environment.querybuilder.build(options.query.ast);
options.query.offset = options.offset;
options.query.size = options.perpage;
}
offload('search', options, function (results) {
recordcb(results.search);
});
if (typeof facetcb === 'function') {
offload('facet', options, function (results) {
facetcb(results.facet);
});
}
};
module.exports.facet = function (options, facetcb) {
if (typeof options.query !== 'undefined') {
options.query.plan = environment.querybuilder.build(options.query.ast);
}
offload('facet', options, function (results) {
facetcb(results.facet);
});
};
| Rebuild the query every time it's needed so that preseeded results display | Rebuild the query every time it's needed so that preseeded results display
| JavaScript | agpl-3.0 | jcamins/biblionarrator,jcamins/biblionarrator | ---
+++
@@ -3,9 +3,7 @@
module.exports.search = function (options, recordcb, facetcb) {
if (typeof options.query !== 'undefined') {
- if (typeof options.query.plan === 'undefined') {
- options.query.plan = environment.querybuilder.build(options.query.ast);
- }
+ options.query.plan = environment.querybuilder.build(options.query.ast);
options.query.offset = options.offset;
options.query.size = options.perpage;
}
@@ -20,7 +18,7 @@
};
module.exports.facet = function (options, facetcb) {
- if (typeof options.query !== 'undefined' && typeof options.query.plan === 'undefined') {
+ if (typeof options.query !== 'undefined') {
options.query.plan = environment.querybuilder.build(options.query.ast);
}
offload('facet', options, function (results) { |
02b60cc05265429b90ac7289086661a7d8bd7814 | pac_script.js | pac_script.js | var BOARD_HEIGHT = 288;
var BOARD_WIDTH = 224;
var VERT_TILES = BOARD_HEIGHT / 8;
var HORIZ_TILES = BOARD_WIDTH / 8;
gameBoard = new Array(VERT_TILES);
for(var y = 0; y < VERT_TILES; y++) {
gameBoard[y] = new Array(HORIZ_TILES);
for(var x = 0; x < HORIZ_TILES; x++) {
gameBoard[y][x] = 0;
}
}
var canvas, context;
var ready = function(fun) {
if(document.readyState != "loading") {
fun();
}
else if(document.addEventListener) {
document.addEventListener("DOMContentLoaded", fun);
}
else {
document.attachEvent("onreadystatechange", function() {
if(document.readyState != "loading") {
fun();
}
});
}
}
ready(function() {
canvas = document.getElementById("board");
context = canvas.getContext("2d");
});
| var BOARD_HEIGHT = 288;
var BOARD_WIDTH = 224;
var VERT_TILES = BOARD_HEIGHT / 8;
var HORIZ_TILES = BOARD_WIDTH / 8;
gameBoard = new Array(VERT_TILES);
for(var y = 0; y < VERT_TILES; y++) {
gameBoard[y] = new Array(HORIZ_TILES);
for(var x = 0; x < HORIZ_TILES; x++) {
gameBoard[y][x] = "";
}
}
var canvas, context;
var drawObject = function(args) {
args.context.clearRect(0, 0, BOARD_WIDTH, BOARD_HEIGHT);
args.context.fillStyle = args.color;
args.objectArr.forEach(function(row, rIndex) {
row.forEach(function(col, cIndex) {
if(col == 1) {
args.context.fillRect(args.x + cIndex, args.y + rIndex, 1, 1);
}
});
});
}
var ready = function(fun) {
if(document.readyState != "loading") {
fun();
}
else if(document.addEventListener) {
document.addEventListener("DOMContentLoaded", fun);
}
else {
document.attachEvent("onreadystatechange", function() {
if(document.readyState != "loading") {
fun();
}
});
}
}
ready(function() {
canvas = document.getElementById("board");
context = canvas.getContext("2d");
drawObject({
x: 80,
y: 80,
objectArr: charset["A"],
color: "#FFF",
context: context
});
});
| Add drawObject function to draw matrix of pixels | Add drawObject function to draw matrix of pixels
| JavaScript | mit | peternatewood/pac-man-replica,peternatewood/pac-man-replica | ---
+++
@@ -7,11 +7,24 @@
for(var y = 0; y < VERT_TILES; y++) {
gameBoard[y] = new Array(HORIZ_TILES);
for(var x = 0; x < HORIZ_TILES; x++) {
- gameBoard[y][x] = 0;
+ gameBoard[y][x] = "";
}
}
var canvas, context;
+
+var drawObject = function(args) {
+ args.context.clearRect(0, 0, BOARD_WIDTH, BOARD_HEIGHT);
+ args.context.fillStyle = args.color;
+
+ args.objectArr.forEach(function(row, rIndex) {
+ row.forEach(function(col, cIndex) {
+ if(col == 1) {
+ args.context.fillRect(args.x + cIndex, args.y + rIndex, 1, 1);
+ }
+ });
+ });
+}
var ready = function(fun) {
if(document.readyState != "loading") {
@@ -32,4 +45,12 @@
ready(function() {
canvas = document.getElementById("board");
context = canvas.getContext("2d");
+
+ drawObject({
+ x: 80,
+ y: 80,
+ objectArr: charset["A"],
+ color: "#FFF",
+ context: context
+ });
}); |
94f8f130f60802a04d81c15b2b4c2766ca48e588 | src/vibrant.service.js | src/vibrant.service.js | angular
.module('ngVibrant')
.provider('$vibrant', $vibrantProvider);
function $vibrantProvider() {
this.$get = function() {
function $vibrant(element) {
var instance = new Vibrant(element);
return instance.swatches();
}
};
}
| angular
.module('ngVibrant')
.provider('$vibrant', $vibrantProvider);
function $vibrantProvider() {
this.$get = function() {
function $vibrant(element) {
var instance = new Vibrant(element);
var swatches = instance.swatches();
var rgb = {};
Object.getOwnPropertyNames(swatches).forEach(function(swatch) {
if (angular.isDefined(swatches[swatch])) {
rgb[swatch] = swatches[swatch].rgb;
}
});
return rgb;
}
};
}
| Return only rgb swatches (gonna add a toggle for this later) | Return only rgb swatches (gonna add a toggle for this later)
| JavaScript | apache-2.0 | maxjoehnk/ngVibrant | ---
+++
@@ -6,7 +6,14 @@
this.$get = function() {
function $vibrant(element) {
var instance = new Vibrant(element);
- return instance.swatches();
+ var swatches = instance.swatches();
+ var rgb = {};
+ Object.getOwnPropertyNames(swatches).forEach(function(swatch) {
+ if (angular.isDefined(swatches[swatch])) {
+ rgb[swatch] = swatches[swatch].rgb;
+ }
+ });
+ return rgb;
}
};
} |
aa2cc467387a8d156d64f6a6090d5a47bce0491d | app/src/reducers.js | app/src/reducers.js | import { combineReducers } from 'redux';
import { routerReducer } from 'react-router-redux';
import { reducer as formReducer } from 'redux-form';
// Import all of your reducers here:
import employees from 'containers/GeoSpatialViewContainer/reducer';
import keyMetrics from 'containers/KeyMetricsViewContainer/reducer';
import dataView from 'containers/DataViewContainer/reducer';
import issueKeyMetrics from 'containers/IssueKeyMetricsContainer/reducer';
import client from './apolloClient';
const rootReducer = combineReducers({
employees,
dataView,
keyMetrics,
issueKeyMetrics,
routing: routerReducer,
form: formReducer,
apollo: client.reducer(),
});
export default rootReducer;
| import { combineReducers } from 'redux';
import { routerReducer } from 'react-router-redux';
import { reducer as formReducer } from 'redux-form';
// Import all of your reducers here:
import employees from 'containers/GeospatialViewContainer/reducer';
import keyMetrics from 'containers/KeyMetricsViewContainer/reducer';
import dataView from 'containers/DataViewContainer/reducer';
import issueKeyMetrics from 'containers/IssueKeyMetricsContainer/reducer';
import client from './apolloClient';
const rootReducer = combineReducers({
employees,
dataView,
keyMetrics,
issueKeyMetrics,
routing: routerReducer,
form: formReducer,
apollo: client.reducer(),
});
export default rootReducer;
| TEST fix error cant resolve module | TEST fix error cant resolve module
| JavaScript | mit | JaySmartwave/palace-bot-sw,JaySmartwave/palace-bot-sw | ---
+++
@@ -3,7 +3,7 @@
import { reducer as formReducer } from 'redux-form';
// Import all of your reducers here:
-import employees from 'containers/GeoSpatialViewContainer/reducer';
+import employees from 'containers/GeospatialViewContainer/reducer';
import keyMetrics from 'containers/KeyMetricsViewContainer/reducer';
import dataView from 'containers/DataViewContainer/reducer';
import issueKeyMetrics from 'containers/IssueKeyMetricsContainer/reducer'; |
9c0c159b1184d5322f1baf0fa530efaf45cd5e3c | app/assets/javascripts/angular/main/login-controller.js | app/assets/javascripts/angular/main/login-controller.js | (function(){
'use strict';
angular
.module('secondLead')
.controller('LoginCtrl', [
'Restangular',
'$state',
'store',
'UserModel',
function (Restangular, $state, store, UserModel) {
var login = this;
login.user = {};
login.onSubmit = function() {
UserModel.login(login.user)
.then(function (response) {
var user = response.data.user;
$state.go('user.lists', {userID: user.id});
login.reset();
}, function(error){
login.error = "Invalid username/password";
}
);
}
login.reset = function () {
login.user = {};
};
}])
})(); | (function(){
'use strict';
angular
.module('secondLead')
.controller('LoginCtrl', [
'Restangular',
'$state',
'store',
'UserModel',
function (Restangular, $state, store, UserModel) {
var login = this;
login.user = {};
login.onSubmit = function() {
UserModel.login(login.user)
.then(function (response) {
var user = response.data.user;
UserModel.setLoggedIn(true);
$state.go('user.lists', {userID: user.id});
login.reset();
}, function(error){
login.error = "Invalid username/password";
}
);
}
login.reset = function () {
login.user = {};
};
}])
})(); | Add update to usermodel upon login with login controller | Add update to usermodel upon login with login controller
| JavaScript | mit | ac-adekunle/secondlead,ac-adekunle/secondlead,ac-adekunle/secondlead | ---
+++
@@ -19,6 +19,7 @@
UserModel.login(login.user)
.then(function (response) {
var user = response.data.user;
+ UserModel.setLoggedIn(true);
$state.go('user.lists', {userID: user.id});
login.reset();
}, function(error){ |
72267372d27463883af3dd2bff775e8199948770 | VIE/test/rdfa.js | VIE/test/rdfa.js | var jQuery = require('jquery');
var VIE = require('../vie.js');
// Until https://github.com/tmpvar/jsdom/issues/issue/81 is fixed
VIE.RDFa.predicateSelector = '[property]';
exports['test inheriting subject'] = function(test) {
var html = jQuery('<div about="http://dbpedia.org/resource/Albert_Einstein"><span property="foaf:name">Albert Einstein<span><span property="dbp:dateOfBirth" datatype="xsd:date">1879-03-14</span><div rel="dbp:birthPlace" resource="http://dbpedia.org/resource/Germany" /><span about="http://dbpedia.org/resource/Germany" property="dbp:conventionalLongName">Federal Republic of Germany</span></div>');
var entities = VIE.RDFa.readEntities(html);
test.equal(entities.length, 2, "This RDFa defines two entities but they don't get parsed to JSON");
var entities = VIE.RDFaEntities.getInstances(html);
test.equal(entities.length, 2, "This RDFa defines two entities but they don't get to Backbone");
test.done();
};
| var jQuery = require('jquery');
var VIE = require('../vie.js');
// Until https://github.com/tmpvar/jsdom/issues/issue/81 is fixed
VIE.RDFa.predicateSelector = '[property]';
exports['test inheriting subject'] = function(test) {
var html = jQuery('<div about="http://dbpedia.org/resource/Albert_Einstein"><span property="foaf:name">Albert Einstein</span><span property="dbp:dateOfBirth" datatype="xsd:date">1879-03-14</span><div rel="dbp:birthPlace" resource="http://dbpedia.org/resource/Germany" /><span about="http://dbpedia.org/resource/Germany" property="dbp:conventionalLongName">Federal Republic of Germany</span></div>');
var jsonldEntities = VIE.RDFa.readEntities(html);
test.equal(jsonldEntities.length, 2, "This RDFa defines two entities but they don't get parsed to JSON");
test.equal(jsonldEntities[1]['foaf:name'], 'Albert Einstein');
test.equal(jsonldEntities[0]['dbp:conventionalLongName'], 'Federal Republic of Germany');
var backboneEntities = VIE.RDFaEntities.getInstances(html);
test.equal(backboneEntities.length, 2, "This RDFa defines two entities but they don't get to Backbone");
test.equal(backboneEntities[1].get('foaf:name'), 'Albert Einstein');
test.equal(backboneEntities[0].get('dbp:conventionalLongName'), 'Federal Republic of Germany');
test.done();
};
| Test getting properties as well | Test getting properties as well
| JavaScript | mit | bergie/VIE,bergie/VIE | ---
+++
@@ -5,13 +5,19 @@
VIE.RDFa.predicateSelector = '[property]';
exports['test inheriting subject'] = function(test) {
- var html = jQuery('<div about="http://dbpedia.org/resource/Albert_Einstein"><span property="foaf:name">Albert Einstein<span><span property="dbp:dateOfBirth" datatype="xsd:date">1879-03-14</span><div rel="dbp:birthPlace" resource="http://dbpedia.org/resource/Germany" /><span about="http://dbpedia.org/resource/Germany" property="dbp:conventionalLongName">Federal Republic of Germany</span></div>');
+ var html = jQuery('<div about="http://dbpedia.org/resource/Albert_Einstein"><span property="foaf:name">Albert Einstein</span><span property="dbp:dateOfBirth" datatype="xsd:date">1879-03-14</span><div rel="dbp:birthPlace" resource="http://dbpedia.org/resource/Germany" /><span about="http://dbpedia.org/resource/Germany" property="dbp:conventionalLongName">Federal Republic of Germany</span></div>');
- var entities = VIE.RDFa.readEntities(html);
- test.equal(entities.length, 2, "This RDFa defines two entities but they don't get parsed to JSON");
+ var jsonldEntities = VIE.RDFa.readEntities(html);
+ test.equal(jsonldEntities.length, 2, "This RDFa defines two entities but they don't get parsed to JSON");
- var entities = VIE.RDFaEntities.getInstances(html);
- test.equal(entities.length, 2, "This RDFa defines two entities but they don't get to Backbone");
+ test.equal(jsonldEntities[1]['foaf:name'], 'Albert Einstein');
+ test.equal(jsonldEntities[0]['dbp:conventionalLongName'], 'Federal Republic of Germany');
+
+ var backboneEntities = VIE.RDFaEntities.getInstances(html);
+ test.equal(backboneEntities.length, 2, "This RDFa defines two entities but they don't get to Backbone");
+
+ test.equal(backboneEntities[1].get('foaf:name'), 'Albert Einstein');
+ test.equal(backboneEntities[0].get('dbp:conventionalLongName'), 'Federal Republic of Germany');
test.done();
}; |
e2e2ea04901ca320c33792245fdb80c33f04ec6b | app/js/controllers.js | app/js/controllers.js | var phonecatControllers = angular.module('leaguecontrollers', []);
phonecatControllers.factory("dataProvider", ['$q', function($q) {
console.log("Running dataProvider factory");
return {
getData: function() {
var result = bowling.initialize({"root": "testdata"}, $q);
return result;
}
}
}]).controller('LeagueController', ['$scope', '$route', 'dataProvider',
function ($scope, $route, dataProvider) {
console.log("Loaded league data");
dataProvider.getData().then(function(league) {
$scope.league = league;
});
}
]
);
| var phonecatControllers = angular.module('leaguecontrollers', []);
phonecatControllers.factory("dataProvider", ['$q', function($q) {
console.log("Running dataProvider factory");
var dataLoaded = false;
return {
getData: function() {
if (!dataLoaded) {
var result = bowling.initialize({"root": "testdata"}, $q);
return result.then(function (league) {
console.log("Data loaded marking flag");
dataLoaded = true;
return league;
});
} else {
return $q(function (resolve, reject) {
resolve(bowling.currentLeague);
});
}
}
}
}]).controller('LeagueController', ['$scope', '$route', 'dataProvider',
function ($scope, $route, dataProvider) {
console.log("Loaded league data");
dataProvider.getData().then(function(league) {
$scope.league = league;
});
}
]
);
| Add getData overrides for multiple views. | Add getData overrides for multiple views.
| JavaScript | mit | MeerkatLabs/bowling-visualization | ---
+++
@@ -3,10 +3,22 @@
phonecatControllers.factory("dataProvider", ['$q', function($q) {
console.log("Running dataProvider factory");
+ var dataLoaded = false;
+
return {
getData: function() {
- var result = bowling.initialize({"root": "testdata"}, $q);
- return result;
+ if (!dataLoaded) {
+ var result = bowling.initialize({"root": "testdata"}, $q);
+ return result.then(function (league) {
+ console.log("Data loaded marking flag");
+ dataLoaded = true;
+ return league;
+ });
+ } else {
+ return $q(function (resolve, reject) {
+ resolve(bowling.currentLeague);
+ });
+ }
}
}
}]).controller('LeagueController', ['$scope', '$route', 'dataProvider', |
39d4ee5ccd345b3aa7602e00ad70508ed5d0997b | benchmark/wrench.js | benchmark/wrench.js | #!/usr/bin/env node
var wrench = require('wrench');
var files = 0;
wrench.readdirRecursive(process.argv[2], function (err, curFiles) {
if (curFiles === null) {
console.log(files);
} else {
if (curFiles) files += curFiles.length;
}
});
| #!/usr/bin/env node
var wrench = require('wrench');
var files = 0;
wrench.readdirRecursive(process.argv[2], function (err, curFiles) {
if (curFiles === null) {
console.log(files);
} else {
if (curFiles) files += curFiles.length;
}
});
| Kill trailing whitespace in benchmark. | Kill trailing whitespace in benchmark.
| JavaScript | mit | kjbekkelund/recurse,kjbekkelund/recurse | ---
+++
@@ -7,6 +7,6 @@
if (curFiles === null) {
console.log(files);
} else {
- if (curFiles) files += curFiles.length;
+ if (curFiles) files += curFiles.length;
}
}); |
ef478f65b91a9948c33b446468b9c98861ad2686 | src/TextSuggest.js | src/TextSuggest.js | /**
* Created by XaviTorello on 30/05/18
*/
import React from 'react';
import ComposedComponent from './ComposedComponent';
import AutoComplete from 'material-ui/AutoComplete';
class TextSuggest extends React.Component {
render() {
// console.log('TextSuggest', this.props.form);
// assign the source list to autocomplete
const datasource = this.props.form.schema.enumNames || this.props.form.schema.enum || ['Loading...'];
// assign the filter, by default case insensitive
const filter = ((filter) => {
switch (filter) {
case 'fuzzy':
return AutoComplete.fuzzyFilter;
break;
default:
return AutoComplete.caseInsensitiveFilter;
break;
}
})(this.props.form.filter)
return (
<div className={this.props.form.htmlClass}>
<AutoComplete
type={this.props.form.type}
floatingLabelText={this.props.form.title}
hintText={this.props.form.placeholder}
errorText={this.props.error}
onChange={this.props.onChangeValidate}
defaultValue={this.props.value}
disabled={this.props.form.readonly}
style={this.props.form.style || {width: '100%'}}
dataSource={datasource}
filter={filter}
maxSearchResults={this.props.form.maxSearchResults || 5}
/>
</div>
);
}
}
export default ComposedComponent(TextSuggest);
| /**
* Created by XaviTorello on 30/05/18
*/
import React from 'react';
import ComposedComponent from './ComposedComponent';
import AutoComplete from 'material-ui/AutoComplete';
const dataSourceConfig = {
text: 'name',
value: 'value',
};
class TextSuggest extends React.Component {
render() {
// console.log('TextSuggest', this.props.form);
// assign the source list to autocomplete
const datasource = this.props.form.schema.enumNames || this.props.form.schema.enum || ['Loading...'];
// assign the filter, by default case insensitive
const filter = ((filter) => {
switch (filter) {
case 'fuzzy':
return AutoComplete.fuzzyFilter;
break;
default:
return AutoComplete.caseInsensitiveFilter;
break;
}
})(this.props.form.filter)
return (
<div className={this.props.form.htmlClass}>
<AutoComplete
type={this.props.form.type}
floatingLabelText={this.props.form.title}
hintText={this.props.form.placeholder}
errorText={this.props.error}
onChange={this.props.onChangeValidate}
defaultValue={this.props.value}
disabled={this.props.form.readonly}
style={this.props.form.style || {width: '100%'}}
dataSource={datasource}
filter={filter}
maxSearchResults={this.props.form.maxSearchResults || 5}
/>
</div>
);
}
}
export default ComposedComponent(TextSuggest);
| Add dataSourceConfig to link passed datasource keys | Add dataSourceConfig to link passed datasource keys
| JavaScript | mit | networknt/react-schema-form,networknt/react-schema-form | ---
+++
@@ -4,6 +4,11 @@
import React from 'react';
import ComposedComponent from './ComposedComponent';
import AutoComplete from 'material-ui/AutoComplete';
+
+const dataSourceConfig = {
+ text: 'name',
+ value: 'value',
+};
class TextSuggest extends React.Component {
render() { |
abd11edf30aa0a77548b04263b26edd1efe8cc89 | app/containers/TimeProvider/index.js | app/containers/TimeProvider/index.js | import React, { PropTypes } from 'react';
import { connect } from 'react-redux';
import moment from 'moment';
import { gql, graphql } from 'react-apollo';
import { getCurrentTimeSuccess } from '../App/actions';
const GetCurrentTime = gql`
query GetCurrentTime {
time
}
`;
@graphql(GetCurrentTime, { options: { pollInterval: 5 * 60 * 1000 } })
@connect(null, (dispatch) => ({ dispatch }))
export default class TimeProvider extends React.PureComponent {
constructor(props) {
super(props);
this.parseProps(props);
}
componentWillReceiveProps(nextProps) {
this.parseProps(nextProps);
}
parseProps(props) {
if (!props.data.loading) {
this.props.dispatch(getCurrentTimeSuccess(moment(props.data.time)));
}
}
render() {
return this.props.children ? this.props.children : null;
}
}
TimeProvider.propTypes = {
children: PropTypes.node,
dispatch: PropTypes.func,
};
| import React, { PropTypes } from 'react';
import { connect } from 'react-redux';
import moment from 'moment';
import { gql, graphql } from 'react-apollo';
import { getCurrentTimeSuccess } from '../App/actions';
const GetCurrentTime = gql`
query GetCurrentTime {
time
}
`;
@graphql(GetCurrentTime, { options: { pollInterval: 5 * 60 * 1000 } })
@connect(null, (dispatch) => ({ dispatch }))
export default class TimeProvider extends React.PureComponent {
constructor(props) {
super(props);
this.parseProps(props);
}
componentWillReceiveProps(nextProps) {
this.parseProps(nextProps);
}
parseProps(props) {
if (!props.data.loading && !props.data.error) {
this.props.dispatch(getCurrentTimeSuccess(moment(props.data.time)));
}
}
render() {
return this.props.children ? this.props.children : null;
}
}
TimeProvider.propTypes = {
children: PropTypes.node,
dispatch: PropTypes.func,
};
| Check for GraphQL error in TimeProvider | Check for GraphQL error in TimeProvider
| JavaScript | bsd-3-clause | zmora-agh/zmora-ui,zmora-agh/zmora-ui | ---
+++
@@ -26,7 +26,7 @@
}
parseProps(props) {
- if (!props.data.loading) {
+ if (!props.data.loading && !props.data.error) {
this.props.dispatch(getCurrentTimeSuccess(moment(props.data.time)));
}
} |
80da46e990bc2f9562d56874903ecfde718027e7 | test/riak.js | test/riak.js | "use strict";
/* global describe, it */
describe('Riak client', function() {
var riakClient = require('../lib/riak')();
it('#getServerInfo', function() {
return riakClient.getServerInfo()
.then(function(info) {
info.should.have.property('node')
info.should.have.property('server_version')
})
})
})
| "use strict";
/* global describe, it, before */
describe('Riak client', function() {
var riakClient = require('../lib/riak')();
var bucket = 'test-riak-' + Date.now();
before(function() {
return riakClient.setBucket({
bucket: bucket,
props: {
allow_mult: true,
last_write_wins: false,
}
})
})
it('#getServerInfo', function() {
return riakClient.getServerInfo()
.then(function(info) {
info.should.have.property('node')
info.should.have.property('server_version')
})
})
it('delete without vclock should not create sibling (allow_mult=true)', function() {
var vclock;
return riakClient.put({
bucket: bucket,
key: 'testKey',
content: {
value: '1234'
},
return_head: true
})
.then(function(reply) {
vclock = reply.vclock
return riakClient.del({
bucket: bucket,
key: 'testKey'
})
})
.then(function() {
return riakClient.get({
bucket: bucket,
key: 'testKey',
deletedvclock: true
})
})
.then(function(reply) {
reply.should.not.have.property('content')
reply.vclock.should.not.be.eql(vclock)
})
})
it('delete with stale vclock should create sibling (allow_mult=true)', function() {
var vclock;
return riakClient.put({
bucket: bucket,
key: 'testKey2',
content: {
value: '1234'
},
return_head: true
})
.then(function(reply) {
vclock = reply.vclock
return riakClient.put({
bucket: bucket,
key: 'testKey2',
vclock: vclock,
content: {
value: '123456'
}
})
})
.then(function() {
return riakClient.del({
bucket: bucket,
key: 'testKey2',
vclock: vclock
})
})
.then(function() {
return riakClient.get({
bucket: bucket,
key: 'testKey2',
deletedvclock: true
})
})
.then(function(reply) {
reply.should.have.property('content').that.is.an('array').and.have.length(2)
})
})
})
| Test Riak delete object with allow_mult=true | Test Riak delete object with allow_mult=true
| JavaScript | mit | oleksiyk/riakfs | ---
+++
@@ -1,10 +1,21 @@
"use strict";
-/* global describe, it */
+/* global describe, it, before */
describe('Riak client', function() {
var riakClient = require('../lib/riak')();
+ var bucket = 'test-riak-' + Date.now();
+
+ before(function() {
+ return riakClient.setBucket({
+ bucket: bucket,
+ props: {
+ allow_mult: true,
+ last_write_wins: false,
+ }
+ })
+ })
it('#getServerInfo', function() {
return riakClient.getServerInfo()
@@ -14,4 +25,75 @@
})
})
+ it('delete without vclock should not create sibling (allow_mult=true)', function() {
+ var vclock;
+ return riakClient.put({
+ bucket: bucket,
+ key: 'testKey',
+ content: {
+ value: '1234'
+ },
+ return_head: true
+ })
+ .then(function(reply) {
+ vclock = reply.vclock
+ return riakClient.del({
+ bucket: bucket,
+ key: 'testKey'
+ })
+ })
+ .then(function() {
+ return riakClient.get({
+ bucket: bucket,
+ key: 'testKey',
+ deletedvclock: true
+ })
+ })
+ .then(function(reply) {
+ reply.should.not.have.property('content')
+ reply.vclock.should.not.be.eql(vclock)
+ })
+ })
+
+ it('delete with stale vclock should create sibling (allow_mult=true)', function() {
+ var vclock;
+ return riakClient.put({
+ bucket: bucket,
+ key: 'testKey2',
+ content: {
+ value: '1234'
+ },
+ return_head: true
+ })
+ .then(function(reply) {
+ vclock = reply.vclock
+
+ return riakClient.put({
+ bucket: bucket,
+ key: 'testKey2',
+ vclock: vclock,
+ content: {
+ value: '123456'
+ }
+ })
+ })
+ .then(function() {
+ return riakClient.del({
+ bucket: bucket,
+ key: 'testKey2',
+ vclock: vclock
+ })
+ })
+ .then(function() {
+ return riakClient.get({
+ bucket: bucket,
+ key: 'testKey2',
+ deletedvclock: true
+ })
+ })
+ .then(function(reply) {
+ reply.should.have.property('content').that.is.an('array').and.have.length(2)
+ })
+ })
+
}) |
a30b3ede167cd547af9d367c9c07504e5015d8dc | server/app.js | server/app.js | var express = require('express');
var app = express();
// Serve assets in /public
var path = require('path');
app.use(express.static(path.join(__dirname, '../client')));
// Body parsing for JSON POST payloads
var bodyParser = require('body-parser');
app.use(bodyParser.json());
// Middlewares
app.use(require('./middlewares/cross_origin_requests'));
app.use(require('./middlewares/http_verbs'));
app.use(require('./middlewares/add_user_to_request'));
// Mount controller files
app.use('/notes', require('./routes/notes'));
app.use('/users', require('./routes/users'));
app.use('/session', require('./routes/session'));
// Start server
app.set('port', (process.env.PORT || 5000));
app.listen(app.get('port'), function() {
console.log('Listening on http://localhost:', app.get('port'));
});
| var express = require('express');
var app = express();
// Serve assets in /public
var path = require('path');
app.use(express.static(path.join(__dirname, '../client')));
// Body parsing for JSON POST payloads
var bodyParser = require('body-parser');
app.use(bodyParser.json());
// Middlewares
app.use(require('./middlewares/cross_origin_requests'));
app.use(require('./middlewares/http_verbs'));
app.use(require('./middlewares/add_user_to_request'));
// Mount controller files
app.use('/notes', require('./routes/notes'));
app.use('/users', require('./routes/users'));
app.use('/session', require('./routes/session'));
// Start server
app.set('port', (process.env.PORT || 3000));
app.listen(app.get('port'), function() {
console.log('Listening on http://localhost:', app.get('port'));
});
| Use port 3000 instead of 5000. | Use port 3000 instead of 5000. | JavaScript | mit | unixmonkey/caedence.net-2015,unixmonkey/caedence.net-2015 | ---
+++
@@ -20,7 +20,7 @@
app.use('/session', require('./routes/session'));
// Start server
-app.set('port', (process.env.PORT || 5000));
+app.set('port', (process.env.PORT || 3000));
app.listen(app.get('port'), function() {
console.log('Listening on http://localhost:', app.get('port'));
}); |
851cf0c6edb73b18dac37ffebb5b09c0e5237310 | server/app.js | server/app.js | import express from 'express';
import logger from 'morgan';
import bodyParser from 'body-parser';
import http from 'http';
const app = express();
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.set('json spaces', 4);
const port = parseInt(process.env.PORT, 10) || 5000;
app.set('port', port);
require('./routes')(app);
app.get('*', (req, res) => res.status(200).send({
message: 'Welcome to the beginning of aawesomeness',
}));
const server = http.createServer(app);
server.listen(port);
module.exports = app;
| import express from 'express';
import logger from 'morgan';
import bodyParser from 'body-parser';
const app = express();
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.set('json spaces', 4);
const port = process.env.PORT || 5000;
app.set('port', port);
require('./routes')(app);
app.get('*', (req, res) => res.status(200).send({
message: 'Welcome to the beginning of aawesomeness',
}));
app.listen(port);
module.exports = app;
| Refactor filre for hosting heroku | Refactor filre for hosting heroku
| JavaScript | mit | Billmike/More-Recipes,Billmike/More-Recipes | ---
+++
@@ -1,7 +1,6 @@
import express from 'express';
import logger from 'morgan';
import bodyParser from 'body-parser';
-import http from 'http';
const app = express();
@@ -11,7 +10,7 @@
app.use(bodyParser.urlencoded({ extended: false }));
app.set('json spaces', 4);
-const port = parseInt(process.env.PORT, 10) || 5000;
+const port = process.env.PORT || 5000;
app.set('port', port);
require('./routes')(app);
@@ -20,7 +19,7 @@
message: 'Welcome to the beginning of aawesomeness',
}));
-const server = http.createServer(app);
-server.listen(port);
+
+app.listen(port);
module.exports = app; |
1bcb78fa324e44fd9dcfebdb0a5f5e409f9a746a | lib/core/src/server/common/babel-loader.js | lib/core/src/server/common/babel-loader.js | import { includePaths, excludePaths } from '../config/utils';
export default options => ({
test: /\.(mjs|jsx?)$/,
use: [
{
loader: 'babel-loader',
options,
},
],
include: includePaths,
exclude: excludePaths,
});
export const nodeModulesBabelLoader = {
test: /\.js$/,
include: /\/node_modules\/safe-eval\//,
use: [
{
loader: 'babel-loader',
options: {
cacheDirectory: true,
babelrc: false,
presets: [
[
require.resolve('@babel/preset-env'),
{
useBuiltIns: 'usage',
modules: 'commonjs',
},
],
],
},
},
],
};
| import { includePaths, excludePaths } from '../config/utils';
export default options => ({
test: /\.(mjs|jsx?)$/,
use: [
{
loader: 'babel-loader',
options,
},
],
include: includePaths,
exclude: excludePaths,
});
export const nodeModulesBabelLoader = {
test: /\.js$/,
include: /\/node_modules\/safe-eval\//,
use: [
{
loader: 'babel-loader',
options: {
cacheDirectory: true,
babelrc: false,
presets: [
[
'env',
{
modules: 'commonjs',
},
],
],
},
},
],
};
| Make nodeModulesBabelLoader compatible with Babel 6 | Make nodeModulesBabelLoader compatible with Babel 6
| JavaScript | mit | storybooks/storybook,kadirahq/react-storybook,storybooks/react-storybook,storybooks/react-storybook,storybooks/react-storybook,storybooks/storybook,storybooks/storybook,kadirahq/react-storybook,storybooks/storybook,storybooks/storybook,storybooks/storybook,storybooks/react-storybook,storybooks/storybook | ---
+++
@@ -23,9 +23,8 @@
babelrc: false,
presets: [
[
- require.resolve('@babel/preset-env'),
+ 'env',
{
- useBuiltIns: 'usage',
modules: 'commonjs',
},
], |
ffd6a08630675550427919737f6ddb6020ff1e63 | main.js | main.js | /*
* Evernote-webhooks: A project to use webhooks to automate things in Evernote
*/
var express = require('express');
var config = require('./config.json');
var app = express();
var consumerKey = process.env.consumerKey;
var consumerSecret = process.env.consumerSecret;
var wwwDir = "/www";
app.use('/', express.static(__dirname + wwwDir));
app.get('/:endpoint', function(req, res, next) { console.log(req.params.endpoint); next(); });
app.get('/', function(req, res) { res.render(wwwDir + '/index.html');});
// Start the server on port 3000 or the server port.
var port = process.env.PORT || 3000;
console.log('PORT: ' + port);
var server = app.listen(port);
| /*
* Evernote-webhooks: A project to use webhooks to automate things in Evernote
*/
var express = require('express');
var app = express();
var consumerKey = process.env.consumerKey;
var consumerSecret = process.env.consumerSecret;
var wwwDir = "/www";
app.use('/', express.static(__dirname + wwwDir));
app.get('/:endpoint', function(req, res, next) { console.log(req.params.endpoint); next(); });
app.get('/', function(req, res) { res.render(wwwDir + '/index.html');});
// Start the server on port 3000 or the server port.
var port = process.env.PORT || 3000;
console.log('PORT: ' + port);
var server = app.listen(port);
| Remove import of config.json for Heroku to work | Remove import of config.json for Heroku to work
| JavaScript | mit | tomzhang32/evernote-webhooks,tomzhang32/evernote-webhooks | ---
+++
@@ -2,7 +2,6 @@
* Evernote-webhooks: A project to use webhooks to automate things in Evernote
*/
var express = require('express');
-var config = require('./config.json');
var app = express();
var consumerKey = process.env.consumerKey; |
4f6915eb0ee67ea77a69ac7d4653279abb6e6bbd | data-init.js | data-init.js | 'use strict';
angular.module('ngAppInit', []).
provider('$init', function(
){
this.$get = function() {
return {};
};
}).
directive('ngAppInit', function(
$window,
$init
){
return {
compile: function() {
return {
pre: function(scope, element, attrs) {
angular.extend($init, $window.JSON.parse(attrs.ngAppInit));
}
};
}
};
});
| 'use strict';
angular.module('data-init', []).
provider('$init', function() {
this.$get = function(
$window
){
return $window.JSON.parse(document.querySelector('[ng-app]').dataset.init);
};
});
| Rewrite the logic without using directive | Rewrite the logic without using directive
| JavaScript | mit | gsklee/angular-init | ---
+++
@@ -1,25 +1,11 @@
'use strict';
-angular.module('ngAppInit', []).
+angular.module('data-init', []).
-provider('$init', function(
-){
- this.$get = function() {
- return {};
- };
-}).
-
-directive('ngAppInit', function(
- $window,
- $init
-){
- return {
- compile: function() {
- return {
- pre: function(scope, element, attrs) {
- angular.extend($init, $window.JSON.parse(attrs.ngAppInit));
- }
- };
- }
+provider('$init', function() {
+ this.$get = function(
+ $window
+ ){
+ return $window.JSON.parse(document.querySelector('[ng-app]').dataset.init);
};
}); |
ca7e839ee3013af0f16b3e4c0c88b231063cfc38 | examples/async/server.js | examples/async/server.js | const webpack = require('webpack');
const webpackDevMiddleware = require('webpack-dev-middleware');
const webpackHotMiddleware = require('webpack-hot-middleware');
const config = require('./webpack.config');
const app = new (require('express'))();
const port = 4000;
const compiler = webpack(config);
app.use(webpackDevMiddleware(compiler, { noInfo: true, publicPath: config.output.publicPath }));
app.use(webpackHotMiddleware(compiler));
app.use((req, res) => {
res.sendFile(`${__dirname}/index.html`);
});
app.listen(port, (error) => {
if (error) {
console.error(error);
} else {
console.info('==> 🌎 Listening on port %s. Open up http://localhost:%s/ in your browser.', port, port);
}
});
| const webpack = require('webpack');
const webpackDevMiddleware = require('webpack-dev-middleware');
const webpackHotMiddleware = require('webpack-hot-middleware');
const config = require('./webpack.config');
const app = new (require('express'))();
const port = 4001;
const compiler = webpack(config);
app.use(webpackDevMiddleware(compiler, { noInfo: true, publicPath: config.output.publicPath }));
app.use(webpackHotMiddleware(compiler));
app.use((req, res) => {
res.sendFile(`${__dirname}/index.html`);
});
app.listen(port, (error) => {
if (error) {
console.error(error);
} else {
console.info('==> 🌎 Listening on port %s. Open up http://localhost:%s/ in your browser.', port, port);
}
});
| Change port of Async example | Change port of Async example
| JavaScript | mit | quandhz/resaga,quandhz/resaga | ---
+++
@@ -4,7 +4,7 @@
const config = require('./webpack.config');
const app = new (require('express'))();
-const port = 4000;
+const port = 4001;
const compiler = webpack(config);
app.use(webpackDevMiddleware(compiler, { noInfo: true, publicPath: config.output.publicPath })); |
f51217f928277adb8888e52cbcd8d7f373d72df4 | src/db/queries.js | src/db/queries.js | const pgp = require('pg-promise')()
const dbName = 'vinyl'
const connectionString = process.env.DATABASE_URL || `postgres://localhost:5432/${dbName}`
const db = pgp(connectionString)
const getAlbums = () => {
return db.query('SELECT * FROM albums')
}
const getAlbumById = (albumId) => {
return db.one(`
SELECT * FROM albums
WHERE id = $1
`, [albumId])
}
const getUserByEmail = (email) => {
return db.one(`
SELECT * FROM users WHERE email = $1
`, [email])
.catch((error) => {
console.error('\nError in queries.getUserByEmail\n')
throw error
})
}
const createUser = (name, email, password) => {
return db.none(`
INSERT INTO
users (name, email, password)
VALUES
($1, $2, $3)
`, [name, email, password])
}
module.exports = {
getAlbums,
getAlbumById,
createUser,
getUserByEmail
}
| const pgp = require('pg-promise')()
const dbName = 'vinyl'
const connectionString = process.env.DATABASE_URL || `postgres://localhost:5432/${dbName}`
const db = pgp(connectionString)
const getAlbums = () => {
return db.query('SELECT * FROM albums')
}
const getAlbumById = (albumId) => {
return db.one(`
SELECT * FROM albums
WHERE id = $1
`, [albumId])
}
const getUserByEmail = (email) => {
return db.one(`
SELECT * FROM users WHERE LOWER(email) = LOWER($1)
`, [email])
.catch((error) => {
console.error('\nError in queries.getUserByEmail\n')
throw error
})
}
const createUser = (name, email, password) => {
return db.none(`
INSERT INTO
users (name, email, password)
VALUES
($1, $2, $3)
`, [name, email, password])
}
module.exports = {
getAlbums,
getAlbumById,
createUser,
getUserByEmail
}
| Update query to make e-mail in sign-in not case sensitive | Update query to make e-mail in sign-in not case sensitive
| JavaScript | mit | Maighdlyn/phase-4-challenge,Maighdlyn/phase-4-challenge,Maighdlyn/phase-4-challenge | ---
+++
@@ -17,7 +17,7 @@
const getUserByEmail = (email) => {
return db.one(`
- SELECT * FROM users WHERE email = $1
+ SELECT * FROM users WHERE LOWER(email) = LOWER($1)
`, [email])
.catch((error) => {
console.error('\nError in queries.getUserByEmail\n') |
d9a2f54d42395ca21edc1de6383049af0d512c42 | homeworks/dmitry.minchenko_wer1Kua/homework_2/script.js | homeworks/dmitry.minchenko_wer1Kua/homework_2/script.js | (function() {
let height = 1,
block = '#',
space = ' ';
if (height<2) {
return console.log('Error! Height must be >= 2');
}
for (let i = 0; i < height; i++) {
console.log(space.repeat(height-i) + block.repeat(i+1) + space.repeat(2) + block.repeat(1+i));
}
})();
| (function() {
let height = 13,
block = '#',
space = ' ';
if (height<2 && height>12) {
return console.log('Error! Height must be >= 2 and <= 12');
}
for (let i = 0; i < height; i++) {
console.log(space.repeat(height-i) + block.repeat(i+1) + space.repeat(2) + block.repeat(1+i));
}
})();
| Add maximum check for pyramid height | Add maximum check for pyramid height
| JavaScript | mit | MastersAcademy/js-course-2017,MastersAcademy/js-course-2017,MastersAcademy/js-course-2017 | ---
+++
@@ -1,10 +1,10 @@
(function() {
- let height = 1,
+ let height = 13,
block = '#',
space = ' ';
- if (height<2) {
- return console.log('Error! Height must be >= 2');
+ if (height<2 && height>12) {
+ return console.log('Error! Height must be >= 2 and <= 12');
}
for (let i = 0; i < height; i++) { |
04866dcdf67fe8a264a0bf6308613339527ed69c | app/api/rooms.js | app/api/rooms.js | module.exports = function(app) {
/**
* @apiGroup buildings
* @apiName Show list of buildings
* @apiVersion 3.0.0
* @api {get} buildings Show list of available buildings
* @apiSuccess {[]} buildings List of buildings
* @apiError InternalServerError
*/
app.get('/api/v3/buildings', function(request, response) {
app.settings.db.Building.find({},
{ _id: 0, __v: 0, rooms: 0 },
function(error, buildings) {
if (error)
return response.status(500).send();
response.json(buildings);
});
});
/**
* @apiGroup building
* @apiName Get building information
* @apiVersion 3.0.0
* @api {get} buildings Show list of available buildings
* @apiParam {string} name Building name
* @apiSuccess {} building data
* @apiError BuildingNotFound
*/
app.get('/api/v3/buildings/:name', function(request, response) {
var name = request.params.name;
app.settings.db.Building.find(
{ "name" : new RegExp(name, 'i') },
{ _id: 0, __v: 0 },
function(error, building) {
if (error || building.length == 0)
return response.status(404).send("BuildingNotFound");
response.json(building[0]);
});
});
}; | module.exports = function(app) {
/**
* @apiGroup buildings
* @apiName Show list of buildings
* @apiVersion 3.0.0
* @api {get} buildings Show list of available buildings
* @apiSuccess {[]} buildings List of buildings
* @apiError InternalServerError
*/
app.get('/api/v3/buildings', function(request, response) {
app.settings.db.Building.find({},
{ _id: 0, __v: 0, rooms: 0 },
function(error, buildings) {
if (error)
return response.status(500).send();
response.json(buildings);
});
});
/**
* @apiGroup building
* @apiName Get building information
* @apiVersion 3.0.0
* @api {get} buildings Show list of available buildings
* @apiParam {string} name Building name
* @apiSuccess {string} name building name
* @apiError BuildingNotFound
*/
app.get('/api/v3/buildings/:name', function(request, response) {
var name = request.params.name;
app.settings.db.Building.find(
{ "name" : new RegExp(name, 'i') },
{ _id: 0, __v: 0 },
function(error, building) {
if (error || building.length == 0)
return response.status(404).send("BuildingNotFound");
response.json(building[0]);
});
});
}; | Fix apidoc to allow `npm install` to complete | Fix apidoc to allow `npm install` to complete
| JavaScript | mit | igalshapira/ziggi3,igalshapira/ziggi3 | ---
+++
@@ -23,7 +23,7 @@
* @apiVersion 3.0.0
* @api {get} buildings Show list of available buildings
* @apiParam {string} name Building name
- * @apiSuccess {} building data
+ * @apiSuccess {string} name building name
* @apiError BuildingNotFound
*/
app.get('/api/v3/buildings/:name', function(request, response) { |
1e2f32d2da67b3731deee762f888682884f90099 | spec/specs.js | spec/specs.js | describe('pingPong', function() {
it("is false for a number that is not divisible by 3 or 5", function() {
expect(pingPong(7)).to.equal(false);
});
it("will run pingPongType if isPingPong is true", function() {
expect(pingPong(6)).to.equal("ping");
});
});
describe('pingPongType', function() {
it("returns ping for a number that is divisible by 3", function() {
expect(pingPongType(6)).to.equal("ping");
});
it("returns pong for a number that is divisible by 5", function() {
expect(pingPongType(10)).to.equal("pong");
});
it("returns pingpong for a number that is divisible by 3 and 5", function() {
expect(pingPongType(30)).to.equal("pingpong")
});
});
describe('isPingPong', function() {
it("returns true for a number divisible by 3, 5, or 15", function() {
expect(isPingPong(6)).to.equal(true);
});
it("returns false for a number not divisible by 3, 5, or 15", function() {
expect(isPingPong(7)).to.equal(false);
});
});
| describe('pingPongType', function() {
it("returns ping for a number that is divisible by 3", function() {
expect(pingPongType(6)).to.equal("ping");
});
it("returns pong for a number that is divisible by 5", function() {
expect(pingPongType(10)).to.equal("pong");
});
it("returns pingpong for a number that is divisible by 3 and 5", function() {
expect(pingPongType(30)).to.equal("pingpong")
});
});
describe('isPingPong', function() {
it("returns pingPongType for a number divisible by 3, 5, or 15", function() {
expect(isPingPong(6)).to.equal("ping");
});
it("returns false for a number not divisible by 3, 5, or 15", function() {
expect(isPingPong(7)).to.equal(false);
});
});
| Remove description for pingPong, leave tests for pingPongType and isPingPong | Remove description for pingPong, leave tests for pingPongType and isPingPong
| JavaScript | mit | kcmdouglas/pingpong,kcmdouglas/pingpong | ---
+++
@@ -1,12 +1,3 @@
-describe('pingPong', function() {
- it("is false for a number that is not divisible by 3 or 5", function() {
- expect(pingPong(7)).to.equal(false);
- });
- it("will run pingPongType if isPingPong is true", function() {
- expect(pingPong(6)).to.equal("ping");
- });
-});
-
describe('pingPongType', function() {
it("returns ping for a number that is divisible by 3", function() {
expect(pingPongType(6)).to.equal("ping");
@@ -21,8 +12,8 @@
describe('isPingPong', function() {
- it("returns true for a number divisible by 3, 5, or 15", function() {
- expect(isPingPong(6)).to.equal(true);
+ it("returns pingPongType for a number divisible by 3, 5, or 15", function() {
+ expect(isPingPong(6)).to.equal("ping");
});
it("returns false for a number not divisible by 3, 5, or 15", function() {
expect(isPingPong(7)).to.equal(false); |
91d8bb02e4216ac90cfe6d2ec98c52785720cc3b | node.js | node.js | /*eslint-env node*/
// Import assert function
global.assert = require("assert");
// Code coverage helper
require("blanket")({
pattern: "src/sinon.js"
});
// 'Simulate' browser environment by creating a window object
global.window = {};
// 'Load' the current sinon file
require("./src/sinon.js");
// Map the sinon object to global in order to make it global
global.sinon = window.sinon;
| /*eslint-env node*/
// Import assert function
global.assert = require("assert");
delete global._$jscoverage; // Purge any previous blanket use
// Code coverage helper
require("blanket")({
pattern: "src/sinon.js"
});
// 'Simulate' browser environment by creating a window object
global.window = {};
// 'Load' the current sinon file
require("./src/sinon.js");
// Map the sinon object to global in order to make it global
global.sinon = window.sinon;
| Clean any previous usage of blanket (because re-run in the same process) | Clean any previous usage of blanket (because re-run in the same process)
| JavaScript | mit | ArnaudBuchholz/training-functions-stub,ArnaudBuchholz/training-functions-stub | ---
+++
@@ -2,6 +2,8 @@
// Import assert function
global.assert = require("assert");
+
+delete global._$jscoverage; // Purge any previous blanket use
// Code coverage helper
require("blanket")({ |
54b272985753eeec263f0efe810197aea8a4106b | alexandria/static/js/controllers/login.js | alexandria/static/js/controllers/login.js | app.controller('LoginCtrl', ['$scope', '$log', '$route', 'User',
function($scope, $log, $route, User) {
$scope.loginForm = {};
$scope.errors = {};
$scope.login = function() {
$log.debug('Setting all the form fields to $dirty...');
angular.forEach($scope.form, function(ctrl, field) {
// Dirty hack because $scope.form contains so much more than just the fields
if (typeof ctrl === 'object' && ctrl.hasOwnProperty('$modelValue')) {
ctrl.$dirty = true;
ctrl.$pristine = false;
}
});
if ($scope.form.$invalid) {
$log.debug('Form is invalid. Not sending request to server.')
return;
}
$log.debug('Attempting to log user in...');
User.login($scope.loginForm.email, $scope.loginForm.password).then(function(data) {
$route.reload();
}).catch(function(data) {
$log.debug('Unable to log user in... %o', data);
$scope.errors = {}
angular.forEach(data.errors, function(error, field) {
$scope.form[field].$setValidity('server', false);
$scope.errors[field] = error;
});
});
};
}
]);
| app.controller('LoginCtrl', ['$scope', '$log', '$route', 'User',
function($scope, $log, $route, User) {
$scope.loginForm = {};
$scope.errors = {};
$scope.login = function() {
$log.debug('Setting all the form fields to $dirty...');
angular.forEach($scope.form, function(ctrl, field) {
// Dirty hack because $scope.form contains so much more than just the fields
if (typeof ctrl === 'object' && ctrl.hasOwnProperty('$modelValue')) {
ctrl.$dirty = true;
ctrl.$pristine = false;
}
});
if ($scope.form.$invalid) {
$log.debug('Form is invalid. Not sending request to server.')
return;
}
$scope.form.submitted = true;
$log.debug('Attempting to log user in...');
User.login($scope.loginForm.email, $scope.loginForm.password).then(function(data) {
$route.reload();
}).catch(function(data) {
$log.debug('Unable to log user in... %o', data);
$scope.errors = {}
angular.forEach(data.errors, function(error, field) {
$scope.form[field].$setValidity('server', false);
$scope.errors[field] = error;
});
});
};
}
]);
| Add a submitted value to the form | Add a submitted value to the form
| JavaScript | isc | cdunklau/alexandria,cdunklau/alexandria,bertjwregeer/alexandria,bertjwregeer/alexandria,cdunklau/alexandria | ---
+++
@@ -19,6 +19,8 @@
return;
}
+ $scope.form.submitted = true;
+
$log.debug('Attempting to log user in...');
User.login($scope.loginForm.email, $scope.loginForm.password).then(function(data) {
$route.reload(); |
e1b5de724f301ae61ef656dbeab783bc2cdf2d54 | api/controllers/GCMController.js | api/controllers/GCMController.js | /**
* GCMKey provider
*
* @description :: Server-side logic for managing users
* @help :: See http://links.sailsjs.org/docs/controllers
*/
module.exports = {
key: function key(req, res) {
sails.log("Google Project Number: " + sails.config.push.gcm.projectNumber);
res.json(sails.config.push.gcm.projectNumber);
}
};
| /**
* GCMKey provider
*
* @description :: Server-side logic for managing users
* @help :: See http://links.sailsjs.org/docs/controllers
*/
module.exports = {
key: function key(req, res) {
sails.log("Google Project Number: " + sails.config.gcm.projectNumber);
res.json(sails.config.gcm.projectNumber);
}
};
| Use correct sails.config for GCM key | Use correct sails.config for GCM key
| JavaScript | mit | SneakSpeak/sp-server | ---
+++
@@ -7,7 +7,7 @@
module.exports = {
key: function key(req, res) {
- sails.log("Google Project Number: " + sails.config.push.gcm.projectNumber);
- res.json(sails.config.push.gcm.projectNumber);
+ sails.log("Google Project Number: " + sails.config.gcm.projectNumber);
+ res.json(sails.config.gcm.projectNumber);
}
}; |
7f71436ba8d4c879a945d4ba7d88a71f2dbe0a43 | apps/crbug/bg.js | apps/crbug/bg.js | var qb;
function launch() {
if ( ! qb ) qb = QBug.create();
qb.launchBrowser();
// qb.launchBrowser('chromium');
}
if ( chrome.app.runtime ) {
ajsonp = (function() {
var factory = OAuthXhrFactory.create({
authAgent: ChromeAuthAgent.create({}),
responseType: "json"
});
return function(url, params, opt_method) {
return function(ret) {
var xhr = factory.make();
return xhr.asend(ret, opt_method ? opt_method : "GET", url + (params ? '?' + params.join('&') : ''));
};
};
})();
chrome.app.runtime.onLaunched.addListener(function(opt_launchData) {
// launchData is provided by the url_handler
if ( opt_launchData ) console.log(opt_launchData.url);
console.log('launched');
launch();
});
}
| var qb;
function launch() {
if ( ! qb ) qb = QBug.create();
qb.launchBrowser();
// qb.launchBrowser('chromium');
}
if ( chrome.app.runtime ) {
ajsonp = (function() {
var factory = OAuthXhrFactory.create({
authAgent: ChromeAuthAgent.create({}),
responseType: "json"
});
return function(url, params, opt_method, opt_payload) {
return function(ret) {
var xhr = factory.make();
xhr.responseType = "json";
return xhr.asend(ret,
opt_method ? opt_method : "GET",
url + (params ? '?' + params.join('&') : ''),
opt_payload);
};
};
})();
chrome.app.runtime.onLaunched.addListener(function(opt_launchData) {
// launchData is provided by the url_handler
if ( opt_launchData ) console.log(opt_launchData.url);
console.log('launched');
launch();
});
}
| Add optional payload to ajsonp | Add optional payload to ajsonp
| JavaScript | apache-2.0 | osric-the-knight/foam,shepheb/foam,jacksonic/foam,shepheb/foam,foam-framework/foam,osric-the-knight/foam,jacksonic/foam,osric-the-knight/foam,foam-framework/foam,mdittmer/foam,mdittmer/foam,mdittmer/foam,shepheb/foam,jlhughes/foam,jlhughes/foam,jlhughes/foam,foam-framework/foam,jacksonic/foam,foam-framework/foam,mdittmer/foam,foam-framework/foam,osric-the-knight/foam,jacksonic/foam,jlhughes/foam | ---
+++
@@ -12,10 +12,14 @@
responseType: "json"
});
- return function(url, params, opt_method) {
+ return function(url, params, opt_method, opt_payload) {
return function(ret) {
var xhr = factory.make();
- return xhr.asend(ret, opt_method ? opt_method : "GET", url + (params ? '?' + params.join('&') : ''));
+ xhr.responseType = "json";
+ return xhr.asend(ret,
+ opt_method ? opt_method : "GET",
+ url + (params ? '?' + params.join('&') : ''),
+ opt_payload);
};
};
})(); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.