commit
stringlengths 40
40
| old_file
stringlengths 4
264
| new_file
stringlengths 4
264
| old_contents
stringlengths 0
3.26k
| new_contents
stringlengths 1
4.43k
| subject
stringlengths 15
624
| message
stringlengths 15
4.7k
| lang
stringclasses 3
values | license
stringclasses 13
values | repos
stringlengths 5
91.5k
|
---|---|---|---|---|---|---|---|---|---|
3a0a5f2f9e2b2ba62da6013ba238c3783039c71c | src/client/actions/StatusActions.js | src/client/actions/StatusActions.js | import Axios from 'axios';
import {
PROVIDER_CHANGE,
FILTER_BOARD, FILTER_THREAD,
SERACH_BOARD, SEARCH_THREAD,
STATUS_UPDATE
} from '../constants';
// TODO: Filter + Search actions
export function changeProvider( provider ) {
return (dispatch, getState) => {
if (shouldChangeProvider(getState(), provider)) {
console.info("Action changeProvider() to " + provider);
dispatch({
type: PROVIDER_CHANGE,
payload: provider
})
}
}
}
function shouldChangeProvider( {status}, provider) {
return status.provider !== provider
}
export function alertMessage( message ) {
console.info(`Action alertMessage(): ${message}`);
console.warn(message);
return {
type: STATUS_UPDATE,
payload: message
}
}
export function clearStatus() {
console.info(`Action clearStatus()`);
return {
type: STATUS_UPDATE,
payload: ""
}
}
| import Axios from 'axios';
import {
PROVIDER_CHANGE,
FILTER_BOARD, FILTER_THREAD,
SERACH_BOARD, SEARCH_THREAD,
ALERT_MESSAGE
} from '../constants';
// TODO: Filter + Search actions
export function changeProvider( provider ) {
return (dispatch, getState) => {
if (shouldChangeProvider(getState(), provider)) {
console.info("Action changeProvider() to " + provider);
dispatch({
type: PROVIDER_CHANGE,
payload: provider
})
}
}
}
function shouldChangeProvider( {status}, provider) {
return status.provider !== provider
}
export function alertMessage( message ) {
console.info(`Action alertMessage(): ${message.message}`);
return {
type: ALERT_MESSAGE,
payload: message
}
}
| Remove clearStatus action; not in use | Remove clearStatus action; not in use
| JavaScript | mit | AdamSalma/Lurka,AdamSalma/Lurka |
5b6f3ac716e37b9d03bff3da826dca24826b24eb | jasmine/spec/inverted-index-test.js | jasmine/spec/inverted-index-test.js | describe ("Read book data",function(){
it("assert JSON file is not empty",function(){
var isNotEmpty = function IsJsonString(filePath) {
try {
JSON.parse(filePath);
} catch (e) {
return false;
}
return true;
};
expect(isNotEmpty).toBe(true).because('The JSON file should be a valid JSON array');
});
});
describe ("Populate Index",function(){
beforeEach(function() {
var myIndexPopulate=JSON.parse(filePath);
var myIndexGet=getIndex(myIndexPopulate);
});
it("index should be created after reading",function(){
expect(myIndexGet).not.toBe(null).because('Index should be created after reading the file');
});
it("index maps string keys to correct obj", function(){
var myFunction= function() {
var testArray=['a','1'];
var a=createIndex(testArray);
var b=getIndex(a);
return b;
}
expect(myFunction).toBe(['a']).because('Index should return corresponding key');
});
});
describe ("Search Index", function(){
beforeEach(function(){
var testArray=["a","b","c"];
var mySearchIndex= searchIndex(testArray);
});
it("searching should returns array of correct indices", function(){
expect(mySearchIndex).toContain("a","b","c");
});
})
| describe("Read book data", function() {
beforeEach(function(){
var file = filePath.files[0];
var reader = new FileReader();
});
it("assert JSON file is not empty",function(){
var fileNotEmpty = JSON.parse(reader.result);
var fileNotEmptyResult = function(fileNotEmpty){
if (fileNotEmpty = null){
return false;
}
else{
return true;
}
};
expect(fileNotEmptyResult).toBe(true);
});
});
describe("Populate Index", function(){
beforeEach(function() {
checkEmpty = new createIndex();
//test using spies to check if methods are exectued
spyOn(checkEmpty, 'push');
});
it('should have called and created this function', function(){
//calling the function to see if the code has been executed
checkempty.push(term);
expect(checkEmpty.push).toHaveBeenCalled();
//because if this method is called the index has been created.
});
it("should map string keys to correct objects", function(){
//calling function to see if it is executed in code
expect(display.innerText).toBe('Index Created');
});
});
| Change the read book test and populate index test | Change the read book test and populate index test
| JavaScript | mit | andela-pbirir/inverted-index,andela-pbirir/inverted-index |
221f6da58e1190b97ab3c6310d3e9b699e512ea0 | ProgressBar.js | ProgressBar.js | var React = require('react-native');
var {
Animated,
Easing,
StyleSheet,
View
} = React;
var styles = StyleSheet.create({
background: {
backgroundColor: '#bbbbbb',
height: 5,
overflow: 'hidden'
},
fill: {
backgroundColor: '#3b5998',
height: 5
}
});
var ProgressBar = React.createClass({
getDefaultProps() {
return {
style: styles,
easing: Easing.inOut(Easing.ease),
easingDuration: 500
};
},
getInitialState() {
return {
progress: new Animated.Value(0)
};
},
componentDidUpdate(prevProps, prevState) {
if (this.props.progress >= 0 && this.props.progress != prevProps.progress) {
this.update();
}
},
render() {
var fillWidth = this.state.progress.interpolate({
inputRange: [0, 1],
outputRange: [0 * this.props.style.width, 1 * this.props.style.width],
});
return (
<View style={[styles.background, this.props.backgroundStyle, this.props.style]}>
<Animated.View style={[styles.fill, this.props.fillStyle, { width: fillWidth }]}/>
</View>
);
},
update() {
Animated.timing(this.state.progress, {
easing: this.props.easing,
duration: this.props.easingDuration,
toValue: this.props.progress
}).start();
}
});
module.exports = ProgressBar;
| var React = require('react-native');
var {
Animated,
Easing,
StyleSheet,
View
} = React;
var styles = StyleSheet.create({
background: {
backgroundColor: '#bbbbbb',
height: 5,
overflow: 'hidden'
},
fill: {
backgroundColor: '#3b5998',
height: 5
}
});
var ProgressBar = React.createClass({
getDefaultProps() {
return {
style: styles,
easing: Easing.inOut(Easing.ease),
easingDuration: 500
};
},
getInitialState() {
return {
progress: new Animated.Value(this.props.initialProgress || 0)
};
},
componentDidUpdate(prevProps, prevState) {
if (this.props.progress >= 0 && this.props.progress != prevProps.progress) {
this.update();
}
},
render() {
var fillWidth = this.state.progress.interpolate({
inputRange: [0, 1],
outputRange: [0 * this.props.style.width, 1 * this.props.style.width],
});
return (
<View style={[styles.background, this.props.backgroundStyle, this.props.style]}>
<Animated.View style={[styles.fill, this.props.fillStyle, { width: fillWidth }]}/>
</View>
);
},
update() {
Animated.timing(this.state.progress, {
easing: this.props.easing,
duration: this.props.easingDuration,
toValue: this.props.progress
}).start();
}
});
module.exports = ProgressBar;
| Add initialProgress property to make start from the given value | Add initialProgress property to make start from the given value
| JavaScript | mit | lwansbrough/react-native-progress-bar |
fab2943412258c0a55c7d127cc67798f30587551 | test/bootstrap.js | test/bootstrap.js | /**
* require dependencies
*/
WebdriverIO = require('webdriverio');
WebdriverCSS = require('../index.js');
fs = require('fs-extra');
gm = require('gm');
glob = require('glob');
async = require('async');
should = require('chai').should();
expect = require('chai').expect;
capabilities = {logLevel: 'silent',desiredCapabilities:{browserName: 'phantomjs'}};
testurl = 'http://localhost:8080/test/site/index.html';
testurlTwo = 'http://localhost:8080/test/site/two.html';
testurlThree = 'http://localhost:8080/test/site/three.html';
testurlFour = 'http://localhost:8080/test/site/four.html';
/**
* set some fix test variables
*/
screenshotRootDefault = 'webdrivercss';
failedComparisonsRootDefault = 'webdrivercss/diff';
screenshotRootCustom = '__screenshotRoot__';
failedComparisonsRootCustom = '__failedComparisonsRoot__';
afterHook = function(done) {
var browser = this.browser;
/**
* close browser and clean up created directories
*/
async.parallel([
function(done) { browser.end(done); },
function(done) { fs.remove(failedComparisonsRootDefault,done); },
function(done) { fs.remove(screenshotRootDefault,done); },
function(done) { fs.remove(failedComparisonsRootCustom,done); },
function(done) { fs.remove(screenshotRootCustom,done); }
], done);
};
| /**
* require dependencies
*/
WebdriverIO = require('webdriverio');
WebdriverCSS = require('../index.js');
fs = require('fs-extra');
gm = require('gm');
glob = require('glob');
async = require('async');
should = require('chai').should();
expect = require('chai').expect;
capabilities = {logLevel: 'silent',desiredCapabilities:{browserName: 'phantomjs'}};
testurl = 'http://localhost:8080/test/site/index.html';
testurlTwo = 'http://localhost:8080/test/site/two.html';
testurlThree = 'http://localhost:8080/test/site/three.html';
testurlFour = 'http://localhost:8080/test/site/four.html';
/**
* set some fix test variables
*/
screenshotRootDefault = 'webdrivercss';
failedComparisonsRootDefault = 'webdrivercss/diff';
screenshotRootCustom = '__screenshotRoot__';
failedComparisonsRootCustom = '__failedComparisonsRoot__';
afterHook = function(done) {
var browser = this.browser;
/**
* close browser and clean up created directories
*/
async.parallel([
function(done) { browser.end(done); },
// function(done) { fs.remove(failedComparisonsRootDefault,done); },
// function(done) { fs.remove(screenshotRootDefault,done); },
// function(done) { fs.remove(failedComparisonsRootCustom,done); },
// function(done) { fs.remove(screenshotRootCustom,done); }
], done);
};
| Disable test cleanup for debugging | Disable test cleanup for debugging
| JavaScript | mit | JustinTulloss/webdrivercss,JustinTulloss/webdrivercss |
86d8c0168182a23b75bdd62135231b9292b881af | test/plugin.spec.js | test/plugin.spec.js | import BabelRootImportPlugin from '../plugin';
import * as babel from 'babel-core';
describe('Babel Root Import - Plugin', () => {
describe('Babel Plugin', () => {
it('transforms the relative path into an absolute path', () => {
const targetRequire = `${process.cwd()}/some/example.js`;
const transformedCode = babel.transform("import SomeExample from '~/some/example.js';", {
plugins: [BabelRootImportPlugin]
});
expect(transformedCode.code).to.contain(targetRequire);
});
});
});
| import BabelRootImportPlugin from '../plugin';
import * as babel from 'babel-core';
describe('Babel Root Import - Plugin', () => {
describe('Babel Plugin', () => {
it('transforms the relative path into an absolute path', () => {
const targetRequire = `${process.cwd()}/some/example.js`;
const transformedCode = babel.transform("import SomeExample from '~/some/example.js';", {
plugins: [BabelRootImportPlugin]
});
expect(transformedCode.code).to.contain(targetRequire);
});
it('transforms the relative path into an absolute path with the configured root-path', () => {
const targetRequire = `some/custom/root/some/example.js`;
const transformedCode = babel.transform("import SomeExample from '~/some/example.js';", {
plugins: [[
BabelRootImportPlugin, {
rootPathSuffix: 'some/custom/root'
}
]]
});
expect(transformedCode.code).to.contain(targetRequire);
});
});
});
| Add test for custom root (setted by babelrc) | Add test for custom root (setted by babelrc)
| JavaScript | mit | michaelzoidl/babel-root-import,Quadric/babel-plugin-inline-import |
fdd9ce07ece40caee51c093254ec232348ef2908 | api/models/User.js | api/models/User.js | /**
* User
*
* @module :: Model
* @description :: A short summary of how this model works and what it represents.
* @docs :: http://sailsjs.org/#!documentation/models
*/
module.exports = {
attributes: {
email: 'STRING',
name: 'STRING'
/* e.g.
nickname: 'string'
*/
}
};
| /**
* User
*
* @module :: Model
* @description :: A short summary of how this model works and what it represents.
* @docs :: http://sailsjs.org/#!documentation/models
*/
module.exports = {
attributes: {
email: {
type: 'email',
required: true
}
name: 'STRING'
/* e.g.
nickname: 'string'
*/
}
};
| Add some validation to my model | Add some validation to my model
| JavaScript | mit | thomaslangston/sailsnode |
1a4c8c303dcfa0e9a49ff554ba540da638a8a6ab | app/controllers/index.js | app/controllers/index.js | /**
* Global Navigation Handler
*/
Alloy.Globals.Navigator = {
/**
* Handle to the Navigation Controller
*/
navGroup: $.nav,
open: function(controller, payload){
var win = Alloy.createController(controller, payload || {}).getView();
if(OS_IOS){
$.nav.openWindow(win);
}
else if(OS_MOBILEWEB){
$.nav.open(win);
}
else {
// added this property to the payload to know if the window is a child
if (payload.displayHomeAsUp){
win.addEventListener('open',function(evt){
var activity=win.activity;
activity.actionBar.displayHomeAsUp=payload.displayHomeAsUp;
activity.actionBar.onHomeIconItemSelected=function(){
evt.source.close();
};
});
}
win.open();
}
}
};
/**
* Lets add a loading animation - Just for Fun!
*/
var loadingView = Alloy.createController("form");
loadingView.getView().open(); | /**
* Global Navigation Handler
*/
Alloy.Globals.Navigator = {
/**
* Handle to the Navigation Controller
*/
navGroup: $.nav,
open: function(controller, payload){
var win = Alloy.createController(controller, payload || {}).getView();
if(OS_IOS){
$.nav.openWindow(win);
}
else if(OS_MOBILEWEB){
$.nav.open(win);
}
else {
// added this property to the payload to know if the window is a child
if (payload.displayHomeAsUp){
win.addEventListener('open',function(evt){
var activity=win.activity;
activity.actionBar.displayHomeAsUp=payload.displayHomeAsUp;
activity.actionBar.onHomeIconItemSelected=function(){
evt.source.close();
};
});
}
win.open();
}
}
};
if(OS_IOS){
$.nav.open()
}
else if(OS_MOBILEWEB){
$.index.open();
}
else{
$.index.getView().open();
} | Fix para iphone al abrir controlador | Fix para iphone al abrir controlador
Al abrir el controlador de forms no se veia el window title
| JavaScript | apache-2.0 | egregori/HADA,egregori/HADA |
2861764dfaff112ccea7a574ccf75710528b1b9f | lib/transitions/parseTransitions.js | lib/transitions/parseTransitions.js | var getInterpolation = require('interpolation-builder');
var createTransitions = require('./createTransitions');
module.exports = function(driver, states, transitions) {
// go through each transition and setup kimi with a function that works
// with values between 0 and 1
transitions.forEach( function(transition, i) {
var from = transition.from || throwError('from', i, transition);
var to = transition.to || throwError('to', i, transition);
var animation = transition.animation || {};
var animationDefinition = createTransitions(animation, states[ from ], states[ to ]);
// else build the the transition
if(typeof animation == 'object') {
// this
animation = getInterpolation(
animationDefinition.transitions
);
}
// animation will either be a function passed in or generated from an object definition
driver.fromTo(from, to, animationDefinition.duration, animation);
});
};
function throwError(type, idx, transition) {
throw new Error(
'For the transition at ' + idx + ':\n' +
JSON.stringify(transition, unanimationined, ' ') + '\n' +
'you did not animationine ' + type + '\n\n'
);
} | var getInterpolation = require('interpolation-builder');
var createTransitions = require('./createTransitions');
module.exports = function(driver, states, transitions) {
// go through each transition and setup kimi with a function that works
// with values between 0 and 1
transitions.forEach( function(transition, i) {
var from = transition.from || throwError('from', i, transition);
var to = transition.to || throwError('to', i, transition);
var animation = transition.animation;
var duration;
var animationDefinition;
// if animation is an object then it's a Tween like definition
// otherwise we'll assume that animation is a function and we can simply
// pass that to the driver
if(typeof animation == 'object') {
animationDefinition = createTransitions(animation, states[ from ], states[ to ]);
// this
animation = getInterpolation(
animationDefinition.transitions
);
duration = animationDefinition.duration;
} else {
duration = animation.duration;
}
// animation will either be a function passed in or generated from an object definition
driver.fromTo(from, to, duration, animation);
});
};
function throwError(type, idx, transition) {
throw new Error(
'For the transition at ' + idx + ':\n' +
JSON.stringify(transition, unanimationined, ' ') + '\n' +
'you did not animationine ' + type + '\n\n'
);
} | Put back in handling for animation being a function for transition definitions | Put back in handling for animation being a function for transition definitions
| JavaScript | mit | Jam3/f1 |
9a5cdc88c83364d9ca91be189b9b36828b35ede2 | steam_user_review_filter.user.js | steam_user_review_filter.user.js | // ==UserScript==
// @name Steam Review filter
// @namespace https://github.com/somoso/steam_user_review_filter/raw/master/steam_user_review_filter.user.js
// @version 0.31
// @description try to filter out the crap on steam
// @author You
// @match http://store.steampowered.com/app/*
// @grant none
// @require http://code.jquery.com/jquery-latest.js
// ==/UserScript==
/* jshint -W097 */
'use strict';
var searchStr = ".review_box";
console.log("Starting steam user review filter");
var reviews = $(searchStr);
for (i = 0; i < reviews.length; i++) {
if ($(reviews[i]).hasClass('partial')) {
continue;
}
var urgh = reviews[i].innerText;
if (urgh.includes('10/10')) {
$(reviews[i]).remove();
} else if (urgh.match(/\bign\b/i)) {
$(reviews[i]).remove();
}
}
console.log("Ending steam user review filter");
| // ==UserScript==
// @name Steam Review filter
// @namespace https://github.com/somoso/steam_user_review_filter/raw/master/steam_user_review_filter.user.js
// @version 0.31
// @description try to filter out the crap on steam
// @author You
// @match http://store.steampowered.com/app/*
// @grant none
// @require http://code.jquery.com/jquery-latest.js
// ==/UserScript==
/* jshint -W097 */
'use strict';
var searchStr = ".review_box";
console.log("Starting steam user review filter");
var reviews = $(searchStr);
for (i = 0; i < reviews.length; i++) {
if ($(reviews[i]).hasClass('partial')) {
continue;
}
var filterReview = false;
var urgh = reviews[i].innerText;
if (urgh.includes('10/10')) {
filterReview = true;
} else if (urgh.match(/\bign\b/i)) {
filterReview = true;
} else if (urgh.match(/\bbest ([A-Za-z0-9_-]+ ){1,3}ever( made)?\b/i)) {
filterReview = true;
}
if (filterReview) {
$(reviews[i]).remove();
}
})
}
console.log("Ending steam user review filter");
| Add filtering for "Best BLAHBLAHBLAH ever made" | Add filtering for "Best BLAHBLAHBLAH ever made" | JavaScript | unlicense | somoso/steam_user_review_filter,somoso/steam_user_review_filter |
94701f09422ed9536463afc7dc2e48463af2301e | app/config/config.js | app/config/config.js | const dotenv = require('dotenv');
dotenv.config({silent: true});
const config = {
"development": {
"username": process.env.DB_DEV_USER,
"password": process.env.DB_DEV_PASS,
"database": process.env.DB_DEV_NAME,
"host": process.env.DB_DEV_HOST,
"secrete": process.env.AUTH_SECRETE,
"dialect": "postgres"
},
"test": {
"username": process.env.DB_TEST_USER,
"password": process.env.DB_TEST_PASS,
"database": process.env.DB_TEST_NAME,
"host": process.env.DB_TEST_HOST,
"secrete": process.env.AUTH_SECRETE,
"dialect": "postgres",
"logging": false
},
"production": {
"username": process.env.DB_USER,
"password": process.env.DB_PASS,
"database": process.env.DB_NAME,
"host": process.env.DB_HOST,
"secrete": process.env.AUTH_SECRETE,
"dialect": "postgres",
"logging": false
}
};
if(process.env.NODE_ENV === 'production'){
module.exports = config.production;
}else if(process.env.NODE_ENV === 'test'){
module.exports = config.test;
}else{
module.exports = config.development;
} | const dotenv = require('dotenv');
dotenv.config({silent: true});
const config = {
"development": {
"username": process.env.DB_DEV_USER,
"password": process.env.DB_DEV_PASS,
"database": process.env.DB_DEV_NAME,
"host": process.env.DB_DEV_HOST,
"secrete": process.env.AUTH_SECRETE,
"dialect": "postgres"
},
"test": {
"username": process.env.DB_TEST_USER,
"password": process.env.DB_TEST_PASS,
"database": process.env.DB_TEST_NAME,
"host": process.env.DB_TEST_HOST,
"secrete": process.env.AUTH_SECRETE,
"dialect": "postgres",
},
"production": {
"username": process.env.DB_USER,
"password": process.env.DB_PASS,
"database": process.env.DB_NAME,
"host": process.env.DB_HOST,
"secrete": process.env.AUTH_SECRETE,
"dialect": "postgres",
"logging": false
}
};
if(process.env.NODE_ENV === 'production'){
module.exports = config.production;
}else if(process.env.NODE_ENV === 'test'){
module.exports = config.test;
}else{
module.exports = config.development;
} | Enable logging for test environment | Enable logging for test environment
| JavaScript | mit | cyrielo/document-manager |
7f45b377171d4cffb3f83602b4a6f4025a58ac11 | app/settings/settings.js | app/settings/settings.js | const mapbox_token = 'pk.eyJ1IjoiaG90IiwiYSI6ImNpbmx4bWN6ajAwYTd3OW0ycjh3bTZvc3QifQ.KtikS4sFO95Jm8nyiOR4gQ'
export default {
'vt-source': 'http://osm-analytics.vizzuality.com', // source of current vector tiles
'vt-hist-source': 'http://osm-analytics.vizzuality.com', // source of historic vector tiles for compare feature
'map-background-tile-layer': 'https://api.mapbox.com/v4/mapbox.light/{z}/{x}/{y}.png?access_token=' + mapbox_token,
'map-attribution': '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap contributors</a>',
}
| const mapbox_token = 'pk.eyJ1IjoiaG90IiwiYSI6ImNpbmx4bWN6ajAwYTd3OW0ycjh3bTZvc3QifQ.KtikS4sFO95Jm8nyiOR4gQ'
export default {
'vt-source': 'https://osm-analytics.vizzuality.com', // source of current vector tiles
'vt-hist-source': 'https://osm-analytics.vizzuality.com', // source of historic vector tiles for compare feature
'map-background-tile-layer': 'https://api.mapbox.com/v4/mapbox.light/{z}/{x}/{y}.png?access_token=' + mapbox_token,
'map-attribution': '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap contributors</a>',
}
| Revert "https doesn't work at the moment for osma tiles served from vizzuality" | Revert "https doesn't work at the moment for osma tiles served from vizzuality"
This reverts commit 96c3024ca822cbe801a6c2af43eae5b12c3fa9a4.
| JavaScript | bsd-3-clause | hotosm/osm-analytics,hotosm/osm-analytics,hotosm/osm-analytics |
591b86fc35858a16337b6fcd75c9575770eaa68a | static/js/front.js | static/js/front.js | var getThat = {};
getThat.controller = function() {
};
getThat.header = function() {
return m('.row', [
m('.col-md-10', [
m('.jumbotron', [
m('h1', [
m('a[href="//getthat.email"]', 'Get That Email')
])
])
])
]);
};
getThat.input = function() {
return m('.row', [
m('.col-md-10', [
m('.input-group', [
m('input.form-control[type="text"'),
m('.input-group-btn', [
m('button.btn.btn-success[type="button"', [
m('span.glyphicon.glyphicon-credit-card'),
' Get It!'
])
])
])
])
]);
};
getThat.view = function() {
return m('.container', [
this.header(),
this.input()
]);
};
//initialize
m.module(document.body, getThat);
| var getThat = {};
getThat.controller = function() {
};
getThat.header = function() {
return m('.row', [
m('.col-md-10', [
m('.jumbotron', [
m('h1', [
m('a[href="//getthat.email"]', 'Get That Email')
])
])
])
]);
};
getThat.emailSelectBtn = function() {
return m('button.btn.btn-default.dropdown-toggle[type="button"][data-toggle="dropdown"]', [
'Select a Domain ',
m('span.caret'),
]);
};
getThat.emailSelectDropdown = function() {
return m('ul.dropdown-menu[role="menu"]', [
m('li', [
m('a[href="#"]', 'Test')
])
]);
};
getThat.input = function() {
return m('.row', [
m('.col-md-10', [
m('.input-group', [
m('input.form-control[type="text"'),
m('.input-group-btn', [
this.emailSelectBtn(),
this.emailSelectDropdown(),
m('button.btn.btn-success[type="button"]', [
m('span.glyphicon.glyphicon-credit-card'),
' Get It!'
])
])
])
])
]);
};
getThat.view = function() {
return m('.container', [
this.header(),
this.input()
]);
};
//initialize
m.module(document.body, getThat);
| Update the email selection UI | Update the email selection UI
| JavaScript | mit | chrisseto/dinosaurs.sexy,chrisseto/dinosaurs.sexy |
8ac385bc002cf517f0542d71ffdbc5c73bc6a9c5 | app/test/client.js | app/test/client.js | window.requirejs = window.yaajs;
window.history.replaceState(null, document.title = 'Piki Test Mode', '/');
define(function(require, exports, module) {
var koru = require('koru/main-client');
require('koru/session/main-client');
require('koru/test/client');
koru.onunload(module, 'reload');
require(['koru/session'], function (session) {
session.connect();
});
});
| window.requirejs = window.yaajs;
window.history.replaceState(null, document.title = 'Piki Test Mode', '/');
define(function(require, exports, module) {
var koru = require('koru/main-client');
require('koru/test/client');
koru.onunload(module, 'reload');
});
| Fix test starting two connections to server | Fix test starting two connections to server
| JavaScript | agpl-3.0 | jacott/piki-scoreboard,jacott/piki-scoreboard,jacott/piki-scoreboard |
dc3c20f6dbfddb315932a49d6f7a54e5d8b1043d | app/assets/javascripts/accordion.js | app/assets/javascripts/accordion.js | $(function() {
$('.accordion_head').each( function() {
$(this).after('<ul style="display: none;"></ul>');
});
$(document).on("click", '.accordion_head', function() {
var ul = $(this).next();
if (ul.text() == '') {
term = $(this).data('term');
$.getJSON("/children_graph?term=" + term, function(data) {
$.each(data, function(i,item) {
ul.append('<li><div class="accordion_head" data-term="' + item.path + '"><a href="' + item.uri + '" >' + item.basename+ "</a></div><ul style='dispaly: none;'><ul></li>");
});
});
ul.slideToggle();
} else {
ul.slideToggle();
}
}).next().hide();
});
| $(function() {
$('.accordion_head').each( function() {
$(this).after('<ul style="display: none;"></ul>');
});
$(document).on("click", '.accordion_head', function() {
var ul = $(this).next();
if (ul.text() == '') {
term = $(this).data('term');
$.getJSON("/children_graph?term=" + term)
.done(function(data) {
$.each(data, function(i,item) {
ul.append('<li><div class="accordion_head" data-term="' + item.path + '"><a href="' + item.uri + '" >' + item.basename+ '</a></div><ul style="display: none;"></ul></li>');
});
ul.hide().slideToggle();
});
} else {
ul.slideToggle();
}
}).next().hide();
});
| Use `done` callback for smooth animation | Use `done` callback for smooth animation
| JavaScript | mit | yohoushi/yohoushi,yohoushi/yohoushi,yohoushi/yohoushi |
7421477c92380fa88a3910e4707046ce9daf5a71 | tests/acceptance/sidebar_test.js | tests/acceptance/sidebar_test.js | var App;
module("Acceptances - Index", {
setup: function(){
var sampleDataUrl = '';
if (typeof __karma__ !== 'undefined')
sampleDataUrl = '/base';
sampleDataUrl = sampleDataUrl + '/tests/support/api.json';
App = startApp({apiDataUrl: sampleDataUrl});
},
teardown: function() {
Ember.run(App, 'destroy');
}
});
test("sidebar renders list of modules/classes", function(){
expect(2);
visit('/').then(function(){
debugger;
ok(exists("a:contains('Ember.Application')"));
ok(exists("a:contains('Ember.run')"));
});
});
| var App;
module("Acceptances - Sidebar", {
setup: function(){
var sampleDataUrl = '';
if (typeof __karma__ !== 'undefined')
sampleDataUrl = '/base';
sampleDataUrl = sampleDataUrl + '/tests/support/api.json';
App = startApp({apiDataUrl: sampleDataUrl});
},
teardown: function() {
Ember.run(App, 'destroy');
}
});
test("sidebar renders list of modules/classes", function(){
expect(2);
visit('/').then(function(){
debugger;
ok(exists("a:contains('Ember.Application')"));
ok(exists("a:contains('Ember.run')"));
});
});
| Fix name of sidebar acceptance test. | Fix name of sidebar acceptance test.
[ci skip]
| JavaScript | mit | rwjblue/ember-live-api |
fb9d61439a75481c1f1d9349f6f0cda2eaf02d6c | collections/server/collections.js | collections/server/collections.js | Letterpress.Collections.Pages = new Mongo.Collection('pages');
Letterpress.Collections.Pages.before.insert(function (userId, doc) {
doc.path = doc.path || doc.title.replace(/ /g, '-').toLowerCase();
if (doc.path[0] !== '/') {
doc.path = '/' + doc.path;
}
});
Meteor.publish("pages", function () {
return Letterpress.Collections.Pages.find();
});
Letterpress.Collections.Audit = new Mongo.Collection('audit'); | Letterpress.Collections.Pages = new Mongo.Collection('pages');
Letterpress.Collections.Pages.before.insert(function (userId, doc) {
doc.path = doc.path || doc.title.replace(/ /g, '-').toLowerCase();
if (doc.path[0] !== '/') {
doc.path = '/' + doc.path;
}
});
Meteor.publish("pages", function () {
var fields = {title: 1, path: 1, template: 1, content: 1};
if (this.userId)
fields.premiumContent = 1;
return Letterpress.Collections.Pages.find({}, {fields: fields});
});
Letterpress.Collections.Audit = new Mongo.Collection('audit');
| Add a publication restriction to not share premium content unless the user is signed in. | Add a publication restriction to not share premium content unless the user is signed in.
| JavaScript | mit | liangsun/Letterpress,dandv/Letterpress,shrop/Letterpress,FleetingClouds/Letterpress,chrisdamba/Letterpress,chrisdamba/Letterpress,cp612sh/Letterpress,nhantamdo/Letterpress,nhantamdo/Letterpress,shrop/Letterpress,xolvio/Letterpress,chrisdamba/Letterpress,cp612sh/Letterpress,dandv/Letterpress,dandv/Letterpress,FleetingClouds/Letterpress,FleetingClouds/Letterpress,cp612sh/Letterpress,shrop/Letterpress,nhantamdo/Letterpress,xolvio/Letterpress,liangsun/Letterpress,xolvio/Letterpress,liangsun/Letterpress |
89dd2ec4add8840e5e8cda0e37a0162d66ec560b | src/loadNode.js | src/loadNode.js | var context = require('vm').createContext({
options: {
server: true,
version: 'dev'
},
Canvas: require('canvas'),
console: console,
require: require,
include: function(uri) {
var source = require('fs').readFileSync(__dirname + '/' + uri);
// For relative includes, we save the current directory and then add
// the uri directory to __dirname:
var oldDirname = __dirname;
__dirname = __dirname + '/' + uri.replace(/[^/]+$/, '');
require('vm').runInContext(source, context, uri);
__dirname = oldDirname;
}
});
context.include('paper.js');
context.Base.each(context, function(val, key) {
if (val && val.prototype instanceof context.Base) {
val._name = key;
// Export all classes through PaperScope:
context.PaperScope.prototype[key] = val;
}
});
context.PaperScope.prototype['Canvas'] = context.Canvas;
module.exports = new context.PaperScope(); | var fs = require('fs'),
vm = require('vm'),
path = require('path');
// Create the context within which we will run the source files:
var context = vm.createContext({
options: {
server: true,
version: 'dev'
},
// Node Canvas library: https://github.com/learnboost/node-canvas
Canvas: require('canvas'),
// Copy over global variables:
console: console,
require: require,
__dirname: __dirname,
__filename: __filename,
// Used to load and run source files within the same context:
include: function(uri) {
var source = fs.readFileSync(path.resolve(__dirname, uri), 'utf8');
// For relative includes, we save the current directory and then
// add the uri directory to __dirname:
var oldDirname = __dirname;
__dirname = path.resolve(__dirname, path.dirname(uri));
vm.runInContext(source, context, uri);
__dirname = oldDirname;
}
});
context.include('paper.js');
context.Base.each(context, function(val, key) {
if (val && val.prototype instanceof context.Base) {
val._name = key;
// Export all classes through PaperScope:
context.PaperScope.prototype[key] = val;
}
});
context.PaperScope.prototype['Canvas'] = context.Canvas;
require.extensions['.pjs'] = function(module, uri) {
var source = context.PaperScript.compile(fs.readFileSync(uri, 'utf8'));
var envVars = 'var __dirname = \'' + path.dirname(uri) + '\';' +
'var __filename = \'' + uri + '\';';
vm.runInContext(envVars, context);
var scope = new context.PaperScope();
context.PaperScript.evaluate(source, scope);
module.exports = scope;
};
module.exports = new context.PaperScope(); | Support running of PaperScript .pjs files. | Support running of PaperScript .pjs files.
| JavaScript | mit | NHQ/paper,NHQ/paper |
7a5dffb138349c3e6b2a1503fc6a6c82877c0bdc | lib/tab-stop-list.js | lib/tab-stop-list.js | /** @babel */
import TabStop from './tab-stop';
class TabStopList {
constructor (snippet) {
this.snippet = snippet;
this.list = {};
}
get length () {
return Object.keys(this.list).length;
}
findOrCreate({ index, snippet }) {
if (!this.list[index]) {
this.list[index] = new TabStop({ index, snippet });
}
return this.list[index];
}
forEachIndex (iterator) {
let indices = Object.keys(this.list).sort((a1, a2) => a1 - a2);
indices.forEach(iterator);
}
getInsertions () {
let results = [];
this.forEachIndex(index => {
results.push(...this.list[index].insertions);
});
return results;
}
toArray () {
let results = [];
this.forEachIndex(index => {
let tabStop = this.list[index];
if (!tabStop.isValid()) return;
results.push(tabStop);
});
return results;
}
}
export default TabStopList;
| const TabStop = require('./tab-stop')
class TabStopList {
constructor (snippet) {
this.snippet = snippet
this.list = {}
}
get length () {
return Object.keys(this.list).length
}
findOrCreate ({ index, snippet }) {
if (!this.list[index]) {
this.list[index] = new TabStop({ index, snippet })
}
return this.list[index]
}
forEachIndex (iterator) {
let indices = Object.keys(this.list).sort((a1, a2) => a1 - a2)
indices.forEach(iterator)
}
getInsertions () {
let results = []
this.forEachIndex(index => {
results.push(...this.list[index].insertions)
})
return results
}
toArray () {
let results = []
this.forEachIndex(index => {
let tabStop = this.list[index]
if (!tabStop.isValid()) return
results.push(tabStop)
})
return results
}
}
module.exports = TabStopList
| Remove Babel dependency and convert to standard code style | Remove Babel dependency and convert to standard code style
| JavaScript | mit | atom/snippets |
08f1f9d972bdd71891e7e24a529c44fae1bfa687 | lib/util/getRoles.js | lib/util/getRoles.js | // Dependencies
var request = require('request');
//Define
module.exports = function(group, rank, callbacks) {
request.get('http://www.roblox.com/api/groups/' + group + '/RoleSets/', function(err, res, body) {
if (callbacks.always)
callbacks.always();
if (err) {
if (callbacks.failure)
callbacks.failure(err);
if (callbacks.always)
callbacks.always();
return console.error('GetRoles request failed:' + err);
}
var response = JSON.parse(body);
if (rank) {
for (var i = 0; i < body.length; i++) {
if (response[i].Rank == rank) {
response = response[i].ID;
break;
}
}
}
if (callbacks.success)
callbacks.success(response);
return response;
});
};
| // Dependencies
var request = require('request');
// Define
module.exports = function(group, callbacks) {
request.get('http://www.roblox.com/api/groups/' + group + '/RoleSets/', function(err, res, body) {
if (callbacks.always)
callbacks.always();
if (err) {
if (callbacks.failure)
callbacks.failure(err);
if (callbacks.always)
callbacks.always();
return console.error('GetRoles request failed:' + err);
}
if (callbacks.success)
callbacks.success(JSON.parse(body));
});
};
| Move getRole to separate file | Move getRole to separate file
Work better with cache
| JavaScript | mit | FroastJ/roblox-js,OnlyTwentyCharacters/roblox-js,sentanos/roblox-js |
cf765d21e235c686ef2546cf24e5399ea6e348c2 | lib/reddit/base.js | lib/reddit/base.js | var Snoocore = require('snoocore');
var pkg = require('../../package.json');
var uaString = "QIKlaxonBot/" + pkg.version + ' (by /u/StuartPBentley)';
module.exports = function(cfg, duration, scopes){
return new Snoocore({
userAgent: uaString,
decodeHtmlEntities: true,
oauth: {
type: 'explicit',
duration: duration,
consumerKey: cfg.appId,
consumerSecret: cfg.secret,
redirectUri: 'https://qiklaxonbot.redditbots.com/auth/reddit',
scope: scopes
}
});
};
| var Snoocore = require('snoocore');
var pkg = require('../../package.json');
var uaString = "QIKlaxonBot/" + pkg.version + ' (by /u/StuartPBentley)';
module.exports = function(cfg, duration, scopes){
return new Snoocore({
userAgent: uaString,
decodeHtmlEntities: true,
oauth: {
type: 'explicit',
duration: duration,
consumerKey: cfg.appId,
consumerSecret: cfg.secret,
redirectUri: 'https://' +
(cfg.domain || 'qiklaxonbot.redditbots.com') +
'/auth/reddit',
scope: scopes
}
});
};
| Add support for non-default domains | Add support for non-default domains
| JavaScript | mit | stuartpb/QIKlaxonBot,stuartpb/QIKlaxonBot |
97fdbebde2c762d0f3ce1ab0a8529000a71dd92f | template.js | template.js | (function (<bridge>) {
// unsafeWindow
with ({ unsafeWindow: window, document: window.document, location: window.location, window: undefined }) {
// define GM functions
var GM_log = function (s) {
unsafeWindow.console.log('GM_log: ' + s);
return <bridge>.gmLog_(s);
};
var GM_getValue = function (k, d) {
return <bridge>.gmValueForKey_defaultValue_scriptName_namespace_(k, d, "<name>", "<namespace>");
};
var GM_setValue = function (k, v) {
return <bridge>.gmSetValue_forKey_scriptName_namespace_(v, k, "<name>", "<namespace>");
};
/* Not implemented yet
var GM_registerMenuCommand = function (t, c) {
<bridge>.gmRegisterMenuCommand_callback_(t, c);
}
*/
var GM_xmlhttpRequest = function (d) {
return <bridge>.gmXmlhttpRequest_(d);
};
<body>;
}
});
| (function (<bridge>) {
with ({ document: window.document, location: window.location, }) {
// define GM functions
var GM_log = function (s) {
window.console.log('GM_log: ' + s);
return <bridge>.gmLog_(s);
};
var GM_getValue = function (k, d) {
return <bridge>.gmValueForKey_defaultValue_scriptName_namespace_(k, d, "<name>", "<namespace>");
};
var GM_setValue = function (k, v) {
return <bridge>.gmSetValue_forKey_scriptName_namespace_(v, k, "<name>", "<namespace>");
};
/* Not implemented yet
var GM_registerMenuCommand = function (t, c) {
<bridge>.gmRegisterMenuCommand_callback_(t, c);
}
*/
var GM_xmlhttpRequest = function (d) {
return <bridge>.gmXmlhttpRequest_(d);
};
<body>;
}
});
| Remove fake-unsafeWindow because it's too buggy. | Remove fake-unsafeWindow because it's too buggy.
| JavaScript | mit | sohocoke/greasekit,tbodt/greasekit,kzys/greasekit,chrismessina/greasekit |
b57115294999bc2292ccee19c948bbf555fd6077 | tests/helpers/start-app.js | tests/helpers/start-app.js | import { merge } from '@ember/polyfills';
import { run } from '@ember/runloop'
import Application from '../../app';
import config from '../../config/environment';
export default function startApp(attrs) {
let application;
let attributes = merge({}, config.APP);
attributes = merge(attributes, attrs); // use defaults, but you can override;
run(() => {
application = Application.create(attributes);
application.setupForTesting();
application.injectTestHelpers();
});
return application;
}
| import { assign } from '@ember/polyfills';
import { run } from '@ember/runloop'
import Application from '../../app';
import config from '../../config/environment';
export default function startApp(attrs) {
let application;
let attributes = assign({}, config.APP);
attributes = assign(attributes, attrs); // use defaults, but you can override;
run(() => {
application = Application.create(attributes);
application.setupForTesting();
application.injectTestHelpers();
});
return application;
}
| Update test helper due to deprecated function | Update test helper due to deprecated function
| JavaScript | apache-2.0 | ExplorViz/explorviz-ui-frontend,ExplorViz/explorviz-ui-frontend,ExplorViz/explorviz-ui-frontend |
61a0a3c5b600bc3b52d006aba46a4d144d4ab0dd | collections/List.js | collections/List.js | List = new Meteor.Collection( 'List' );
List.allow({
insert: (userId, document) => true,
update: (userId, document) => document.owner_id === Meteor.userId(),
remove: (userId, document) => false
});
List.deny({
insert: (userId, document) => false,
update: (userId, document) => false,
remove: (userId, document) => false
});
List.schema = new SimpleSchema({
title: {
type: String,
label: 'Title',
optional: false,
min: 5,
},
description: {
type: String,
label: 'Details',
optional: true,
max: 1000,
autoform: {
type: 'markdown',
rows: 10,
}
},
owner_id: {
type: String,
optional: true,
autoform: {
omit: true,
}
},
date_created: {
type: Date,
optional: true,
autoValue: function() {
if (this.isInsert) {
return new Date();
} else if (this.isUpsert) {
return {$setOnInsert: new Date()};
} else {
this.unset(); // Prevent user from supplying their own value
}
},
autoform: {
omit: true,
}
}
});
List.attachSchema( List.schema );
| List = new Meteor.Collection( 'List' );
List.allow({
insert: (userId, document) => true,
update: (userId, document) => document.owner_id === Meteor.userId(),
remove: (userId, document) => false
});
List.deny({
insert: (userId, document) => false,
update: (userId, document) => false,
remove: (userId, document) => false
});
List.schema = new SimpleSchema({
title: {
type: String,
label: 'Title',
optional: false,
min: 5,
},
description: {
type: String,
label: 'Details',
optional: true,
max: 1000,
autoform: {
type: 'markdown',
rows: 10,
}
},
owner_id: {
type: String,
optional: true,
autoValue: function() {
const userId = Meteor.userId() || '';
if (this.isInsert) {
return userId;
} else if (this.isUpsert) {
return {$setOnInsert: userId};
} else {
this.unset(); // Prevent user from supplying their own value
}
},
autoform: {
omit: true,
}
},
date_created: {
type: Date,
optional: true,
autoValue: function() {
if (this.isInsert) {
return new Date();
} else if (this.isUpsert) {
return {$setOnInsert: new Date()};
} else {
this.unset(); // Prevent user from supplying their own value
}
},
autoform: {
omit: true,
}
}
});
List.attachSchema( List.schema );
| Set owner_id on new post. | Set owner_id on new post.
| JavaScript | mit | lnwKodeDotCom/WeCode,lnwKodeDotCom/WeCode |
f9221c7e28915de2fd3f253c78c1f7f24e960937 | shared/common-adapters/avatar.desktop.js | shared/common-adapters/avatar.desktop.js | // @flow
import React, {Component} from 'react'
import resolveRoot from '../../desktop/resolve-root'
import type {Props} from './avatar'
const noAvatar = `file:///${resolveRoot('shared/images/no-avatar@2x.png')}`
export default class Avatar extends Component {
props: Props;
render () {
return (
<img
style={{width: this.props.size, height: this.props.size, borderRadius: this.props.size / 2, ...this.props.style}}
src={this.props.url}
onError={event => (event.target.src = noAvatar)}/>)
}
}
Avatar.propTypes = {
size: React.PropTypes.number.isRequired,
url: React.PropTypes.string,
style: React.PropTypes.object
}
| // @flow
import React, {Component} from 'react'
import resolveRoot from '../../desktop/resolve-root'
import type {Props} from './avatar'
const noAvatar = `file:///${resolveRoot('shared/images/icons/placeholder-avatar@2x.png')}`
export default class Avatar extends Component {
props: Props;
render () {
return (
<img
style={{width: this.props.size, height: this.props.size, borderRadius: this.props.size / 2, ...this.props.style}}
src={this.props.url}
onError={event => (event.target.src = noAvatar)}/>)
}
}
Avatar.propTypes = {
size: React.PropTypes.number.isRequired,
url: React.PropTypes.string,
style: React.PropTypes.object
}
| Add grey no avatar image | Add grey no avatar image
| JavaScript | bsd-3-clause | keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client |
42d206a5364616aa6b32f4cc217fcc57fa223d2a | src/components/markdown-render/inlineCode.js | src/components/markdown-render/inlineCode.js | import React from 'react';
import Highlight, { defaultProps } from 'prism-react-renderer';
import darkTheme from 'prism-react-renderer/themes/duotoneDark';
const InlineCode = ({ children, className, additionalPreClasses, theme }) => {
className = className ? '' : className;
const language = className.replace(/language-/, '');
return (
<Highlight
{...defaultProps}
code={children}
language={language}
theme={theme || darkTheme}
>
{({ className, style, tokens, getLineProps, getTokenProps }) => (
<pre
className={`docs-code sprk-u-Measure ${className} ${additionalPreClasses}`}
style={{ ...style }}
>
{tokens.map((line, i) => (
<div key={i} {...getLineProps({ line, key: i })}>
{line.map((token, key) => (
<span key={key} {...getTokenProps({ token, key })} />
))}
</div>
))}
</pre>
)}
</Highlight>
);
};
export default InlineCode;
| import React from 'react';
import Highlight, { defaultProps } from 'prism-react-renderer';
import darkTheme from 'prism-react-renderer/themes/duotoneDark';
const InlineCode = ({ children, className, additionalPreClasses, theme }) => {
className = className ? className : '';
const language = className.replace(/language-/, '');
return (
<Highlight
{...defaultProps}
code={children}
language={language}
theme={theme || darkTheme}
>
{({ className, style, tokens, getLineProps, getTokenProps }) => (
<pre
className={`docs-code sprk-u-Measure ${className} ${additionalPreClasses}`}
style={{ ...style }}
>
{tokens.map((line, i) => (
<div key={i} {...getLineProps({ line, key: i })}>
{line.map((token, key) => (
<span key={key} {...getTokenProps({ token, key })} />
))}
</div>
))}
</pre>
)}
</Highlight>
);
};
export default InlineCode;
| Fix code snippet codetype so it passes in correctly | Fix code snippet codetype so it passes in correctly
| JavaScript | mit | sparkdesignsystem/spark-design-system,sparkdesignsystem/spark-design-system,sparkdesignsystem/spark-design-system,sparkdesignsystem/spark-design-system |
4f09ecf3fc15a2ca29ac3b9605046c5a84012664 | mods/gen3/scripts.js | mods/gen3/scripts.js | exports.BattleScripts = {
inherit: 'gen5',
gen: 3,
init: function () {
for (var i in this.data.Pokedex) {
delete this.data.Pokedex[i].abilities['H'];
}
var specialTypes = {Fire:1, Water:1, Grass:1, Ice:1, Electric:1, Dark:1, Psychic:1, Dragon:1};
var newCategory = '';
for (var i in this.data.Movedex) {
if (this.data.Movedex[i].category === 'Status') continue;
newCategory = specialTypes[this.data.Movedex[i].type] ? 'Special' : 'Physical';
if (newCategory !== this.data.Movedex[i].category) {
this.modData('Movedex', i).category = newCategory;
}
}
},
faint: function (pokemon, source, effect) {
pokemon.faint(source, effect);
this.queue = [];
}
};
| exports.BattleScripts = {
inherit: 'gen5',
gen: 3,
init: function () {
for (var i in this.data.Pokedex) {
delete this.data.Pokedex[i].abilities['H'];
}
var specialTypes = {Fire:1, Water:1, Grass:1, Ice:1, Electric:1, Dark:1, Psychic:1, Dragon:1};
var newCategory = '';
for (var i in this.data.Movedex) {
if (this.data.Movedex[i].category === 'Status') continue;
newCategory = specialTypes[this.data.Movedex[i].type] ? 'Special' : 'Physical';
if (newCategory !== this.data.Movedex[i].category) {
this.modData('Movedex', i).category = newCategory;
}
}
}
};
| Revert "Gen 3: A faint ends the turn just like in gens 1 and 2" | Revert "Gen 3: A faint ends the turn just like in gens 1 and 2"
This reverts commit ebfaf1e8340db1187b9daabcb6414ee3329d882b.
| JavaScript | mit | kubetz/Pokemon-Showdown,SerperiorBae/Pokemon-Showdown,yashagl/pokemon,Nineage/Origin,Irraquated/EOS-Master,ehk12/bigbangtempclone,danpantry/Pokemon-Showdown,AWailOfATail/Pokemon-Showdown,Atwar/server-epilogueleague.rhcloud.com,DesoGit/TsunamiPS,PrimalGallade45/Lumen-Pokemon-Showdown,QuiteQuiet/Pokemon-Showdown,lFernanl/Zero-Pokemon-Showdown,MayukhKundu/Pokemon-Domain,Mystifi/Exiled,TheFenderStory/Pokemon-Showdown,jd4564/Pokemon-Showdown,comedianchameleon/test,Darkshadow6/git-remote-add-scalingo-git-scalingo.com-pokemoonforums,lAlejandro22/lolipoop,Articuno-I/Pokemon-Showdown,SerperiorBae/Bae-Showdown,ShowdownHelper/Saffron,Hidden-Mia/Roleplay-PS,Parukia/Pokemon-Showdown,KaitoV4X/Showdown,hayleysworld/serenityc9,MasterFloat/LQP-Server-Showdown,SkyeTheFemaleSylveon/Mudkip-Server,BuzzyOG/Pokemon-Showdown,Firestatics/Firestatics46,TheFenderStory/Pokemon-Showdown,TheManwithskills/COC,javi501/Lumen-Pokemon-Showdown,Flareninja/Showdown-Boilerplate,xCrystal/Pokemon-Showdown,SkyeTheFemaleSylveon/Mudkip-Server,brettjbush/Pokemon-Showdown,psnsVGC/Wish-Server,SkyeTheFemaleSylveon/Pokemon-Showdown,Hidden-Mia/Roleplay-PS,TheManwithskills/New-boiler-test,kupochu/Pokemon-Showdown,AustinXII/Pokemon-Showdown,gustavo515/final,brettjbush/Pokemon-Showdown,KewlStatics/Alliance,BuzzyOG/Pokemon-Showdown,Extradeath/psserver,MayukhKundu/Flame-Savior,CreaturePhil/Showdown-Boilerplate,Pablo000/aaa,Yggdrasil-League/Yggdrasil,hayleysworld/serenity,sama2/Universe-Pokemon-Showdown,sama2/Lumen-Pokemon-Showdown,DB898/theregalias,Zipzapadam/Server,hayleysworld/Showdown-Boilerplate,urkerab/Pokemon-Showdown,JellalTheMage/Jellals-Server,Git-Worm/City-PS,panpawn/Pokemon-Showdown,ZeroParadox/ugh,Flareninja/Lumen-Pokemon-Showdown,QuiteQuiet/Pokemon-Showdown,MayukhKundu/Technogear,CharizardtheFireMage/Showdown-Boilerplate,ZestOfLife/PSserver,xfix/Pokemon-Showdown,AbsolitoSweep/Absol-server,kuroscafe/Paradox,KewlStatics/Alliance,theodelhay/test,TheFenderStory/Showdown-Boilerplate,arkanox/MistShowdown,Irraquated/Pokemon-Showdown,aakashrajput/Pokemon-Showdown,Zarel/Pokemon-Showdown,zczd/enculer,psnsVGC/Wish-Server,svivian/Pokemon-Showdown,zek7rom/SpacialGaze,SerperiorBae/Bae-Showdown-2,AnaRitaTorres/Pokemon-Showdown,Lauc1an/Perulink-Showdown,KewlStatics/Pokeindia-Codes,ehk12/coregit,zek7rom/SpacialGaze,jumbowhales/Pokemon-Showdown,abrulochp/Lumen-Pokemon-Showdown,Sora-League/Sora,Firestatics/omega,Sora-Server/Sora,Darkshadow6/PokeMoon-Creation,Disaster-Area/Pokemon-Showdown,PrimalGallade45/Lumen-Pokemon-Showdown,Neosweiss/Pokemon-Showdown,kotarou3/Krister-Pokemon-Showdown,Raina4uberz/Light-server,gustavo515/final,Ecuacion/Pokemon-Showdown,panpawn/Gold-Server,Tesarand/Pokemon-Showdown,miahjennatills/Pokemon-Showdown,SolarisFox/Pokemon-Showdown,Disaster-Area/Pokemon-Showdown,UniversalMan12/Universe-Server,ShowdownHelper/Saffron,hayleysworld/Pokemon-Showdown,CreaturePhil/Pokemon-Showdown,Breakfastqueen/advanced,Pablo000/aaa,SilverTactic/Showdown-Boilerplate,TheManwithskills/Creature-phil-boiler,LightningStormServer/Lightning-Storm,hayleysworld/harmonia,kupochu/Pokemon-Showdown,TheManwithskills/Creature-phil-boiler,TheManwithskills/Server,superman8900/Pokemon-Showdown,ankailou/Pokemon-Showdown,Pikachuun/Joimmon-Showdown,bai2/Dropp,abrulochp/Dropp-Pokemon-Showdown,TheDiabolicGift/Lumen-Pokemon-Showdown,KewlStatics/Shit,abrulochp/Dropp-Pokemon-Showdown,AustinXII/Pokemon-Showdown,svivian/Pokemon-Showdown,TheManwithskills/Server---Thermal,gustavo515/batata,sama2/Universe-Pokemon-Showdown,megaslowbro1/Showdown-Server-again,Ecuacion/Lumen-Pokemon-Showdown,sirDonovan/Pokemon-Showdown,SilverTactic/Pokemon-Showdown,SerperiorBae/BaeShowdown,Irraquated/Pokemon-Showdown,KewlStatics/Pokeindia-Codes,lFernanl/Pokemon-Showdown,Pikachuun/Pokemon-Showdown-SMCMDM,cadaeic/Pokemon-Showdown,danpantry/Pokemon-Showdown,scotchkorean27/Pokemon-Showdown,Breakfastqueen/advanced,xfix/Pokemon-Showdown,SerperiorBae/Pokemon-Showdown-1,Pokemon-Devs/Pokemon-Showdown,TheManwithskills/Dusk--Showdown,HoeenCoder/SpacialGaze,TheManwithskills/serenity,zczd/enculer,gustavo515/gashoro,EmmaKitty/Pokemon-Showdown,FakeSloth/Infinite,megaslowbro1/Pokemon-Showdown-Server-for-megaslowbro1,sama2/Lumen-Pokemon-Showdown,Alpha-Devs/Alpha-Server,Zarel/Pokemon-Showdown,CreaturePhil/Showdown-Boilerplate,SerperiorBae/Pokemon-Showdown,PauLucario/LQP-Server-Showdown,Lauc1an/Perulink-Showdown,ehk12/clone,Volcos/SpacialGaze,hayleysworld/asdfasdf,xCrystal/Pokemon-Showdown,TogeSR/Lumen-Pokemon-Showdown,CharizardtheFireMage/Showdown-Boilerplate,xCrystal/Pokemon-Showdown,Atwar/ServerClassroom,sama2/Dropp-Pokemon-Showdown,piiiikachuuu/Pokemon-Showdown,Ridukuo/Test,ZeroParadox/ugh,BlazingAura/Showdown-Boilerplate,hayleysworld/serenity,kotarou3/Krister-Pokemon-Showdown,panpawn/Gold-Server,xfix/Pokemon-Showdown,JellalTheMage/Jellals-Server,lFernanl/Lumen-Pokemon-Showdown,KewlStatics/Showdown-Template,Syurra/Pokemon-Showdown,Sora-Server/Sora,SerperiorBae/Bae-Showdown-2,ScottehMax/Pokemon-Showdown,Ransei1/Alt,jumbowhales/Pokemon-Showdown,TheFenderStory/Showdown-Boilerplate,Guernouille/Pokemon-Showdown,Firestatics/Firestatics46,LightningStormServer/Lightning-Storm,ZestOfLife/FestiveLife,Flareninja/Hispano-Pokemon-Showdown,comedianchameleon/test,abrulochp/Lumen-Pokemon-Showdown,Wando94/Spite,azum4roll/Pokemon-Showdown,FakeSloth/Infinite,Lord-Haji/SpacialGaze,Darkshadow6/PokeMoon-Creation,Guernouille/Pokemon-Showdown,Irraquated/Showdown-Boilerplate,MasterFloat/Pokemon-Showdown,JennyPRO/Jenny,HoeenCoder/SpacialGaze,Pikachuun/Pokemon-Showdown,Flareninja/Showdown-Boilerplate,JellalTheMage/PS-,aakashrajput/Pokemon-Showdown,PauLucario/LQP-Server-Showdown,yashagl/pokecommunity,megaslowbro1/Pokemon-Showdown-Server-for-megaslowbro1,SkyeTheFemaleSylveon/Pokemon-Showdown,AustinXII/Pokemon-Showdown,Ransei1/Alt,CreaturePhil/Showdown-Boilerplate,Extradeath/advanced,Mystifi/Exiled,hayleysworld/Pokemon-Showdown,urkerab/Pokemon-Showdown,PS-Spectral/Spectral,LegendBorned/PS-Boilerplate,Firestatics/Omega-Alpha,ZeroParadox/BlastBurners,svivian/Pokemon-Showdown,TheManwithskills/Dusk--Showdown,DarkSuicune/Pokemon-Showdown,lAlejandro22/lolipoop,Lord-Haji/SpacialGaze,hayleysworld/harmonia,SSJGVegito007/Vegito-s-Server,Volcos/SpacialGaze,JennyPRO/Jenny,KewlStatics/Shit,catanatron/pokemon-rebalance,Irraquated/Showdown-Boilerplate,DarkSuicune/Kakuja-2.0,johtooo/PS,ehk12/bigbangtempclone,SerperiorBae/Pokemon-Showdown-1,Flareninja/Pokemon-Showdown,TheDiabolicGift/Lumen-Pokemon-Showdown,FakeSloth/wulu,Zarel/Pokemon-Showdown,panpawn/Gold-Server,Kevinxzllz/PS-Openshift-Server,Atwar/ServerClassroom,theodelhay/test,yashagl/pokemon,svivian/Pokemon-Showdown,yashagl/yash-showdown,Stroke123/POKEMON,MeliodasBH/Articuno-Land,NoahVSGamingYT/Pokemon-Showdown,abulechu/Dropp-Pokemon-Showdown,megaslowbro1/Pokemon-Showdown,TheManwithskills/COC,SerperiorBae/Pokemon-Showdown,azum4roll/Pokemon-Showdown,KewlStatics/Showdown-Template,Breakfastqueen/advanced,gustavo515/batata,Pokemon-Devs/Pokemon-Showdown,Evil-kun/Pokemon-Showdown,SerperiorBae/Bae-Showdown-2,kuroscafe/Paradox,Stroke123/POKEMON,BlazingAura/Showdown-Boilerplate,SilverTactic/Pokemon-Showdown,panpawn/Pokemon-Showdown,Sora-League/Sora,Extradeath/psserver,SubZeroo99/Pokemon-Showdown,PrimalGallade45/Dropp-Pokemon-Showdown,PS-Spectral/Spectral,lFernanl/Mudkip-Server,Atwar/server-epilogueleague.rhcloud.com,Kokonoe-san/Glacia-PS,SilverTactic/Showdown-Boilerplate,MayukhKundu/Technogear-Final,SilverTactic/Dragotica-Pokemon-Showdown,gustavo515/test,Kill-The-Noise/BlakJack-Boilerplate,AWailOfATail/awoat,Wando94/Pokemon-Showdown,AbsolitoSweep/Absol-server,kubetz/Pokemon-Showdown,CreaturePhil/Pokemon-Showdown,hayleysworld/serenityc9,TbirdClanWish/Pokemon-Showdown,ScottehMax/Pokemon-Showdown,comedianchameleon/test,Elveman/RPCShowdownServer,anubhabsen/Pokemon-Showdown,forbiddennightmare/Pokemon-Showdown-1,arkanox/MistShowdown,yashagl/pokemon-showdown,Ridukuo/Test,DesoGit/Tsunami_PS,Ecuacion/Pokemon-Showdown,Pikachuun/Pokemon-Showdown,Legit99/Lightning-Storm-Server,Pikachuun/Pokemon-Showdown-SMCMDM,SerperiorBae/BaeShowdown,Vacate/Pokemon-Showdown,Elveman/RPCShowdownServer,Flareninja/Pokemon-Showdown,Articuno-I/Pokemon-Showdown,Mystifi/Exiled,hayleysworld/serenityserver,sirDonovan/Pokemon-Showdown,Nineage/Origin,SerperiorBae/Bae-Showdown,SerperiorBae/Bae-Showdown,Enigami/Pokemon-Showdown,Parukia/Pokemon-Showdown,ShowdownHelper/Saffron,abulechu/Dropp-Pokemon-Showdown,Firestatics/Omega-Alpha,Alpha-Devs/OmegaRuby-Server,MayukhKundu/Technogear,TbirdClanWish/Pokemon-Showdown,catanatron/pokemon-rebalance,AWailOfATail/awoat,UniversalMan12/Universe-Server,Wando94/Spite,Enigami/Pokemon-Showdown,UniversalMan12/Universe-Server,Darkshadow6/git-remote-add-scalingo-git-scalingo.com-pokemoonforums,ehk12/coregit,abulechu/Lumen-Pokemon-Showdown,DesoGit/TsunamiPS,piiiikachuuu/Pokemon-Showdown,kuroscafe/Showdown-Boilerplate,Git-Worm/City-PS,TogeSR/Lumen-Pokemon-Showdown,KaitoV4X/Showdown,lFernanl/Pokemon-Showdown,hayleysworld/asdfasdf,lFernanl/Lumen-Pokemon-Showdown,DB898/theregalias,MayukhKundu/Mudkip-Server,svivian/Pokemon-Showdown,Enigami/Pokemon-Showdown,lFernanl/Mudkip-Server,Sora-Server/Sora,LegendBorned/PS-Boilerplate,TheManwithskills/New-boiler-test,TheManwithskills/Server,SSJGVegito007/Vegito-s-Server,MayukhKundu/Mudkip-Server,Ecuacion/Lumen-Pokemon-Showdown,TheManwithskills/Server---Thermal,EienSeiryuu/Pokemon-Showdown,Bryan-0/Pokemon-Showdown,yashagl/yash-showdown,PS-Spectral/Spectral,yashagl/pokecommunity,Darkshadow6/git-remote-add-scalingo-git-scalingo.com-pokemoonforums,anubhabsen/Pokemon-Showdown,Zipzapadam/Server,Kill-The-Noise/BlakJack-Boilerplate,ankailou/Pokemon-Showdown,LustyAsh/EOS-Master,RustServer/Pokemon-Showdown,ZestOfLife/FestiveLife,hayleysworld/Showdown-Boilerplate,BuzzyOG/Pokemon-Showdown,NoahVSGamingYT/Pokemon-Showdown,TheManwithskills/serenity,SilverTactic/Dragotica-Pokemon-Showdown,MeliodasBH/Articuno-Land,cadaeic/Pokemon-Showdown,Enigami/Pokemon-Showdown,Sora-League/Sora,DarkSuicune/Pokemon-Showdown,Celecitia/Plux-Pokemon-Showdown,DalleTest/Pokemon-Showdown,TheManwithskills/DS,Flareninja/Lumen-Pokemon-Showdown,superman8900/Pokemon-Showdown,MasterFloat/Pokemon-Showdown,Darkshadow6/PokeMoon-Creation,EienSeiryuu/Pokemon-Showdown,SolarisFox/Pokemon-Showdown,k3naan/Pokemon-Showdown,Extradeath/advanced,urkerab/Pokemon-Showdown,miahjennatills/Pokemon-Showdown,DalleTest/Pokemon-Showdown,DesoGit/Tsunami_PS,xfix/Pokemon-Showdown,DarkSuicune/Kakuja-2.0,Firestatics/omega,Tesarand/Pokemon-Showdown,PrimalGallade45/Dropp-Pokemon-Showdown,Bryan-0/Pokemon-Showdown,Wando94/Pokemon-Showdown,HoeenCoder/SpacialGaze,Pikachuun/Joimmon-Showdown,jd4564/Pokemon-Showdown,AWailOfATail/Pokemon-Showdown,hayleysworld/serenityserver,scotchkorean27/Pokemon-Showdown,AWailOfATail/Pokemon-Showdown,TheDiabolicGift/Showdown-Boilerplate,Evil-kun/Pokemon-Showdown,Raina4uberz/Light-server,aakashrajput/Pokemon-Showdown,Neosweiss/Pokemon-Showdown,HoeenCoder/SpacialGaze,gustavo515/gashoro,LustyAsh/EOS-Master,xfix/Pokemon-Showdown,asdfghjklohhnhn/Pokemon-Showdown,ZestOfLife/PSserver,TheDiabolicGift/Showdown-Boilerplate,abulechu/Lumen-Pokemon-Showdown,kuroscafe/Showdown-Boilerplate,Flareninja/Hispano-Pokemon-Showdown,megaslowbro1/Showdown-Server-again,JellalTheMage/PS-,jumbowhales/Pokemon-Showdown,Alpha-Devs/OmegaRuby-Server,MayukhKundu/Pokemon-Domain,DesoGit/Tsunami_PS,MayukhKundu/Technogear-Final,TheManwithskills/DS,lFernanl/Zero-Pokemon-Showdown,Syurra/Pokemon-Showdown,Kevinxzllz/PS-Openshift-Server,InvalidDN/Pokemon-Showdown,Kill-The-Noise/BlakJack-Boilerplate,yashagl/pokemon-showdown,Irraquated/EOS-Master,Lord-Haji/SpacialGaze,bai2/Dropp,MayukhKundu/Flame-Savior,Parukia/Pokemon-Showdown,SerperiorBae/BaeShowdown,AnaRitaTorres/Pokemon-Showdown,RustServer/Pokemon-Showdown,ZeroParadox/BlastBurners,SerperiorBae/Pokemon-Showdown-1,EmmaKitty/Pokemon-Showdown,sirDonovan/Pokemon-Showdown,gustavo515/test,Legit99/Lightning-Storm-Server,Vacate/Pokemon-Showdown,Irraquated/Pokemon-Showdown,ehk12/clone,megaslowbro1/Pokemon-Showdown,LightningStormServer/Lightning-Storm,sama2/Dropp-Pokemon-Showdown,SubZeroo99/Pokemon-Showdown,Celecitia/Plux-Pokemon-Showdown,MasterFloat/LQP-Server-Showdown,Yggdrasil-League/Yggdrasil,MeliodasBH/boarhat,johtooo/PS,k3naan/Pokemon-Showdown,QuiteQuiet/Pokemon-Showdown,Alpha-Devs/Alpha-Server,javi501/Lumen-Pokemon-Showdown,forbiddennightmare/Pokemon-Showdown-1,Tesarand/Pokemon-Showdown,Kokonoe-san/Glacia-PS,asdfghjklohhnhn/Pokemon-Showdown,MeliodasBH/boarhat,InvalidDN/Pokemon-Showdown |
a3d8e35c1b438bfe7671375aca48863ca91acc90 | src/scripts/browser/utils/logger.js | src/scripts/browser/utils/logger.js | import colors from 'colors/safe';
export function printDebug() {
console.log(...arguments);
const fileLogger = require('browser/utils/file-logger');
fileLogger.writeLog(...arguments);
}
export function printError(namespace, isFatal, err) {
const errorPrefix = `[${new Date().toUTCString()}] ${namespace}:`;
if (isFatal) {
console.error(colors.white.bold.bgMagenta(errorPrefix), err);
} else {
console.error(colors.white.bold.bgRed(errorPrefix), err);
}
const fileLogger = require('browser/utils/file-logger');
fileLogger.writeLog(errorPrefix, err);
}
| import colors from 'colors/safe';
function getCleanISODate() {
return new Date().toISOString().replace(/[TZ]/g, ' ').trim();
}
export function printDebug() {
console.log(...arguments);
const fileLogger = require('browser/utils/file-logger');
fileLogger.writeLog(`DEBUG [${getCleanISODate()}]`, ...arguments);
}
export function printError(namespace, isFatal, err) {
const errorPrefix = `${isFatal ? 'FATAL' : 'ERROR'} [${getCleanISODate()}] ${namespace}:`;
if (isFatal) {
console.error(colors.white.bold.bgMagenta(errorPrefix), err);
} else {
console.error(colors.white.bold.bgRed(errorPrefix), err);
}
const fileLogger = require('browser/utils/file-logger');
fileLogger.writeLog(errorPrefix, err);
}
| Improve logging (timestamp and level) | Improve logging (timestamp and level)
| JavaScript | mit | Aluxian/Facebook-Messenger-Desktop,rafael-neri/whatsapp-webapp,rafael-neri/whatsapp-webapp,Aluxian/Facebook-Messenger-Desktop,rafael-neri/whatsapp-webapp,Aluxian/Facebook-Messenger-Desktop,Aluxian/Messenger-for-Desktop,Aluxian/Messenger-for-Desktop,Aluxian/Messenger-for-Desktop |
09f1a06bb726af840ced3c4e3d0e1cd3e2794025 | modules/youtube.js | modules/youtube.js | /**
* To use this module, add youtube.key to your config.json
* You need the key for the Youtube Data API:
* https://console.developers.google.com/apis/credentials
*/
var yt = require( 'youtube-search' );
module.exports = {
commands: {
yt: {
help: 'Searches YouTube for a query string',
aliases: [ 'youtube' ],
command: function ( bot, msg ) {
msg.args.shift();
var query = msg.args.join( ' ' );
var opts = bot.config.youtube || {};
opts.maxResults = 1;
yt( query, opts, function ( err, results ) {
if ( err ) {
return bot.say( msg.to, msg.nick + ': ' + err );
}
var result = results[0];
bot.say( msg.to, msg.nick + ': ' + result.link + ' ' + result.title );
} );
}
}
}
};
| /**
* To use this module, add youtube.key to your config.json
* You need the key for the Youtube Data API:
* https://console.developers.google.com/apis/credentials
*/
var yt = require( 'youtube-search' );
module.exports = {
commands: {
yt: {
help: 'Searches YouTube for a query string',
aliases: [ 'youtube' ],
command: function ( bot, msg ) {
msg.args.shift();
var query = msg.args.join( ' ' );
var opts = bot.config.youtube || {};
opts.maxResults = 1;
opts.type = 'video,channel';
yt( query, opts, function ( err, results ) {
if ( err ) {
return bot.say( msg.to, msg.nick + ': ' + err );
}
var result = results[0];
bot.say( msg.to, msg.nick + ': ' + result.link + ' ' + result.title );
} );
}
}
}
};
| Add workaround for bad YouTube results | Add workaround for bad YouTube results
The upstream module used for YouTube search breaks when results are
neither videos nor channels. This commit forces YouTube to return only
videos and channels, in order to work around the bug.
Bug: MaxGfeller/youtube-search#15
| JavaScript | isc | zuzakistan/civilservant,zuzakistan/civilservant |
4a51369bf5b24c263ceac5199643ace5597611d3 | lib/assure-seamless-styles.js | lib/assure-seamless-styles.js | 'use strict';
var isParentNode = require('dom-ext/parent-node/is')
, isStyleSheet = require('html-dom-ext/link/is-style-sheet')
, forEach = Array.prototype.forEach;
module.exports = function (nodes) {
var styleSheets = [], container, document;
forEach.call(nodes, function self(node) {
if (isStyleSheet(node)) {
if (node.hasAttribute('href')) styleSheets.push(node);
return;
}
if (!isParentNode(node)) return;
if (node.getElementsByTagName) {
forEach.call(node.getElementsByTagName('link'), function (link) {
if (!isStyleSheet(link)) return;
if (link.hasAttribute('href')) styleSheets.push(node);
});
return;
}
forEach.call(node.childNodes, self);
});
if (!styleSheets.length) return;
document = styleSheets[0].ownerDocument;
container = document.documentElement.insertBefore(document.createElement('div'),
document.documentElement.firstChild);
container.className = 'ie-stylesheets-unload-workaround';
styleSheets.forEach(function (styleSheet) {
styleSheet = styleSheet.cloneNode(true);
container.appendChild(styleSheet);
styleSheet.setAttribute('href', styleSheet.getAttribute('href'));
});
setTimeout(function () { document.documentElement.removeChild(container); }, 0);
};
| 'use strict';
var isParentNode = require('dom-ext/parent-node/is')
, isStyleSheet = require('html-dom-ext/link/is-style-sheet')
, forEach = Array.prototype.forEach;
module.exports = exports = function (nodes) {
var styleSheets = [], container, document;
if (!exports.enabled) return;
forEach.call(nodes, function self(node) {
if (isStyleSheet(node)) {
if (node.hasAttribute('href')) styleSheets.push(node);
return;
}
if (!isParentNode(node)) return;
if (node.getElementsByTagName) {
forEach.call(node.getElementsByTagName('link'), function (link) {
if (!isStyleSheet(link)) return;
if (link.hasAttribute('href')) styleSheets.push(node);
});
return;
}
forEach.call(node.childNodes, self);
});
if (!styleSheets.length) return;
document = styleSheets[0].ownerDocument;
container = document.documentElement.insertBefore(document.createElement('div'),
document.documentElement.firstChild);
container.className = 'ie-stylesheets-unload-workaround';
styleSheets.forEach(function (styleSheet) {
styleSheet = styleSheet.cloneNode(true);
container.appendChild(styleSheet);
styleSheet.setAttribute('href', styleSheet.getAttribute('href'));
});
setTimeout(function () { document.documentElement.removeChild(container); }, 0);
};
exports.enabled = true;
| Allow external disable of stylesheets hack | Allow external disable of stylesheets hack
| JavaScript | mit | medikoo/site-tree |
efe31ffd074aa24cb6d92fdb265fdcb7bbccbc30 | src/core/keyboard/compare.js | src/core/keyboard/compare.js | import dEqual from 'fast-deep-equal';
// Compares two possible objects
export function compareKbdCommand(c1, c2) {
return dEqual(c1, c2);
}
| import dEqual from 'fast-deep-equal';
// Compares two possible objects
export function compareKbdCommand(c1, c2) {
if (Array.isArray(c1)) {
return dEqual(c1[0], c1[1]);
}
return dEqual(c1, c2);
}
| Handle array case in keyboard command comparison | Handle array case in keyboard command comparison
| JavaScript | mit | reblws/tab-search,reblws/tab-search |
5b867ada55e138a1a73da610dc2dec4c98c8b442 | app/scripts/models/player.js | app/scripts/models/player.js | // An abstract base model representing a player in a game
function Player(args) {
// The name of the player (e.g. 'Human 1')
this.name = args.name;
// The player's chip color (supported colors are black, blue, and red)
this.color = args.color;
// The player's total number of wins across all games
this.score = 0;
}
export default Player;
| // An abstract base model representing a player in a game
class Player {
constructor(args) {
// The name of the player (e.g. 'Human 1')
this.name = args.name;
// The player's chip color (supported colors are black, blue, and red)
this.color = args.color;
// The player's total number of wins across all games
this.score = 0;
}
}
export default Player;
| Convert Player base model to ES6 class | Convert Player base model to ES6 class
| JavaScript | mit | caleb531/connect-four |
3d9fc84c280ed14cfd980ca443c30a4a30ecffd5 | lib/assets/javascripts/cartodb/models/tile_json_model.js | lib/assets/javascripts/cartodb/models/tile_json_model.js | /**
* Model to representing a TileJSON endpoint
* See https://github.com/mapbox/tilejson-spec/tree/master/2.1.0 for details
*/
cdb.admin.TileJSON = cdb.core.Model.extend({
idAttribute: 'url',
url: function() {
return this.get('url');
},
save: function() {
// no-op, obviously no write privileges ;)
},
newTileLayer: function() {
if (!this._isFetched()) throw new Error('no tiles, have fetch been called and returned a successful resultset?');
var layer = new cdb.admin.TileLayer({
urlTemplate: this._urlTemplate(),
name: this.get('name'),
attribution: this.get('attribution'),
maxZoom: this.get('maxzoom'),
minZoom: this.get('minzoom'),
bounding_boxes: this.get('bounds')
});
return layer;
},
_isFetched: function() {
return this.get('tiles').length > 0;
},
_urlTemplate: function() {
return this.get('tiles')[0];
}
});
| /**
* Model to representing a TileJSON endpoint
* See https://github.com/mapbox/tilejson-spec/tree/master/2.1.0 for details
*/
cdb.admin.TileJSON = cdb.core.Model.extend({
idAttribute: 'url',
url: function() {
return this.get('url');
},
save: function() {
// no-op, obviously no write privileges ;)
},
newTileLayer: function() {
if (!this._isFetched()) throw new Error('no tiles, have fetch been called and returned a successful resultset?');
var layer = new cdb.admin.TileLayer({
urlTemplate: this._urlTemplate(),
name: this._name(),
attribution: this.get('attribution'),
maxZoom: this.get('maxzoom'),
minZoom: this.get('minzoom'),
bounding_boxes: this.get('bounds')
});
return layer;
},
_isFetched: function() {
return this.get('tiles').length > 0;
},
_urlTemplate: function() {
return this.get('tiles')[0];
},
_name: function() {
return this.get('name') || this.get('description');
}
});
| Set description as fallback for name | Set description as fallback for name
Both are optional, so might be empty or undefined, for which depending
on use-case might need to handle (for basemap will get a custom name)
| JavaScript | bsd-3-clause | future-analytics/cartodb,splashblot/dronedb,dbirchak/cartodb,DigitalCoder/cartodb,dbirchak/cartodb,thorncp/cartodb,raquel-ucl/cartodb,DigitalCoder/cartodb,DigitalCoder/cartodb,raquel-ucl/cartodb,thorncp/cartodb,splashblot/dronedb,future-analytics/cartodb,DigitalCoder/cartodb,nyimbi/cartodb,CartoDB/cartodb,nuxcode/cartodb,nyimbi/cartodb,CartoDB/cartodb,UCL-ShippingGroup/cartodb-1,future-analytics/cartodb,CartoDB/cartodb,UCL-ShippingGroup/cartodb-1,nyimbi/cartodb,nuxcode/cartodb,codeandtheory/cartodb,dbirchak/cartodb,UCL-ShippingGroup/cartodb-1,CartoDB/cartodb,dbirchak/cartodb,splashblot/dronedb,bloomberg/cartodb,splashblot/dronedb,nyimbi/cartodb,splashblot/dronedb,codeandtheory/cartodb,raquel-ucl/cartodb,bloomberg/cartodb,dbirchak/cartodb,raquel-ucl/cartodb,thorncp/cartodb,future-analytics/cartodb,nuxcode/cartodb,nyimbi/cartodb,DigitalCoder/cartodb,bloomberg/cartodb,codeandtheory/cartodb,codeandtheory/cartodb,bloomberg/cartodb,UCL-ShippingGroup/cartodb-1,future-analytics/cartodb,UCL-ShippingGroup/cartodb-1,raquel-ucl/cartodb,nuxcode/cartodb,CartoDB/cartodb,bloomberg/cartodb,thorncp/cartodb,thorncp/cartodb,nuxcode/cartodb,codeandtheory/cartodb |
145b8c979cb7800cf3eb6ff2ad30037e4b19c51d | applications/firefox/user.js | applications/firefox/user.js | user_pref("accessibility.typeaheadfind", 1);
user_pref("browser.fixup.alternate.enabled", false);
user_pref("browser.newtab.url", "https://www.google.co.nz");
user_pref("browser.pocket.enabled", false);
user_pref("browser.tabs.tabClipWidth", 1);
user_pref("datareporting.healthreport.service.enabled", false);
user_pref("datareporting.healthreport.uploadEnabled", false);
user_pref("general.useragent.locale", "en-GB");
user_pref("keyword.enabled", true);
user_pref("layout.spellcheckDefault", 2);
user_pref("loop.enabled", false);
user_pref("plugins.click_to_play", true);
user_pref("spellchecker.dictionary", "en-GB");
user_pref("toolkit.telemetry.enabled", false);
| user_pref("browser.ctrlTab.previews", true);
user_pref("browser.fixup.alternate.enabled", false);
user_pref("browser.newtab.url", "https://www.google.co.nz");
user_pref("browser.pocket.enabled", false);
user_pref("browser.tabs.tabClipWidth", 1);
user_pref("datareporting.healthreport.service.enabled", false);
user_pref("datareporting.healthreport.uploadEnabled", false);
user_pref("general.useragent.locale", "en-GB");
user_pref("layout.spellcheckDefault", 2);
user_pref("loop.enabled", false);
user_pref("plugins.click_to_play", true);
user_pref("spellchecker.dictionary", "en-GB");
user_pref("toolkit.telemetry.enabled", false);
| Tidy up firefox prefs, and added CTRL+TAB through tabs :) | Tidy up firefox prefs, and added CTRL+TAB through tabs :)
| JavaScript | mit | craighurley/dotfiles,craighurley/dotfiles,craighurley/dotfiles |
af6314d64914d4450ceabb197b2c451e97ac2a62 | server/websocket.js | server/websocket.js |
var ds = require('./discovery')
var rb = require('./rubygems')
var sc = require('./scrape')
var WebSocketServer = require('ws').Server
var wss = new WebSocketServer({host: 'localhost', port: 3001})
var clients = {}
wss.on('connection', (ws) => {
ws.on('message', (data) => {
var req = JSON.parse(data)
if (req.message === 'ping') {
ws.id = req.id
clients[ws.id] = ws
clients[ws.id].send(JSON.stringify({message: 'pong'}))
}
else if (req.message === 'gems') {
ds.run(req.gem,
(gem) => {
if (!clients[req.id]) {
return true
}
clients[req.id].send(JSON.stringify({message: 'node', gem: gem}))
},
(err, gems) => {
if (!clients[req.id]) {
return true
}
clients[req.id].send(JSON.stringify({message: 'done', gems: gems}))
}
)
}
else if (req.message === 'owners') {
sc.owners('gems/' + req.gem, (err, owners) => {
if (!clients[req.id]) {
return true
}
clients[req.id].send(JSON.stringify({
message: 'owners', owners: owners, gem: req.gem
}))
})
}
})
ws.on('close', () => delete clients[ws.id])
})
exports.clients = clients
|
var ds = require('./discovery')
var rb = require('./rubygems')
var sc = require('./scrape')
var WebSocketServer = require('ws').Server
var wss = new WebSocketServer({host: 'localhost', port: 3001})
var clients = {}
wss.on('connection', (ws) => {
ws.on('message', (data) => {
var req = JSON.parse(data)
if (req.message === 'ping') {
ws.id = req.id
clients[ws.id] = ws
clients[ws.id].send(JSON.stringify({message: 'pong', id: ws.id}))
}
else if (req.message === 'gems') {
ds.run(req.gem,
(gem) => {
if (!clients[req.id]) {
return true
}
clients[req.id].send(JSON.stringify({message: 'node', gem: gem}))
},
(err, gems) => {
if (!clients[req.id]) {
return true
}
clients[req.id].send(JSON.stringify({message: 'done', gems: gems}))
}
)
}
else if (req.message === 'owners') {
sc.owners('gems/' + req.gem, (err, owners) => {
if (!clients[req.id]) {
return true
}
clients[req.id].send(JSON.stringify({
message: 'owners', owners: owners, gem: req.gem
}))
})
}
})
ws.on('close', () => delete clients[ws.id])
})
exports.clients = clients
| Send back the socket id with the pong message | Send back the socket id with the pong message
| JavaScript | mit | simov/rubinho,simov/rubinho |
976aed3d7a14c176e369ceb600baf61260daeed2 | packages/shared/lib/api/logs.js | packages/shared/lib/api/logs.js | export const queryLogs = ({ Page, PageSize } = {}) => ({
method: 'get',
url: 'logs/auth',
params: { Page, PageSize }
});
export const clearLogs = () => ({
method: 'delete',
url: 'logs/auth'
});
| export const queryLogs = (params) => ({
method: 'get',
url: 'logs/auth',
params
});
export const clearLogs = () => ({
method: 'delete',
url: 'logs/auth'
});
| Allow queryLogs to be without params | Allow queryLogs to be without params
| JavaScript | mit | ProtonMail/WebClient,ProtonMail/WebClient,ProtonMail/WebClient |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
|
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.