commit
stringlengths
40
40
old_file
stringlengths
4
150
new_file
stringlengths
4
150
old_contents
stringlengths
0
3.26k
new_contents
stringlengths
1
4.43k
subject
stringlengths
15
501
message
stringlengths
15
4.06k
lang
stringclasses
4 values
license
stringclasses
13 values
repos
stringlengths
5
91.5k
diff
stringlengths
0
4.35k
2fa1bad5ac36807f47c184c31c36f0ecc050cea9
draft-js-inline-toolbar-plugin/src/components/Toolbar/__test__/Toolbar.js
draft-js-inline-toolbar-plugin/src/components/Toolbar/__test__/Toolbar.js
import React, { Component } from 'react'; import { expect } from 'chai'; import { mount } from 'enzyme'; import Toolbar from '../index'; describe('Toolbar', () => { it('allows children to override the content', (done) => { const structure = [class Child extends Component { componentDidMount() { setTimeout(() => { this.props.onOverrideContent(() => { setTimeout(() => { this.props.onOverrideContent(undefined); }); return <span className="overridden" />; }); }); } render() { return <span className="initial" />; } }]; const theme = { toolbarStyles: {} }; const store = { subscribeToItem() {}, unsubscribeFromItem() {}, getItem: (name) => ({ getEditorState: () => ({ getSelection: () => ({ isCollapsed: () => true }) }) }[name]) }; const wrapper = mount( <Toolbar store={store} theme={theme} structure={structure} /> ); expect(wrapper.find('.initial').length).to.equal(1); setTimeout(() => { expect(wrapper.find('.initial').length).to.equal(0); expect(wrapper.find('.overridden').length).to.equal(1); setTimeout(() => { expect(wrapper.find('.initial').length).to.equal(1); expect(wrapper.find('.overridden').length).to.equal(0); done(); }); }); }); });
import React, { Component } from 'react'; import { expect } from 'chai'; import { mount } from 'enzyme'; import Toolbar from '../index'; describe('Toolbar', () => { it('allows children to override the content', (done) => { const structure = [class Child extends Component { componentDidMount() { setTimeout(() => { this.props.onOverrideContent(() => { setTimeout(() => { this.props.onOverrideContent(undefined); }); return <span className="overridden" />; }); }); } render() { return <span className="initial" />; } }]; const theme = { toolbarStyles: {} }; const store = { subscribeToItem() {}, unsubscribeFromItem() {}, getItem: (name) => ({ getEditorState: () => ({ getSelection: () => ({ isCollapsed: () => true, getHasFocus: () => true }) }) }[name]) }; const wrapper = mount( <Toolbar store={store} theme={theme} structure={structure} /> ); expect(wrapper.find('.initial').length).to.equal(1); setTimeout(() => { expect(wrapper.find('.initial').length).to.equal(0); expect(wrapper.find('.overridden').length).to.equal(1); setTimeout(() => { expect(wrapper.find('.initial').length).to.equal(1); expect(wrapper.find('.overridden').length).to.equal(0); done(); }); }); }); });
Fix test for inline toolbar
Fix test for inline toolbar
JavaScript
mit
draft-js-plugins/draft-js-plugins,dagopert/draft-js-plugins,nikgraf/draft-js-plugin-editor,nikgraf/draft-js-plugin-editor,draft-js-plugins/draft-js-plugins,dagopert/draft-js-plugins,nikgraf/draft-js-plugin-editor,draft-js-plugins/draft-js-plugins,dagopert/draft-js-plugins,draft-js-plugins/draft-js-plugins
--- +++ @@ -28,7 +28,7 @@ unsubscribeFromItem() {}, getItem: (name) => ({ getEditorState: () => ({ - getSelection: () => ({ isCollapsed: () => true }) + getSelection: () => ({ isCollapsed: () => true, getHasFocus: () => true }) }) }[name]) };
9034a21f2762b6b01d6dc45a9f049e60cf3d7439
addon/components/course-publicationcheck.js
addon/components/course-publicationcheck.js
/* eslint-disable ember/no-computed-properties-in-native-classes */ import Component from '@glimmer/component'; import { inject as service } from '@ember/service'; export default class CoursePublicationCheckComponent extends Component { @service router; get showUnlinkIcon() { if (!this.args.course.courseObjectives) { return false; } const objectivesWithoutParents = this.args.course.courseObjectives.filter((objective) => { const parentIds = objective.hasMany('programYearObjectives').ids(); return parentIds.length === 0; }); return objectivesWithoutParents.length > 0; } }
/* eslint-disable ember/no-computed-properties-in-native-classes */ import Component from '@glimmer/component'; import { inject as service } from '@ember/service'; import { use } from 'ember-could-get-used-to-this'; import ResolveAsyncValue from 'ilios-common/classes/resolve-async-value'; export default class CoursePublicationCheckComponent extends Component { @service router; @use courseObjectives = new ResolveAsyncValue(() => [this.args.course.courseObjectives, []]); get showUnlinkIcon() { const objectivesWithoutParents = this.courseObjectives.filter((objective) => { return objective.programYearObjectives.length === 0; }); return objectivesWithoutParents.length > 0; } }
Resolve objectives in course publication check
Resolve objectives in course publication check We can also use the length value of the relationship to check if there are parents which engages auto tracking.
JavaScript
mit
ilios/common,ilios/common
--- +++ @@ -1,17 +1,17 @@ /* eslint-disable ember/no-computed-properties-in-native-classes */ import Component from '@glimmer/component'; import { inject as service } from '@ember/service'; +import { use } from 'ember-could-get-used-to-this'; +import ResolveAsyncValue from 'ilios-common/classes/resolve-async-value'; export default class CoursePublicationCheckComponent extends Component { @service router; + @use courseObjectives = new ResolveAsyncValue(() => [this.args.course.courseObjectives, []]); + get showUnlinkIcon() { - if (!this.args.course.courseObjectives) { - return false; - } - const objectivesWithoutParents = this.args.course.courseObjectives.filter((objective) => { - const parentIds = objective.hasMany('programYearObjectives').ids(); - return parentIds.length === 0; + const objectivesWithoutParents = this.courseObjectives.filter((objective) => { + return objective.programYearObjectives.length === 0; }); return objectivesWithoutParents.length > 0;
5d9f0dbd9e287ad320f020238ab6d3e66ffb2f49
addon/components/floating-mobile-buttons.js
addon/components/floating-mobile-buttons.js
import Ember from 'ember'; import layout from '../templates/components/floating-mobile-buttons'; export default Ember.Component.extend({ layout, tagName: 'ul', classNames: ['floating-buttons'], classNameBindings: ['active:active', 'bottom:bottom', 'top:top', 'left:left', 'right:right'], active: false, childrenActive: false, hasChildren: false, position: 'bottom right', didReceiveAttrs(){ this._super(...arguments); let classes = this.get('position').trim().split(" "); let vClasses = classes.filter( c => { if(c.match(/(bottom|top)/i)){ return c; } }); let hClasses = classes.filter( c => { if(c.match(/(right|left)/i)){ return c; } }); if(vClasses.length === 0 || vClasses.length > 1 || hClasses.length === 0 || hClasses.length > 1){ Ember.assert('The position property must be a string with the values top|bottom and left|right.'); } classes.forEach( c => { this.set(c, true); }); }, didInsertElement(){ this._super(...arguments); this.set('active', true); if(Ember.$(`#${this.get('elementId')} .floating-child-button`).length > 1){ this.set('hasChildren', true); } }, actions: { toggleChildren(){ this.toggleProperty('childrenActive'); } } });
import Ember from 'ember'; import layout from '../templates/components/floating-mobile-buttons'; export default Ember.Component.extend({ layout, tagName: 'ul', classNames: ['floating-buttons'], classNameBindings: ['active:active', 'bottom:bottom', 'top:top', 'left:left', 'right:right'], active: false, childrenActive: false, hasChildren: false, position: 'bottom right', didReceiveAttrs(){ this._super(...arguments); this.set('active', true); let classes = this.get('position').trim().split(" "); let vClasses = classes.filter( c => { if(c.match(/(bottom|top)/i)){ return c; } }); let hClasses = classes.filter( c => { if(c.match(/(right|left)/i)){ return c; } }); if(vClasses.length === 0 || vClasses.length > 1 || hClasses.length === 0 || hClasses.length > 1){ Ember.assert('The position property must be a string with the values top|bottom and left|right.'); } classes.forEach( c => { this.set(c, true); }); Ember.run.schedule('afterRender', () => { if(Ember.$(`#${this.get('elementId')} .floating-child-button`).length > 1){ this.set('hasChildren', true); } }); }, actions: { toggleChildren(){ this.toggleProperty('childrenActive'); } } });
Use the afterRender run loop to check if has children
Use the afterRender run loop to check if has children
JavaScript
mit
yontxu/ember-floating-mobile-buttons,yontxu/ember-floating-mobile-buttons
--- +++ @@ -12,6 +12,9 @@ position: 'bottom right', didReceiveAttrs(){ this._super(...arguments); + + this.set('active', true); + let classes = this.get('position').trim().split(" "); let vClasses = classes.filter( c => { if(c.match(/(bottom|top)/i)){ @@ -31,14 +34,12 @@ classes.forEach( c => { this.set(c, true); }); - }, - didInsertElement(){ - this._super(...arguments); - this.set('active', true); - if(Ember.$(`#${this.get('elementId')} .floating-child-button`).length > 1){ - this.set('hasChildren', true); - } + Ember.run.schedule('afterRender', () => { + if(Ember.$(`#${this.get('elementId')} .floating-child-button`).length > 1){ + this.set('hasChildren', true); + } + }); }, actions: { toggleChildren(){
bf5b8c20974dfe7d16dde885aa02ec39471e652a
great/static/js/models/artist.js
great/static/js/models/artist.js
"use strict"; great.Artist = Backbone.Model.extend({ }); great.ArtistsCollection = Backbone.PageableCollection.extend({ model: great.Artist, comparator: "name", url: "/great/music/artists/", mode: "client", });
"use strict"; great.Artist = Backbone.Model.extend({ urlRoot: "/great/music/artists/", }); great.ArtistsCollection = Backbone.PageableCollection.extend({ model: great.Artist, comparator: "name", url: "/great/music/artists/", mode: "client", });
Add a urlRoot to allow use outside of a collection.
Add a urlRoot to allow use outside of a collection.
JavaScript
mit
Julian/Great,Julian/Great,Julian/Great
--- +++ @@ -2,6 +2,7 @@ great.Artist = Backbone.Model.extend({ + urlRoot: "/great/music/artists/", });
8f0b0267da395ce2824122496408b4c3ac014a3d
src/camel-case.js
src/camel-case.js
import R from 'ramda'; import uncapitalize from './uncapitalize.js'; import pascalCase from './pascal-case.js'; // a -> a const camelCase = R.compose(uncapitalize, pascalCase); export default camelCase;
import R from 'ramda'; import compose from './util/compose.js'; import uncapitalize from './uncapitalize.js'; import pascalCase from './pascal-case.js'; // a -> a const camelCase = compose(uncapitalize, pascalCase); export default camelCase;
Refactor camelCase function to use custom compose function
Refactor camelCase function to use custom compose function
JavaScript
mit
restrung/restrung-js
--- +++ @@ -1,8 +1,9 @@ import R from 'ramda'; +import compose from './util/compose.js'; import uncapitalize from './uncapitalize.js'; import pascalCase from './pascal-case.js'; // a -> a -const camelCase = R.compose(uncapitalize, pascalCase); +const camelCase = compose(uncapitalize, pascalCase); export default camelCase;
6a5598ed7f1cf85502d58e7a9b774d31419ff79c
js/kamfu.js
js/kamfu.js
$(document).ready(function() { console.log( "ready!" ); var gameForeground = $('#gameForeground')[0]; var gameFront = $('#gameFront')[0]; var gameBack = $('#gameBack')[0]; var gameText = $('#gameText')[0]; gameCommon.setup(gameForeground, gameFront, gameBack, gameText); var video = document.querySelector('video'); camera.setup(video, gameCommon.onSnapshot, gameCommon.initCallback); window.setTimeout(gameCommon.mainLoop, 100); $( "body" ).click(function() { if (gameCommon.currentGame == gameMenu) { var r = confirm("Reset camera?"); if (r == true) { gameCommon.clearup(); camera.initialized = false; camera.startupTime = 0; } } }); });
$(document).ready(function() { console.log( "ready!" ); var gameForeground = $('#gameForeground')[0]; var gameFront = $('#gameFront')[0]; var gameBack = $('#gameBack')[0]; var gameText = $('#gameText')[0]; gameCommon.setup(gameForeground, gameFront, gameBack, gameText); var video = document.querySelector('video'); camera.setup(video, gameCommon.onSnapshot, gameCommon.initCallback); window.setTimeout(gameCommon.mainLoop, 100); });
Remove reset camera click event
Remove reset camera click event
JavaScript
apache-2.0
pabloalba/kam-fu,pabloalba/kam-fu
--- +++ @@ -12,17 +12,4 @@ window.setTimeout(gameCommon.mainLoop, 100); - - - $( "body" ).click(function() { - if (gameCommon.currentGame == gameMenu) { - var r = confirm("Reset camera?"); - if (r == true) { - gameCommon.clearup(); - camera.initialized = false; - camera.startupTime = 0; - } - } - }); - });
0ca2b8e525a81eedb21af53b1ac2213b8efa4dd8
web/src/store.js
web/src/store.js
import { compose, createStore, applyMiddleware } from 'redux' import persistState from 'redux-localstorage' import thunk from 'redux-thunk' import RootReducer from 'reducers/RootReducer' export default createStore( RootReducer, compose( applyMiddleware(thunk), persistState(['user']), window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__(), ), )
import { compose, createStore, applyMiddleware } from 'redux' import persistState from 'redux-localstorage' import thunk from 'redux-thunk' import RootReducer from 'reducers/RootReducer' const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose export default createStore( RootReducer, composeEnhancers( persistState(['user']), applyMiddleware(thunk), ), )
Fix Redux DevTools for mobile
Fix Redux DevTools for mobile
JavaScript
mit
RailsRoading/wissle,RailsRoading/wissle,RailsRoading/wissle
--- +++ @@ -4,11 +4,12 @@ import RootReducer from 'reducers/RootReducer' +const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose + export default createStore( RootReducer, - compose( + composeEnhancers( + persistState(['user']), applyMiddleware(thunk), - persistState(['user']), - window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__(), ), )
dc5f805dcea6d0c1dd27a98cadbf2290a323ea87
javascript/staticsearch.js
javascript/staticsearch.js
jQuery(function($) { $('#tipue_search_input').tipuesearch({ 'mode': 'static', 'contentLocation': '/search_index' }); $("form.no-pageload input").keypress(function(e){ var k = e.keyCode || e.which; if(k == 13){ e.preventDefault(); } }); $("form.button-submit input.submit-button").click(function(e){ this.form.submit(); }); });
jQuery(function($) { //prevent undeclared variable var tipuesearch = {"pages": [ {"title": "", "text":"", "tags":"", "loc":""} ]}; $('#tipue_search_input').tipuesearch({ 'mode': 'static', 'contentLocation': '/search_index' }); $("form.no-pageload input").keypress(function(e){ var k = e.keyCode || e.which; if(k == 13){ e.preventDefault(); } }); $("form.button-submit input.submit-button").click(function(e){ this.form.submit(); }); });
Fix undefined error when no search file found
BUG: Fix undefined error when no search file found
JavaScript
bsd-3-clause
adrexia/silverstripe-staticsearch,adrexia/silverstripe-staticsearch
--- +++ @@ -1,4 +1,10 @@ jQuery(function($) { + + //prevent undeclared variable + var tipuesearch = {"pages": [ + {"title": "", "text":"", "tags":"", "loc":""} + ]}; + $('#tipue_search_input').tipuesearch({ 'mode': 'static', 'contentLocation': '/search_index'
5c2e5defbe12f099b627ac83302e1caa818d0093
lib/Post.js
lib/Post.js
var config = require('../config.json'); var modIDs = config.modIDs; /** * A single Facebook post or comment. * @class */ var Post = module.exports = function (id) { /** @member {string} */ this.id = id; /** @member {string} */ this.from = ''; /** @member {string} */ this.message = ''; }; /** * Converts a raw JSON-formatted post from a response body into an object. * @param {Object} raw * @return {Post} */ Post.fromRaw = function (raw) { var post = new Post(raw.id); post.from = raw.from ? raw.from.id : '0'; post.message = raw.message; return post; }; /** * Determines if the poster was a group moderator. * @returns {boolean} */ Post.prototype.isMod = function () { return modIDs.indexOf(this.from) !== -1; }; /** * Determines if the post contains a moderative command. Commands begin with a * forward slash, followed by any number of alphanumeric characters. * @param {string} cmd * @returns {boolean} */ Post.prototype.hasCommand = function (cmd) { return this.message.match('^/' + cmd + '(?: |$)'); };
var config = require('../config.json'); var modIDs = config.modIDs; /** * A single Facebook post or comment. * @class */ var Post = module.exports = function (id) { /** @member {string} */ this.id = id; /** @member {string} */ this.from = ''; /** @member {string} */ this.message = ''; }; /** * Converts a raw JSON-formatted post from a response body into an object. * @param {Object} raw * @return {Post} */ Post.fromRaw = function (raw) { var post = new Post(raw.id); post.from = raw.from ? raw.from.id : '0'; post.message = raw.message || ''; return post; }; /** * Determines if the poster was a group moderator. * @returns {boolean} */ Post.prototype.isMod = function () { return modIDs.indexOf(this.from) !== -1; }; /** * Determines if the post contains a moderative command. Commands begin with a * forward slash, followed by any number of alphanumeric characters. * @param {string} cmd * @returns {boolean} */ Post.prototype.hasCommand = function (cmd) { return this.message.match('^/' + cmd + '(?: |$)'); };
Fix message processing for sticker comments.
Fix message processing for sticker comments.
JavaScript
bsd-3-clause
HHDesign/hackbot,rhallie15/hackbot,kern/hackbot,kern/hackbot,samuelcouch/hackbot,rubinovitz/hackbot
--- +++ @@ -26,7 +26,7 @@ Post.fromRaw = function (raw) { var post = new Post(raw.id); post.from = raw.from ? raw.from.id : '0'; - post.message = raw.message; + post.message = raw.message || ''; return post; };
48b850d5ba1cdda06a55b8ae5d2727c5c8b4bde4
lib/deck.js
lib/deck.js
var _ = require("lodash"); var EventEmitter = require("events").EventEmitter; var util = require("util"); var ItemCollection = require("./itemcollection"); function Deck(options) { if (!(this instanceof Deck)) { return new Deck(options); } EventEmitter.call(this); this.itemCollection = options.itemCollection || new ItemCollection(options.items || []); this.itemRenderer = options.itemRenderer; this.setViewport(options.viewport); // use default this.setLayout(options.layout); // use standard grid layout } util.inherits(Deck, EventEmitter); _.extend(Deck.prototype, { addItem: function(item) { this.itemCollection.addItem(item); }, addItems: function(items) { this.itemCollection.addItems(items); }, removeItem: function(item) { this.itemCollection.removeItem(item); }, clear: function() { this.itemCollection.clear(); }, setViewport: function(viewport) { if (this.viewport) { // TODO: unbind viewport events? } this.viewport = viewport; this.viewport.setItemRenderer(this.itemRenderer); // TODO: set viewport on current layout }, setLayout: function(layout) { if (this.layout) { this.layout.unbindCollectionEvents(); this.layout.unbindViewportEvents(); } this.layout = layout; this.layout.setItemCollection(this.itemCollection); this.layout.setViewport(this.viewport); } }); module.exports = Deck;
var _ = require("lodash"); var EventEmitter = require("events").EventEmitter; var util = require("util"); var ItemCollection = require("./itemcollection"); var ItemRenderer = require("./itemrenderer"); function Deck(options) { if (!(this instanceof Deck)) { return new Deck(options); } EventEmitter.call(this); this.itemCollection = options.itemCollection || new ItemCollection(options.items || []); this.itemRenderer = new ItemRenderer(options.itemRenderer); this.setViewport(options.viewport); // use default this.setLayout(options.layout); // use standard grid layout } util.inherits(Deck, EventEmitter); _.extend(Deck.prototype, { addItem: function(item) { this.itemCollection.addItem(item); }, addItems: function(items) { this.itemCollection.addItems(items); }, removeItem: function(item) { this.itemCollection.removeItem(item); }, clear: function() { this.itemCollection.clear(); }, setViewport: function(viewport) { if (this.viewport) { // TODO: unbind viewport events? } this.viewport = viewport; this.viewport.setItemRenderer(this.itemRenderer); // TODO: set viewport on current layout }, setLayout: function(layout) { if (this.layout) { this.layout.unbindCollectionEvents(); this.layout.unbindViewportEvents(); } this.layout = layout; this.layout.setItemCollection(this.itemCollection); this.layout.setViewport(this.viewport); } }); module.exports = Deck;
Create ItemRenderer from options passed to Deck
Create ItemRenderer from options passed to Deck
JavaScript
mit
pellucidanalytics/decks,pellucidanalytics/decks
--- +++ @@ -2,13 +2,14 @@ var EventEmitter = require("events").EventEmitter; var util = require("util"); var ItemCollection = require("./itemcollection"); +var ItemRenderer = require("./itemrenderer"); function Deck(options) { if (!(this instanceof Deck)) { return new Deck(options); } EventEmitter.call(this); this.itemCollection = options.itemCollection || new ItemCollection(options.items || []); - this.itemRenderer = options.itemRenderer; + this.itemRenderer = new ItemRenderer(options.itemRenderer); this.setViewport(options.viewport); // use default this.setLayout(options.layout); // use standard grid layout
0ffa589122d21ab32099ec377ddbab6be15a593a
lib/exec.js
lib/exec.js
'use strict'; var shell = require('shelljs'); var cmd = require('./cmd'); // Execute msbuild.exe with passed arguments module.exports = function exec(args) { process.exit(shell.exec(cmd(args)).code); }
'use strict'; var shell = require('shelljs'); var cmd = require('./cmd'); // Execute nuget.exe with passed arguments module.exports = function exec(args) { const result = shell.exec(cmd(args)).code; if (result !== 0) { console.log(); console.log(`NuGet failed. ERRORLEVEL '${result}'.'`) process.exit(result); } console.log('NuGet completed successfully.'); }
Fix handling of NuGet errors
Fix handling of NuGet errors
JavaScript
mit
TimMurphy/npm-nuget
--- +++ @@ -3,7 +3,13 @@ var shell = require('shelljs'); var cmd = require('./cmd'); -// Execute msbuild.exe with passed arguments +// Execute nuget.exe with passed arguments module.exports = function exec(args) { - process.exit(shell.exec(cmd(args)).code); + const result = shell.exec(cmd(args)).code; + if (result !== 0) { + console.log(); + console.log(`NuGet failed. ERRORLEVEL '${result}'.'`) + process.exit(result); + } + console.log('NuGet completed successfully.'); }
bc80e82a05c0a7b19e538ff3773f8966e1bf28f8
lib/main.js
lib/main.js
'use babel' const FS = require('fs') const Path = require('path') const {View} = require('./view') const callsite = require('callsite') import {guessName, installPackages, packagesToInstall} from './helpers' // Renamed for backward compatibility if (typeof window.__steelbrain_package_deps === 'undefined') { window.__steelbrain_package_deps = new Set() } export function install(name = null, enablePackages = false) { if (!name) { name = guessName(require('callsite')()[1].getFileName()) } const {toInstall, toEnable} = packagesToInstall(name) let promise = Promise.resolve() if (enablePackages && toEnable.length) { promise = toEnable.reduce(function(promise, name) { atom.packages.enablePackage(name) return atom.packages.activatePackage(name) }, promise) } if (toInstall.length) { const view = new View(name, toInstall) promise = Promise.all([view.show(), promise]).then(function() { return installPackages(toInstall, function(name, status) { if (status) { view.advance() } else { atom.notifications.addError(`Error Installing ${name}`, {detail: 'Something went wrong. Try installing this package manually.'}) } }) }) } return promise }
'use babel' const FS = require('fs') const Path = require('path') const {View} = require('./view') const callsite = require('callsite') import {guessName, installPackages, packagesToInstall} from './helpers' // Renamed for backward compatibility if (typeof window.__steelbrain_package_deps === 'undefined') { window.__steelbrain_package_deps = new Set() } export function install(name = null, enablePackages = false) { if (!name) { const filePath = require('callsite')()[1].getFileName() name = guessName(filePath) if (!name) { console.log(`Unable to get package name for file: ${filePath}`) return Promise.resolve() } } const {toInstall, toEnable} = packagesToInstall(name) let promise = Promise.resolve() if (enablePackages && toEnable.length) { promise = toEnable.reduce(function(promise, name) { atom.packages.enablePackage(name) return atom.packages.activatePackage(name) }, promise) } if (toInstall.length) { const view = new View(name, toInstall) promise = Promise.all([view.show(), promise]).then(function() { return installPackages(toInstall, function(name, status) { if (status) { view.advance() } else { atom.notifications.addError(`Error Installing ${name}`, {detail: 'Something went wrong. Try installing this package manually.'}) } }) }) } return promise }
Handle failure in name guessing
:art: Handle failure in name guessing
JavaScript
mit
steelbrain/package-deps,openlawlibrary/package-deps,steelbrain/package-deps
--- +++ @@ -12,7 +12,12 @@ export function install(name = null, enablePackages = false) { if (!name) { - name = guessName(require('callsite')()[1].getFileName()) + const filePath = require('callsite')()[1].getFileName() + name = guessName(filePath) + if (!name) { + console.log(`Unable to get package name for file: ${filePath}`) + return Promise.resolve() + } } const {toInstall, toEnable} = packagesToInstall(name) let promise = Promise.resolve()
763e147ba669365e5f38f5b27c0dc1367087c031
lib/util.js
lib/util.js
"use strict"; var Class = require("./Class"); var CompileError = exports.CompileError = Class.extend({ initialize: function () { switch (arguments.length) { case 2: // token, text this._filename = arguments[0].filename; this._pos = arguments[0].pos; this._message = arguments[1]; break; case 3: // filename, pos, text this._filename = arguments[0]; this._pos = arguments[1]; this._message = arguments[2]; default: throw new Error(); } }, getFilename: function () { return this._filename; }, getPosition: function () { return this._pos; }, toString: function () { return this._filename + "(" + this._pos + "):" + this._message; } }); var Util = exports.Util = Class.extend({ $serializeArray: function (a) { if (a == null) return null; var ret = []; for (var i = 0; i < a.length; ++i) ret[i] = a[i].serialize(); return ret; }, $serializeNullable: function (v) { if (v == null) return null; return v.serialize(); } });
"use strict"; var Class = require("./Class"); var CompileError = exports.CompileError = Class.extend({ initialize: function () { switch (arguments.length) { case 2: // token, text this._filename = arguments[0].filename; this._pos = arguments[0].pos; this._message = arguments[1]; break; case 3: // filename, pos, text this._filename = arguments[0]; this._pos = arguments[1]; this._message = arguments[2]; break; default: throw new Error("Unrecognized arguments for CompileError: " + JSON.stringify( Array.prototype.slice.call(arguments) )); } }, getFilename: function () { return this._filename; }, getPosition: function () { return this._pos; }, toString: function () { return this._filename + "(" + this._pos + "):" + this._message; } }); var Util = exports.Util = Class.extend({ $serializeArray: function (a) { if (a == null) return null; var ret = []; for (var i = 0; i < a.length; ++i) ret[i] = a[i].serialize(); return ret; }, $serializeNullable: function (v) { if (v == null) return null; return v.serialize(); } }); // vim: set noexpandtab:
Fix error handling in lexer
Fix error handling in lexer
JavaScript
mit
mattn/JSX,jsx/JSX,jsx/JSX,dj31416/JSX,dj31416/JSX,mattn/JSX,jsx/JSX,jsx/JSX,dj31416/JSX,dj31416/JSX,jsx/JSX,dj31416/JSX
--- +++ @@ -15,8 +15,9 @@ this._filename = arguments[0]; this._pos = arguments[1]; this._message = arguments[2]; + break; default: - throw new Error(); + throw new Error("Unrecognized arguments for CompileError: " + JSON.stringify( Array.prototype.slice.call(arguments) )); } }, @@ -52,3 +53,4 @@ } }); +// vim: set noexpandtab:
581b1239c070873fbede643c04b654067d5468a5
src/redux/__tests__/random.test.js
src/redux/__tests__/random.test.js
import { expect } from 'chai'; import Immutable from 'immutable'; import { createReducer } from 'rook/lib/redux/createStore'; import reducers from '../modules'; const reducer = createReducer(reducers.random); describe('redux', () => { describe('reducers', () => { describe('random', () => { const initialState = Immutable.fromJS({}); it('handles loadOk', () => { const curDate = new Date().toString(); const newState = reducer(initialState, { type: 'random/loadOk', result: { number: 0.5, time: curDate } }); expect(newState.toJS()).to.deep.equal({ number: 0.5, time: curDate }); }); }); }); });
import { expect } from 'chai'; import Immutable from 'immutable'; import createReducer from 'rook/lib/redux/createReducer'; import reducers from '../modules'; const reducer = createReducer(reducers.random); describe('redux', () => { describe('reducers', () => { describe('random', () => { const initialState = Immutable.fromJS({}); it('handles loadOk', () => { const curDate = new Date().toString(); const newState = reducer(initialState, { type: 'random/loadOk', result: { number: 0.5, time: curDate } }); expect(newState.toJS()).to.deep.equal({ number: 0.5, time: curDate }); }); }); }); });
Update path to createReducer function
Update path to createReducer function
JavaScript
mit
apazzolini/rook-starter
--- +++ @@ -1,6 +1,6 @@ import { expect } from 'chai'; import Immutable from 'immutable'; -import { createReducer } from 'rook/lib/redux/createStore'; +import createReducer from 'rook/lib/redux/createReducer'; import reducers from '../modules'; const reducer = createReducer(reducers.random);
a92dcb2c0c3b6fb4f79de28c18b3b0dd357d139d
app/components/text-search.js
app/components/text-search.js
export default Ember.TextField.extend(Ember.TargetActionSupport, { change: function() { this.triggerAction({ action: 'search' }); }, insertNewline: function() { this.triggerAction({ action: 'search' }); } });
export default Ember.TextField.extend(Ember.TargetActionSupport, { change: function() { this.triggerAction({ action: 'search' }); } });
Fix for search not working when pressing the enter key.
Fix for search not working when pressing the enter key.
JavaScript
mit
HospitalRun/hospitalrun-frontend,HospitalRun/hospitalrun-frontend,HospitalRun/hospitalrun-frontend,HospitalRun/hospitalrun-frontend
--- +++ @@ -3,11 +3,5 @@ this.triggerAction({ action: 'search' }); - }, - - insertNewline: function() { - this.triggerAction({ - action: 'search' - }); } });
35a6c36ed93b5e45026707925851c1792099aff6
test/commands/domains/index.js
test/commands/domains/index.js
'use strict'; let nock = require('nock'); let cmd = require('../../../commands/domains'); let expect = require('chai').expect; describe('domains', function() { beforeEach(() => cli.mockConsole()); it('shows the domains', function() { let api = nock('https://api.heroku.com:443') .get('/apps/myapp/domains') .reply(200, [ {"cname": "myapp.com", "hostname": "myapp.com", "kind": "custom"}, {"cname": null, "hostname": "myapp.herokuapp.com", "kind": "heroku"}, ]); return cmd.run({app: 'myapp', flags: {}}) .then(() => expect(cli.stdout).to.equal(`=== myapp Heroku Domain myapp.herokuapp.com === myapp Custom Domains Domain Name DNS Target ─────────── ────────── myapp.com myapp.com `)) .then(() => api.done()); }); });
'use strict'; let nock = require('nock'); let cmd = require('../../../commands/domains'); let expect = require('chai').expect; describe('domains', function() { beforeEach(() => cli.mockConsole()); it('shows the domains', function() { let api = nock('https://api.heroku.com:443') .get('/apps/myapp/domains') .reply(200, [ {"cname": "myapp.com", "hostname": "myapp.com", "kind": "custom"}, {"cname": null, "hostname": "myapp.herokuapp.com", "kind": "heroku"}, ]); return cmd.run({app: 'myapp', flags: {}}) .then(() => expect(cli.stdout).to.equal(`=== myapp Heroku Domain myapp.herokuapp.com === myapp Custom Domains Domain Name DNS Target ─────────── ────────── myapp.com myapp.com `)) .then(() => api.done()); }); });
Fix domains test after pull & npm install
Fix domains test after pull & npm install
JavaScript
isc
heroku/heroku-apps,heroku/heroku-apps
--- +++ @@ -21,7 +21,7 @@ === myapp Custom Domains Domain Name DNS Target ─────────── ────────── -myapp.com myapp.com +myapp.com myapp.com `)) .then(() => api.done()); });
6772db0ad6d5b4733a9101537795f5fb9dfe3fe1
src/common/core.js
src/common/core.js
var d3 = window.d3; var previousD3ma = window.d3.ma; var d3ma = d3.ma = {}; d3ma.noConflict = function() { window.d3ma= previousD3ma; return d3ma; }; d3ma.assert = function(test, message) { if(test) { return; } throw new Error('[d3.ma] ' + message); }; d3ma.assert(d3, 'd3.js is required'); d3ma.assert( typeof d3.version === 'string' && d3.version.match(/^3/), 'd3.js version 3 is required' ); d3.ma.version = '0.1.0';
var d3 = window.d3; var previousD3ma = window.d3.ma; var d3ma = d3.ma = {}; d3ma.noConflict = function() { window.d3ma= previousD3ma; return d3ma; }; d3ma.assert = function(test, message) { if(test) { return; } throw new Error('[d3.ma] ' + message); }; d3ma.assert(d3, 'd3.js is required'); d3ma.assert( typeof d3.version === 'string' && d3.version.match(/^3/), 'd3.js version 3 is required' ); d3ma.version = '0.1.0';
Update the d3ma var, make it more global like d3.ma
Update the d3ma var, make it more global like d3.ma
JavaScript
mit
mattma/d3.ma.js
--- +++ @@ -18,7 +18,7 @@ d3ma.assert( typeof d3.version === 'string' && d3.version.match(/^3/), 'd3.js version 3 is required' ); -d3.ma.version = '0.1.0'; +d3ma.version = '0.1.0';
0483e4269e66992329f0c451d2188a2230f7b81c
static/js/components/CourseList.js
static/js/components/CourseList.js
import React from 'react'; import { makeCourseStatusDisplay } from '../util/util'; class CourseList extends React.Component { render() { const { dashboard, courseList } = this.props; let dashboardLookup = {}; for (let course of dashboard.courses) { dashboardLookup[course.id] = course; } let tables = courseList.programList.map(program => { let courses = courseList.courseList. filter(course => course.program === program.id). map(course => dashboardLookup[course.id]). filter(course => course); return <div key={program.id}> <ul className="course-list-header"> <li>{program.title}</li> <li /> </ul> { courses.map(course => <ul key={course.id} className={"course-list-status-" + course.status}> <li> {course.title} </li> <li> {makeCourseStatusDisplay(course)} </li> </ul> ) } </div>; }); return <div className="course-list"> {tables} </div>; } } CourseList.propTypes = { courseList: React.PropTypes.object.isRequired, dashboard: React.PropTypes.object.isRequired, }; export default CourseList;
import React from 'react'; import _ from 'lodash'; import { makeCourseStatusDisplay } from '../util/util'; class CourseList extends React.Component { render() { const { dashboard } = this.props; let sortedCourses = _.sortBy(dashboard.courses, 'position_in_program'); let table = sortedCourses.map(course => { // id number is not guaranteed to exist here so we need to use the whole // object to test uniqueness // TODO: fix this when we refactor return <ul key={JSON.stringify(course)} className={"course-list-status-" + course.status} > <li> {course.title} </li> <li> {makeCourseStatusDisplay(course)} </li> </ul>; }); return <div className="course-list"> <ul className="course-list-header"> <li /> <li /> </ul> {table} </div>; } } CourseList.propTypes = { courseList: React.PropTypes.object.isRequired, dashboard: React.PropTypes.object.isRequired, }; export default CourseList;
Use only information from dashboard API for dashboard display.
Use only information from dashboard API for dashboard display. This fixes a problem with course run ids which may not exist
JavaScript
bsd-3-clause
mitodl/micromasters,mitodl/micromasters,mitodl/micromasters,mitodl/micromasters
--- +++ @@ -1,43 +1,37 @@ import React from 'react'; +import _ from 'lodash'; import { makeCourseStatusDisplay } from '../util/util'; class CourseList extends React.Component { render() { - const { dashboard, courseList } = this.props; - let dashboardLookup = {}; - for (let course of dashboard.courses) { - dashboardLookup[course.id] = course; - } + const { dashboard } = this.props; - let tables = courseList.programList.map(program => { - let courses = courseList.courseList. - filter(course => course.program === program.id). - map(course => dashboardLookup[course.id]). - filter(course => course); + let sortedCourses = _.sortBy(dashboard.courses, 'position_in_program'); - return <div key={program.id}> - <ul className="course-list-header"> - <li>{program.title}</li> - <li /> - </ul> - { - courses.map(course => - <ul key={course.id} className={"course-list-status-" + course.status}> - <li> - {course.title} - </li> - <li> - {makeCourseStatusDisplay(course)} - </li> - </ul> - ) - } - </div>; + let table = sortedCourses.map(course => { + // id number is not guaranteed to exist here so we need to use the whole + // object to test uniqueness + // TODO: fix this when we refactor + return <ul + key={JSON.stringify(course)} + className={"course-list-status-" + course.status} + > + <li> + {course.title} + </li> + <li> + {makeCourseStatusDisplay(course)} + </li> + </ul>; }); return <div className="course-list"> - {tables} + <ul className="course-list-header"> + <li /> + <li /> + </ul> + {table} </div>; } }
1505e4cae9730677d513c81d4cd66df1017e09e5
src/elementType.js
src/elementType.js
import React from 'react'; import createChainableTypeChecker from './utils/createChainableTypeChecker'; function elementType(props, propName, componentName, location, propFullName) { const propValue = props[propName]; const propType = typeof propValue; if (React.isValidElement(propValue)) { return new Error( `Invalid ${location} \`${propFullName}\` of type ReactElement ` + `supplied to \`${componentName}\`, expected an element type (a string ` + 'or a ReactClass).' ); } if (propType !== 'function' && propType !== 'string') { return new Error( `Invalid ${location} \`${propFullName}\` of value \`${propValue}\` ` + `supplied to \`${componentName}\`, expected an element type (a string ` + 'or a ReactClass).' ); } return null; } export default createChainableTypeChecker(elementType);
import React from 'react'; import createChainableTypeChecker from './utils/createChainableTypeChecker'; function elementType(props, propName, componentName, location, propFullName) { const propValue = props[propName]; const propType = typeof propValue; if (React.isValidElement(propValue)) { return new Error( `Invalid ${location} \`${propFullName}\` of type ReactElement ` + `supplied to \`${componentName}\`, expected an element type (a string ` + 'or a ReactClass).' ); } const isSpecial = propValue && propValue.$$typeof; if (propType !== 'function' && propType !== 'string' && !isSpecial) { return new Error( `Invalid ${location} \`${propFullName}\` of value \`${propValue}\` ` + `supplied to \`${componentName}\`, expected an element type (a string ` + ', component class, or function component).' ); } return null; } export default createChainableTypeChecker(elementType);
Update for new React types, context, forwardRef, etc
Update for new React types, context, forwardRef, etc
JavaScript
mit
react-bootstrap/prop-types-extra
--- +++ @@ -5,7 +5,7 @@ function elementType(props, propName, componentName, location, propFullName) { const propValue = props[propName]; const propType = typeof propValue; - + if (React.isValidElement(propValue)) { return new Error( `Invalid ${location} \`${propFullName}\` of type ReactElement ` + @@ -13,12 +13,13 @@ 'or a ReactClass).' ); } - - if (propType !== 'function' && propType !== 'string') { + + const isSpecial = propValue && propValue.$$typeof; + if (propType !== 'function' && propType !== 'string' && !isSpecial) { return new Error( `Invalid ${location} \`${propFullName}\` of value \`${propValue}\` ` + `supplied to \`${componentName}\`, expected an element type (a string ` + - 'or a ReactClass).' + ', component class, or function component).' ); }
bf6234ad7030b45fe2ae70c67d720b6fd1898fe9
src/lib/Twilio.js
src/lib/Twilio.js
require('dotenv').config(); export const sendSMS = (message) => { const formData = new FormData() formData.append('body', encodeURIComponent(message)) formData.append('to', encodeURIComponent(process.env.TO_PHONE)) formData.append('from', encodeURIComponent(process.env.FROM_PHONE)) const options = { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', 'Authorization': 'Basic ' + encodeURIComponent(process.env.SID + ':' + process.env.TOKEN) }, body: formData } fetch( 'https://api.twilio.com/2010-04-01/Accounts/' + process.env.SID + '/Messages.json', options ).then((response) => { //Parse JSON response console.log(response.json()) }) }
require('dotenv').config() const twilio = require('twilio') const client = new twilio(process.env.SID, process.env.TOKEN) const sendSMS = (message) => { client.api.messages.create({ body: message, to: process.env.TO_PHONE, from: process.env.FROM_PHONE }) .then((mes) => { console.log(mes.sid) }) .catch((err) => { console.log(err) }) } module.exports = sendSMS
Add sendSMS method and confirm that it works
Add sendSMS method and confirm that it works
JavaScript
mit
severnsc/brewing-app,severnsc/brewing-app
--- +++ @@ -1,30 +1,21 @@ -require('dotenv').config(); +require('dotenv').config() +const twilio = require('twilio') +const client = new twilio(process.env.SID, process.env.TOKEN) -export const sendSMS = (message) => { +const sendSMS = (message) => { - const formData = new FormData() - - formData.append('body', encodeURIComponent(message)) - - formData.append('to', encodeURIComponent(process.env.TO_PHONE)) - - formData.append('from', encodeURIComponent(process.env.FROM_PHONE)) - - const options = { - method: 'POST', - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - 'Authorization': 'Basic ' + encodeURIComponent(process.env.SID + ':' + process.env.TOKEN) - }, - body: formData - } - - fetch( - 'https://api.twilio.com/2010-04-01/Accounts/' + process.env.SID + '/Messages.json', - options - ).then((response) => { - //Parse JSON response - console.log(response.json()) + client.api.messages.create({ + body: message, + to: process.env.TO_PHONE, + from: process.env.FROM_PHONE + }) + .then((mes) => { + console.log(mes.sid) + }) + .catch((err) => { + console.log(err) }) } + +module.exports = sendSMS
5ca0961dbd3c171a248452726e9f283a955babb8
src/App.js
src/App.js
import React, { Component } from 'react'; import logo from './logo.svg'; import './App.css'; class App extends Component { render() { return ( <div className="App"> <div className="App-header"> <img src={logo} className="App-logo" alt="logo" /> <h2>Welcome to React</h2> </div> <p className="App-intro"> To get started, edit <code>src/App.js</code> and save to reload. </p> </div> ); } } var tw = 1500000; function getTimeRemaining(consumed = 0) { var t = tw - consumed; tw = t; var minute = Math.floor((t/1000/60) % 60); var seconds = Math.floor((t/1000) % 60); return { minute, seconds }; } function initializedClock() { var timeInterval = setInterval(() => { var timex = getTimeRemaining(1000); console.log(timex.minute,' : ',timex.seconds); if (timex.t <= 0) { clearInterval(timeInterval); } }, 1000); } initializedClock(); export default App;
import React, { Component } from 'react'; import logo from './logo.svg'; import './App.css'; class App extends Component { render() { return ( <div className="App"> <div className="App-header"> <img src={logo} className="App-logo" alt="logo" /> <h2>Welcome to React</h2> </div> <p className="App-intro"> To get started, edit <code>src/App.js</code> and save to reload. </p> </div> ); } } var tw = 1500000; function getTimeRemaining(consumed = 0) { var t = tw - consumed; tw = t; var minute = Math.floor((t/1000/60) % 60); var seconds = Math.floor((t/1000) % 60); return { minute, seconds }; } function initializedClock() { var timeInterval = setInterval(() => { var timex = getTimeRemaining(1000); console.log(timex.minute,' : ',('0' + timex.seconds).slice(-2)); if (timex.t <= 0) { clearInterval(timeInterval); } }, 1000); } initializedClock(); export default App;
Add leading to zeros to single digit
Add leading to zeros to single digit
JavaScript
mit
cauldyclark15/pomodoro,cauldyclark15/pomodoro
--- +++ @@ -33,7 +33,7 @@ function initializedClock() { var timeInterval = setInterval(() => { var timex = getTimeRemaining(1000); - console.log(timex.minute,' : ',timex.seconds); + console.log(timex.minute,' : ',('0' + timex.seconds).slice(-2)); if (timex.t <= 0) { clearInterval(timeInterval); }
fb083580920b89bda2cbfc0d3be5ad5c2a0ca074
src/jwt-request.js
src/jwt-request.js
var JWTHelper = require('./jwt-helper'); var JWTConfig = require('./jwt-config'); var JWTRequest = { setAuthorizationHeader(options, token) { if (!options.headers) options.headers = {}; options.headers[JWTConfig.authHeader] = `${JWTConfig.authPrefix} ${token}`; return options; }, handleUnAuthorizedFetch(url, options) { return fetch(url, options).then((response) => response.json()); }, handleAuthorizedFetch(url, options) { return new Promise((resolve, reject) => { JWTHelper.getToken().then((token) => { if (token && !JWTHelper.isTokenExpired(token)) { options = this.setAuthorizationHeader(options, token); fetch(url, options).then((response) => { resolve(response.json()) }); } else { reject('Token is either not valid or has expired.'); } }) }) }, fetch(url, options, skipAuthorization) { options = options || {}; if (skipAuthorization) { return this.handleUnAuthorizedFetch(url, options); } else { return this.handleAuthorizedFetch(url, options); } } }; module.exports = JWTRequest;
var JWTHelper = require('./jwt-helper'); var JWTConfig = require('./jwt-config'); var JWTRequest = { setAuthorizationHeader(options, token) { if (!options.headers) options.headers = {}; options.headers[JWTConfig.authHeader] = `${JWTConfig.authPrefix} ${token}`; return options; }, handleUnAuthorizedFetch(url, options) { return fetch(url, options).then((response) => response.json()); }, handleAuthorizedFetch(url, options) { return new Promise((resolve, reject) => { JWTHelper.getToken().then((token) => { if (token && !JWTHelper.isTokenExpired(token)) { options = this.setAuthorizationHeader(options, token); fetch(url, options).then((response) => { resolve(response.json()) }); } else { reject('Token is either not valid or has expired.'); } }) }) }, fetch(url, options) { options = options || {}; if (options.skipAuthorization) { return this.handleUnAuthorizedFetch(url, options); } else { return this.handleAuthorizedFetch(url, options); } } }; module.exports = JWTRequest;
Add skipAuthorization to options instead of a variable in our method
Add skipAuthorization to options instead of a variable in our method
JavaScript
mit
iDay/react-native-http,iktw/react-native-http
--- +++ @@ -28,10 +28,10 @@ }) }, - fetch(url, options, skipAuthorization) { + fetch(url, options) { options = options || {}; - if (skipAuthorization) { + if (options.skipAuthorization) { return this.handleUnAuthorizedFetch(url, options); } else { return this.handleAuthorizedFetch(url, options);
bb89d991e9495f15d6fabed5be9441177003b716
bin/bin-executor.js
bin/bin-executor.js
'use strict'; const yarpm = require('../lib'); const argv = process.argv.slice(2); exports.run = function run(options) { yarpm(argv, Object.assign({stdin: process.stdin, stdout: process.stdout, stderr: process.stderr}, options || {})) // Not sure why, but sometimes the process never exits on Git Bash (MINGW64) .then(({code}) => process.exit(code)) .catch(err => { console.error(err); process.exit(1); }); };
'use strict'; const yarpm = require('../lib'); const argv = process.argv.slice(2); exports.run = function run(options) { yarpm(argv, Object.assign({stdin: process.stdin, stdout: process.stdout, stderr: process.stderr}, options || {})) // Not sure why, but sometimes the process never exits on Git Bash (MINGW64) .then((res) => process.exit(res.code)) .catch(err => { console.error(err); process.exit(1); }); };
Make it work on Node 4
Make it work on Node 4 Node 4 does not support destructuring.
JavaScript
mit
BendingBender/yarpm,BendingBender/yarpm
--- +++ @@ -7,7 +7,7 @@ exports.run = function run(options) { yarpm(argv, Object.assign({stdin: process.stdin, stdout: process.stdout, stderr: process.stderr}, options || {})) // Not sure why, but sometimes the process never exits on Git Bash (MINGW64) - .then(({code}) => process.exit(code)) + .then((res) => process.exit(res.code)) .catch(err => { console.error(err); process.exit(1);
3f7dba1f6063671e1a0ec6f9b547c7aa05b85260
src/js/directives/textfit.js
src/js/directives/textfit.js
'use strict'; // Directive for using http://www.jacklmoore.com/autosize/ angular.module('Teem') .directive('textfit',[ '$timeout', function($timeout) { return { link: function(scope, element, attrs) { textFit(element); scope.$watch(attrs.ngBind, function() { $timeout(() => { textFit(element); }, 1000); // There should be a better way to do this :-( }); } }; }]);
'use strict'; // Directive for using http://www.jacklmoore.com/autosize/ angular.module('Teem') .directive('textfit',[ '$timeout', function($timeout) { return { link: function(scope, element, attrs) { scope.$watch(attrs.ngBind, function() { $timeout(() => { textFit(element); }, 1000); // There should be a better way to do this :-( }); } }; }]);
Remove first call to textFit
Remove first call to textFit
JavaScript
agpl-3.0
P2Pvalue/teem,P2Pvalue/teem,P2Pvalue/pear2pear,Grasia/teem,P2Pvalue/teem,Grasia/teem,P2Pvalue/pear2pear,Grasia/teem
--- +++ @@ -7,8 +7,6 @@ function($timeout) { return { link: function(scope, element, attrs) { - textFit(element); - scope.$watch(attrs.ngBind, function() { $timeout(() => { textFit(element);
115a2e1b9c0cad8c5a05c13a73569daff11c76a3
root/test/spec/controllers/action.js
root/test/spec/controllers/action.js
'use strict'; describe('Controller: ActionCtrl', function () { // load the controller's module beforeEach(module('nameApp')); var ActionCtrl, scope; // Initialize the controller and a mock scope beforeEach(inject(function ($controller, $rootScope) { scope = $rootScope.$new(); ActionCtrl = $controller('ActionCtrl', { $scope: scope }); })); it('should attach a list of awesomeThings to the scope', function () { expect(scope.awesomeThings.length).toBe(3); }); });
'use strict'; describe('Controller: ActionCtrl', function () { // load the controller's module beforeEach(module('geboHai')); var ActionCtrl, scope; // Initialize the controller and a mock scope beforeEach(inject(function ($controller, $rootScope) { scope = $rootScope.$new(); ActionCtrl = $controller('ActionCtrl', { $scope: scope }); })); it('should attach a list of awesomeThings to the scope', function () { expect(scope.awesomeThings.length).toBe(3); }); });
Correct app name in ActionCtrl tests
Correct app name in ActionCtrl tests
JavaScript
mit
RaphaelDeLaGhetto/grunt-init-gebo-hai
--- +++ @@ -3,7 +3,7 @@ describe('Controller: ActionCtrl', function () { // load the controller's module - beforeEach(module('nameApp')); + beforeEach(module('geboHai')); var ActionCtrl, scope;
1c0597d51a0ff4646bff7ffe895cd7ac8c1e77c2
client/components/Loading.js
client/components/Loading.js
import React from 'react'; import { CircularProgress } from 'material-ui/Progress'; import Text from './Text'; const Loading = ({ message }) => ( <div className="loading"> <CircularProgress size={300} thickness={7} mode="indeterminate" /> <Text>{message}</Text> <style jsx>{` .loading { width: 100%; text-align: center; } `}</style> </div> ); export default Loading;
import React from 'react'; import { CircularProgress } from 'material-ui/Progress'; import Text from './Text'; const Loading = ({ message }) => ( <div className="loading"> <CircularProgress size={300} mode="indeterminate" /> <Text>{message}</Text> <style jsx>{` .loading { width: 100%; text-align: center; } `}</style> </div> ); export default Loading;
Remove obsolete prop from CircularProgress.
client: Remove obsolete prop from CircularProgress.
JavaScript
mit
u-wave/hub
--- +++ @@ -4,11 +4,7 @@ const Loading = ({ message }) => ( <div className="loading"> - <CircularProgress - size={300} - thickness={7} - mode="indeterminate" - /> + <CircularProgress size={300} mode="indeterminate" /> <Text>{message}</Text> <style jsx>{` .loading {
ae3c0d72e26ec037aac7290fbb248386e35a04c9
scripts/get-latest-platform-tests.js
scripts/get-latest-platform-tests.js
"use strict"; if (process.env.NO_UPDATE) { process.exit(0); } const path = require("path"); const fs = require("fs"); const request = require("request"); // Pin to specific version, reflecting the spec version in the readme. // // To get the latest commit: // 1. Go to https://github.com/w3c/web-platform-tests/tree/master/url // 2. Press "y" on your keyboard to get a permalink // 3. Copy the commit hash const commitHash = "5de931eafc9ca8d6de6a138015311812943755ac"; const sourceURL = `https://raw.githubusercontent.com/w3c/web-platform-tests/${commitHash}/url/urltestdata.json`; const setterSourceURL = `https://raw.githubusercontent.com/w3c/web-platform-tests/${commitHash}/url/setters_tests.json`; const targetDir = path.resolve(__dirname, "..", "test", "web-platform-tests"); request.get(sourceURL) .pipe(fs.createWriteStream(path.resolve(targetDir, "urltestdata.json"))); request.get(setterSourceURL) .pipe(fs.createWriteStream(path.resolve(targetDir, "setters_tests.json")));
"use strict"; if (process.env.NO_UPDATE) { process.exit(0); } const path = require("path"); const fs = require("fs"); const request = require("request"); // Pin to specific version, reflecting the spec version in the readme. // // To get the latest commit: // 1. Go to https://github.com/w3c/web-platform-tests/tree/master/url // 2. Press "y" on your keyboard to get a permalink // 3. Copy the commit hash const commitHash = "634175d64d1f3ec26e2a674b294e71738624c77c"; const sourceURL = `https://raw.githubusercontent.com/w3c/web-platform-tests/${commitHash}/url/urltestdata.json`; const setterSourceURL = `https://raw.githubusercontent.com/w3c/web-platform-tests/${commitHash}/url/setters_tests.json`; const targetDir = path.resolve(__dirname, "..", "test", "web-platform-tests"); request.get(sourceURL) .pipe(fs.createWriteStream(path.resolve(targetDir, "urltestdata.json"))); request.get(setterSourceURL) .pipe(fs.createWriteStream(path.resolve(targetDir, "setters_tests.json")));
Update to include latest web platform tests
Update to include latest web platform tests Includes https://github.com/w3c/web-platform-tests/pull/5146.
JavaScript
mit
jsdom/whatwg-url,jsdom/whatwg-url,jsdom/whatwg-url
--- +++ @@ -14,7 +14,7 @@ // 1. Go to https://github.com/w3c/web-platform-tests/tree/master/url // 2. Press "y" on your keyboard to get a permalink // 3. Copy the commit hash -const commitHash = "5de931eafc9ca8d6de6a138015311812943755ac"; +const commitHash = "634175d64d1f3ec26e2a674b294e71738624c77c"; const sourceURL = `https://raw.githubusercontent.com/w3c/web-platform-tests/${commitHash}/url/urltestdata.json`; const setterSourceURL = `https://raw.githubusercontent.com/w3c/web-platform-tests/${commitHash}/url/setters_tests.json`;
a2b90b5f99c4b4bf0b9049001b1288cc57128259
src/routes/index.js
src/routes/index.js
const router = require('express').Router() const nonUser = require('./non-user') const user = require('./user-only') router.use((req, res, next) => { let loggedIn = false if (req.session.user) { loggedIn = true } res.locals = {loggedIn} next() }) router.use('/', nonUser) router.use('/', user) module.exports = router
const router = require('express').Router() const nonUser = require('./non-user') const user = require('./user-only') router.use((req, res, next) => { let loggedIn = false let userId = null if (req.session.user) { loggedIn = true userId = req.session.user.user_id } res.locals = {loggedIn, userId} console.log(res.locals); next() }) router.use('/', nonUser) router.use('/', user) module.exports = router
Add user id of logged in user to res.locals
Add user id of logged in user to res.locals
JavaScript
mit
Maighdlyn/phase-4-challenge,Maighdlyn/phase-4-challenge,Maighdlyn/phase-4-challenge
--- +++ @@ -4,10 +4,13 @@ router.use((req, res, next) => { let loggedIn = false + let userId = null if (req.session.user) { loggedIn = true + userId = req.session.user.user_id } - res.locals = {loggedIn} + res.locals = {loggedIn, userId} + console.log(res.locals); next() })
b23cdded1bd8067bbd6312dc38379bf7f22b5769
src/scripts/main.js
src/scripts/main.js
/*global jQuery:false*/ (function($) { function equalize() { var elements = $('.left, .right'); var max_height = Math.max.apply( null, elements.map(function(index, elt) { return $(elt).height(); }) ); elements.each(function(index, elt) { var last_child = $('section', elt).last()[0]; $(last_child).css({}); $(elt).height(max_height); var parent_bbox = elt.getBoundingClientRect(); var last_child_bbox = last_child.getBoundingClientRect(); var d = parent_bbox.bottom - last_child_bbox.bottom; $(last_child).height(last_child_bbox.height + d); }); } $(window) .load(equalize) .on('resize', equalize); })(jQuery);
/*global jQuery:false*/ (function($) { function equalize() { var elements = $('.left, .right'); var max_height = Math.max.apply( null, elements.map(function(index, elt) { return $(elt).height(); }) ); elements.each(function(index, elt) { var last_child = $('section', elt).last()[0]; $(last_child).css({}); $(elt).height(max_height); var parent_bbox = elt.getBoundingClientRect(); var last_child_bbox = last_child.getBoundingClientRect(); var d = parent_bbox.bottom - last_child_bbox.bottom; $(last_child).height(last_child_bbox.height + d); }); } function before_print() { $('.left, .right').each(function(index, elt) { $(elt).add($('section', elt).last()[0]).removeAttr('style'); }); } $(window) .load(equalize) .on('resize', equalize); if (window.matchMedia) { window.matchMedia('print').addListener(function(mql) { if (mql.matches) { before_print(); } else { equalize(); } }); } })(jQuery);
Disable column equalization before print.
Disable column equalization before print.
JavaScript
mit
NealRame/CV,NealRame/Blog,NealRame/Blog,NealRame/Blog,NealRame/CV
--- +++ @@ -21,7 +21,24 @@ $(last_child).height(last_child_bbox.height + d); }); } + + function before_print() { + $('.left, .right').each(function(index, elt) { + $(elt).add($('section', elt).last()[0]).removeAttr('style'); + }); + } + $(window) .load(equalize) .on('resize', equalize); + + if (window.matchMedia) { + window.matchMedia('print').addListener(function(mql) { + if (mql.matches) { + before_print(); + } else { + equalize(); + } + }); + } })(jQuery);
0e00766548766aa280a0a5410c4019745e20c46e
lib/transport/browser/websocket.js
lib/transport/browser/websocket.js
'use strict'; var Driver = global.WebSocket || global.MozWebSocket; if (Driver) { module.exports = function WebSocketBrowserDriver(url) { return new Driver(url); }; }
'use strict'; var Driver = global.WebSocket || global.MozWebSocket; if (Driver) { module.exports = function WebSocketBrowserDriver(url) { return new Driver(url); }; } else { module.exports = undefined; }
FIX error with webpack when WebSocket not exists
FIX error with webpack when WebSocket not exists When building with webpack and you didn't define module.exports it will default to an empty object {} So when transport.enabled test !!WebSocketDriver it returns true instead of false.
JavaScript
mit
sockjs/sockjs-client,sockjs/sockjs-client,sockjs/sockjs-client
--- +++ @@ -5,4 +5,6 @@ module.exports = function WebSocketBrowserDriver(url) { return new Driver(url); }; +} else { + module.exports = undefined; }
8db5f375995f8b9f77679badab0e03beba9062c7
config/webpack/development.js
config/webpack/development.js
// Note: You must restart bin/webpack-watcher for changes to take effect const merge = require('webpack-merge') const common = require('./common.js') const { resolve } = require('path') const { devServer, publicPath, paths } = require('./configuration.js') module.exports = merge(common, { devtool: 'sourcemap', stats: { errorDetails: true }, output: { pathinfo: true }, devServer: { host: devServer.host, port: devServer.port, contentBase: resolve(paths.output, paths.entry), publicPath } })
// Note: You must restart bin/webpack-watcher for changes to take effect const merge = require('webpack-merge') const common = require('./common.js') const { resolve } = require('path') const { devServer, publicPath, paths } = require('./configuration.js') module.exports = merge(common, { devtool: 'sourcemap', stats: { errorDetails: true }, output: { pathinfo: true }, devServer: { host: devServer.host, port: devServer.port, contentBase: resolve(paths.output, paths.entry), proxy: {'/': 'http://localhost:9000'}, publicPath } })
Use webpack dev server as proxy to rails
Use webpack dev server as proxy to rails
JavaScript
agpl-3.0
jgraichen/mnemosyne-server,jgraichen/mnemosyne-server,jgraichen/mnemosyne-server
--- +++ @@ -21,6 +21,7 @@ host: devServer.host, port: devServer.port, contentBase: resolve(paths.output, paths.entry), + proxy: {'/': 'http://localhost:9000'}, publicPath } })
94f16a05a78b2bf71c01f47e2bb575cc68db709a
config/webpack/loaders/vue.js
config/webpack/loaders/vue.js
const { dev_server: devServer } = require('@rails/webpacker').config; const isProduction = process.env.NODE_ENV === 'production'; const inDevServer = process.argv.find(v => v.includes('webpack-dev-server')); const extractCSS = !(inDevServer && (devServer && devServer.hmr)) || isProduction; module.exports = { test: /\.vue(\.erb)?$/, use: [{ loader: 'vue-loader', options: {extractCSS, // Enabled to prevent annotations from incurring incorrect // offsets due to extra whitespace in templates // TODO - the next Vue release introduces an even more useful // type of whitespace trimming: https://github.com/vuejs/vue/issues/9208#issuecomment-450012518 preserveWhitespace: false} }] };
const { dev_server: devServer } = require('@rails/webpacker').config; const isProduction = process.env.NODE_ENV === 'production'; const inDevServer = process.argv.find(v => v.includes('webpack-dev-server')); const extractCSS = !(inDevServer && (devServer && devServer.hmr)) || isProduction; module.exports = { test: /\.vue(\.erb)?$/, use: [{ loader: 'vue-loader', options: {extractCSS, // Enabled to prevent annotations from incurring incorrect // offsets due to extra whitespace in templates whitespace: 'condense'} }] };
Use new Vue whitespace optimization
Use new Vue whitespace optimization
JavaScript
agpl-3.0
harvard-lil/h2o,harvard-lil/h2o,harvard-lil/h2o,harvard-lil/h2o
--- +++ @@ -11,8 +11,6 @@ options: {extractCSS, // Enabled to prevent annotations from incurring incorrect // offsets due to extra whitespace in templates - // TODO - the next Vue release introduces an even more useful - // type of whitespace trimming: https://github.com/vuejs/vue/issues/9208#issuecomment-450012518 - preserveWhitespace: false} + whitespace: 'condense'} }] };
575d973524bd2d953a9615c66dcf8e409e40bab9
console/server/node-server.js
console/server/node-server.js
const MONGOOSE_CONSOLE_DEFAULT_PORT = 8080; const PROMETHEUS_CONFIGURATION_PATH = '/configuration/prometheus.yml'; var express = require('express'); var bodyParser = require('body-parser'); var fs = require('fs'); var app = express(); var path = __dirname + ''; var port = process.env.CONSOLE_PORT || MONGOOSE_CONSOLE_DEFAULT_PORT; app.use(express.static(path)); app.use(bodyParser.json()); // NOTE: Supporting JSON-encoded bodies app.use(express.multipart()); // NOTE: We're saving Prometheus configuration via the server // NOTE: Configurating server to serve index.html since during the production ... // build Angular converts its html's to only one file. app.get('*', function(req, res) { res.sendFile(path + '/index.html'); }); app.post('/savefile', function (req, res) { var fileName = req.body.fileName; var fileContent = req.body.fileContent; var stream = fs.createWriteStream(fileName); stream.once('open', function () { stream.write(fileContent); stream.end(); }); fs.writeFile(PROMETHEUS_CONFIGURATION_PATH, fileContent, function(err) { if(err) { return console.log(err); } console.log("Prometheus configuration has been updated."); }); }); app.listen(port);
const MONGOOSE_CONSOLE_DEFAULT_PORT = 8080; const PROMETHEUS_CONFIGURATION_PATH = '/configuration/prometheus.yml'; var express = require('express'); var bodyParser = require('body-parser'); var fs = require('fs'); var cors = require('cors') var app = express(); var path = __dirname + ''; var port = process.env.CONSOLE_PORT || MONGOOSE_CONSOLE_DEFAULT_PORT; app.use(express.static(path)); app.use(bodyParser.json()); // NOTE: Supporting JSON-encoded bodies app.use(express.multipart()); // NOTE: We're saving Prometheus configuration via the server // NOTE: CORS configuration app.use(cors()) app.options('*', cors()); // NOTE: Configurating server to serve index.html since during the production ... // build Angular converts its html's to only one file. app.get('*', function(req, res) { res.sendFile(path + '/index.html'); }); app.post('/savefile', function (req, res) { var fileName = req.body.fileName; var fileContent = req.body.fileContent; // var stream = fs.createWriteStream(fileName); // stream.once('open', function () { // stream.write(fileContent); // stream.end(); // }); console.log("File name:", fileName); console.log("File content: ", fileContent); fs.writeFile(PROMETHEUS_CONFIGURATION_PATH, fileContent, function(err) { if(err) { return console.log(err); } console.log("Prometheus configuration has been updated."); }); }); app.listen(port);
Add CORS to node server.
Add CORS to node server.
JavaScript
mit
emc-mongoose/console,emc-mongoose/console,emc-mongoose/console
--- +++ @@ -4,6 +4,7 @@ var express = require('express'); var bodyParser = require('body-parser'); var fs = require('fs'); +var cors = require('cors') var app = express(); @@ -13,6 +14,9 @@ app.use(express.static(path)); app.use(bodyParser.json()); // NOTE: Supporting JSON-encoded bodies app.use(express.multipart()); // NOTE: We're saving Prometheus configuration via the server +// NOTE: CORS configuration +app.use(cors()) +app.options('*', cors()); // NOTE: Configurating server to serve index.html since during the production ... // build Angular converts its html's to only one file. @@ -24,11 +28,13 @@ var fileName = req.body.fileName; var fileContent = req.body.fileContent; - var stream = fs.createWriteStream(fileName); - stream.once('open', function () { - stream.write(fileContent); - stream.end(); - }); + // var stream = fs.createWriteStream(fileName); + // stream.once('open', function () { + // stream.write(fileContent); + // stream.end(); + // }); + console.log("File name:", fileName); + console.log("File content: ", fileContent); fs.writeFile(PROMETHEUS_CONFIGURATION_PATH, fileContent, function(err) { if(err) {
b30815c324d90e99bb3fca25eb6d00b5cdfef4e8
markup/components/header/header.js
markup/components/header/header.js
/* eslint-disable */ $('.nav-toggle').click(function (e) { $('.nav-menu').slideToggle(500); }); debounce(function(){ $(window).resize(function(){ if($(window).width() > 720){ $('.nav-menu').removeAttr('style'); } }); }, 200); /* eslint-enable */
/* eslint-disable */ $('.nav-toggle').click(function (e) { $('.nav-menu').slideToggle(500); }); $(window).resize(function(){ if($(window).width() > 720){ $('.nav-menu').removeAttr('style'); } }); /* eslint-enable */
FIX - поправлен JS для адаптива меню
FIX - поправлен JS для адаптива меню
JavaScript
mit
agolomazov/bouncy,agolomazov/bouncy
--- +++ @@ -3,11 +3,9 @@ $('.nav-menu').slideToggle(500); }); -debounce(function(){ - $(window).resize(function(){ - if($(window).width() > 720){ - $('.nav-menu').removeAttr('style'); - } - }); -}, 200); +$(window).resize(function(){ + if($(window).width() > 720){ + $('.nav-menu').removeAttr('style'); + } +}); /* eslint-enable */
415b7d0250887764ee9836ee823be07d45708173
api/models/Y.js
api/models/Y.js
var keystone = require('keystone'); var Types = keystone.Field.Types; /** * Y Model * ========== */ var Y = new keystone.List('Y'); Y.add({ name: { type: Types.Name, required: true, index: true }, email: { type: Types.Email, initial: true, required: true, index: true }, password: { type: Types.Password, initial: true, required: true, hidden: true, }, }, 'Permissions', { isAdmin: { type: Boolean, label: 'Can access Keystone', index: true }, }); // Provide access to Keystone Y.schema.virtual('canAccessKeystone').get(function () { return this.isAdmin; }); /** * Relationships */ Y.relationship({ ref: 'Post', path: 'posts', refPath: 'author' }); /** * Registration */ Y.defaultColumns = 'name, email, isAdmin'; Y.register();
var keystone = require('keystone'); var Types = keystone.Field.Types; /** * Y Model * ========== */ var Y = new keystone.List('Y'); Y.add({ name: { type: Types.Name, required: true, index: true }, email: { type: Types.Email, initial: true, required: true, index: true }, password: { type: Types.Password, initial: true, required: true, }, }, 'Permissions', { isAdmin: { type: Boolean, label: 'Can access Keystone', index: true }, }); // Provide access to Keystone Y.schema.virtual('canAccessKeystone').get(function () { return this.isAdmin; }); /** * Relationships */ Y.relationship({ ref: 'Post', path: 'posts', refPath: 'author' }); /** * Registration */ Y.defaultColumns = 'name, email, isAdmin'; Y.register();
Remove password as hidden field
Remove password as hidden field
JavaScript
mit
chrisslater/snapperfish
--- +++ @@ -10,11 +10,10 @@ Y.add({ name: { type: Types.Name, required: true, index: true }, email: { type: Types.Email, initial: true, required: true, index: true }, - password: { - type: Types.Password, - initial: true, + password: { + type: Types.Password, + initial: true, required: true, - hidden: true, }, }, 'Permissions', { isAdmin: { type: Boolean, label: 'Can access Keystone', index: true },
941c1565dbc89005b99b9302370028cbd5c820c1
components/LandingPageHero.js
components/LandingPageHero.js
import React from 'react'; import Helmet from 'react-helmet'; import Hero from './Hero'; const LandingPageHero = ({ title, headline }, { modals }) => { return ( <div> <Helmet title={title} /> <Hero headline={headline} textline={`Increase your productivity, focus on new features, and scale beyond millions of users without managing servers.`} image={ <img src={require('../pages/home/build-powerful-apps-in-half-the-time.svg')} alt="serverless app platform" /> } > <div className="hero__text__button-container"> <span className="button button--large button--featured" onClick={modals.signUp.open} > Get Started for Free </span> <p className="hero__text__button-description"> 6 months free &bull; No credit card required </p> </div> </Hero> </div> ); }; LandingPageHero.defaultProps = { title: 'Build powerful apps in half the time | Syncano', headline: <span>Build powerfulapps<br />in half the time</span> }; LandingPageHero.contextTypes = { modals: React.PropTypes.object }; export default LandingPageHero;
import React from 'react'; import Helmet from 'react-helmet'; import Hero from './Hero'; const LandingPageHero = ({ title, headline }, { modals }) => { return ( <div> <Helmet title={title} /> <Hero headline={headline} textline={`Increase your productivity, focus on new features, and scale beyond millions of users without managing servers.`} image={ <img src={require('../pages/home/build-powerful-apps-in-half-the-time.svg')} alt="serverless app platform" /> } > <div className="hero__text__button-container"> <span className="button button--large button--featured" onClick={modals.signUp.open} > Get Started for Free </span> <p className="hero__text__button-description"> 6 months free &bull; No credit card required </p> </div> </Hero> </div> ); }; LandingPageHero.defaultProps = { title: 'Build powerful apps in half the time | Syncano', headline: <span>Build powerful apps<br />in half the time</span> }; LandingPageHero.contextTypes = { modals: React.PropTypes.object }; export default LandingPageHero;
Fix typo in "powerful apps"
[WEB-465] Fix typo in "powerful apps"
JavaScript
mit
Syncano/syncano.com,Syncano/syncano.com
--- +++ @@ -35,7 +35,7 @@ LandingPageHero.defaultProps = { title: 'Build powerful apps in half the time | Syncano', - headline: <span>Build powerfulapps<br />in half the time</span> + headline: <span>Build powerful apps<br />in half the time</span> }; LandingPageHero.contextTypes = {
3fe151d044e6a6f4ea957e3a75105a45a2865314
build/karma.base.js
build/karma.base.js
const buble = require('rollup-plugin-buble'); const nodeResolve = require('rollup-plugin-node-resolve'); const commonJS = require('rollup-plugin-commonjs'); module.exports = { frameworks: ['jasmine', 'sinon'], files: [ { pattern: '../src/**/*.js', watched: process.env.CI === 'true', included: false, }, { pattern: '../spec/**/*.spec.js', watched: process.env.CI === 'true', }, ], preprocessors: { '../spec/**/*.spec.js': ['rollup'], }, rollupPreprocessor: { format: 'iife', sourceMap: 'inline', plugins: [commonJS(), nodeResolve(), buble()], }, plugins: [ 'karma-jasmine', 'karma-sinon', 'karma-rollup-plugin', 'karma-spec-reporter', ], reporters: ['spec'], };
const buble = require('rollup-plugin-buble'); const nodeResolve = require('rollup-plugin-node-resolve'); const commonJS = require('rollup-plugin-commonjs'); module.exports = { frameworks: ['jasmine', 'sinon'], files: [ { pattern: '../src/**/*.js', watched: process.env.CI !== 'true', included: false, }, { pattern: '../spec/**/*.spec.js', watched: process.env.CI !== 'true', }, ], preprocessors: { '../spec/**/*.spec.js': ['rollup'], }, rollupPreprocessor: { format: 'iife', sourceMap: 'inline', plugins: [commonJS(), nodeResolve(), buble()], }, plugins: [ 'karma-jasmine', 'karma-sinon', 'karma-rollup-plugin', 'karma-spec-reporter', ], reporters: ['spec'], };
Fix karma config. Watch files when not CI environment.
Fix karma config. Watch files when not CI environment.
JavaScript
mit
demiazz/lighty
--- +++ @@ -9,12 +9,12 @@ files: [ { pattern: '../src/**/*.js', - watched: process.env.CI === 'true', + watched: process.env.CI !== 'true', included: false, }, { pattern: '../spec/**/*.spec.js', - watched: process.env.CI === 'true', + watched: process.env.CI !== 'true', }, ],
7652f2b6ac6e0602d5d3746e9c42173cf3730622
templates/add-service/web-express-es6/app/index.js
templates/add-service/web-express-es6/app/index.js
// This is the main server file. // // It parses the command line and instantiates the two servers for this app: const async = require('async') const {cyan, dim, green, red} = require('chalk') const ExoRelay = require('exorelay'); const N = require('nitroglycerin'); const {name, version} = require('../package.json') const WebServer = require('./web-server'); function startExorelay (done) { global.exorelay = new ExoRelay({serviceName: process.env.SERVICE_NAME, exocomPort: process.env.EXOCOM_PORT}) global.exorelay.on('error', (err) => { console.log(red(err)) }) global.exorelay.on('online', (port) => { console.log(`${green('ExoRelay')} online at port ${cyan(port)}`) done() }) global.exorelay.listen(process.env.EXORELAY_PORT) } function startWebServer (done) { const webServer = new WebServer; webServer.on('error', (err) => { console.log(red(err)) }) webServer.on('listening', () => { console.log(`${green('HTML server')} online at port ${cyan(webServer.port())}`) done() }) webServer.listen(3000) } startExorelay( N( () => { startWebServer( N( () => { console.log(green('all systems go')) })) }))
// This is the main server file. // // It parses the command line and instantiates the two servers for this app: const async = require('async') const {cyan, dim, green, red} = require('chalk') const ExoRelay = require('exorelay'); const N = require('nitroglycerin'); const {name, version} = require('../package.json') const WebServer = require('./web-server') const port = process.env.PORT || 3000 function startExorelay (done) { global.exorelay = new ExoRelay({serviceName: process.env.SERVICE_NAME, exocomPort: process.env.EXOCOM_PORT}) global.exorelay.on('error', (err) => { console.log(red(err)) }) global.exorelay.on('online', (port) => { console.log(`${green('ExoRelay')} online at port ${cyan(port)}`) done() }) global.exorelay.listen(process.env.EXORELAY_PORT) } function startWebServer (done) { const webServer = new WebServer; webServer.on('error', (err) => { console.log(red(err)) }) webServer.on('listening', () => { console.log(`${green('HTML server')} online at port ${cyan(webServer.port())}`) done() }) webServer.listen(port) } startExorelay( N( () => { startWebServer( N( () => { console.log(green('all systems go')) })) }))
Make the web port configurable
Make the web port configurable
JavaScript
mit
Originate/exosphere,Originate/exosphere,Originate/exosphere,Originate/exosphere
--- +++ @@ -6,7 +6,8 @@ const ExoRelay = require('exorelay'); const N = require('nitroglycerin'); const {name, version} = require('../package.json') -const WebServer = require('./web-server'); +const WebServer = require('./web-server') +const port = process.env.PORT || 3000 function startExorelay (done) { @@ -28,7 +29,7 @@ console.log(`${green('HTML server')} online at port ${cyan(webServer.port())}`) done() }) - webServer.listen(3000) + webServer.listen(port) }
476b864d53a63fd211b2faa6c40f9be4b1454526
ui/src/shared/middleware/errors.js
ui/src/shared/middleware/errors.js
// import {replace} from 'react-router-redux' import {authReceived, meReceived} from 'shared/actions/auth' import {publishNotification as notify} from 'shared/actions/notifications' import {HTTP_FORBIDDEN} from 'shared/constants' const errorsMiddleware = store => next => action => { if (action.type === 'ERROR_THROWN') { const {error, error: {status, auth}} = action console.error(error) if (status === HTTP_FORBIDDEN) { const {auth: {me}} = store.getState() const wasSessionTimeout = me === null store.dispatch(authReceived(auth)) store.dispatch(meReceived(null)) if (wasSessionTimeout) { store.dispatch(notify('error', 'Please login to use Chronograf.')) } else { store.dispatch(notify('error', 'Session timed out. Please login again.')) } } else { store.dispatch(notify('error', 'Cannot communicate with server.')) } } next(action) } export default errorsMiddleware
// import {replace} from 'react-router-redux' import {authExpired} from 'shared/actions/auth' import {publishNotification as notify} from 'shared/actions/notifications' import {HTTP_FORBIDDEN} from 'shared/constants' const errorsMiddleware = store => next => action => { if (action.type === 'ERROR_THROWN') { const {error, error: {status, auth}} = action console.error(error) if (status === HTTP_FORBIDDEN) { const {auth: {me}} = store.getState() const wasSessionTimeout = me !== null next(authExpired(auth)) if (wasSessionTimeout) { store.dispatch(notify('error', 'Session timed out. Please login again.')) } else { store.dispatch(notify('error', 'Please login to use Chronograf.')) } } else { store.dispatch(notify('error', 'Cannot communicate with server.')) } } next(action) } export default errorsMiddleware
Use authExpired action; fix session timeout notification logic
Use authExpired action; fix session timeout notification logic
JavaScript
agpl-3.0
brianbaker/chronograf,brianbaker/chronograf,brianbaker/chronograf,brianbaker/chronograf,brianbaker/chronograf
--- +++ @@ -1,6 +1,6 @@ // import {replace} from 'react-router-redux' -import {authReceived, meReceived} from 'shared/actions/auth' +import {authExpired} from 'shared/actions/auth' import {publishNotification as notify} from 'shared/actions/notifications' import {HTTP_FORBIDDEN} from 'shared/constants' @@ -13,15 +13,14 @@ if (status === HTTP_FORBIDDEN) { const {auth: {me}} = store.getState() - const wasSessionTimeout = me === null + const wasSessionTimeout = me !== null - store.dispatch(authReceived(auth)) - store.dispatch(meReceived(null)) + next(authExpired(auth)) if (wasSessionTimeout) { + store.dispatch(notify('error', 'Session timed out. Please login again.')) + } else { store.dispatch(notify('error', 'Please login to use Chronograf.')) - } else { - store.dispatch(notify('error', 'Session timed out. Please login again.')) } } else { store.dispatch(notify('error', 'Cannot communicate with server.'))
b5b6d9b04bec0c9e937441a60dcac34f30e0a041
dataprep-webapp/src/app/components/preparation/creator/datasets-filters/datasets-filters-controller.js
dataprep-webapp/src/app/components/preparation/creator/datasets-filters/datasets-filters-controller.js
/* ============================================================================ Copyright (C) 2006-2016 Talend Inc. - www.talend.com This source code is available under agreement available at https://github.com/Talend/data-prep/blob/master/LICENSE You should have received a copy of the agreement along with this program; if not, write to Talend SA 9 rue Pages 92150 Suresnes, France ============================================================================*/ class DatasetsFiltersCtrl { constructor() { 'ngInject'; // The order is important this.datasetsFilters = [ { value: 'RECENT_DATASETS', imageUrl: '/assets/images/inventory/recent-datasets.png', description: 'RECENT_DATASETS_DESCRIPTION', isSelected: true }, { value: 'FAVORITE_DATASETS', icon: 'f', description: 'FAVORITE_DATASETS_DESCRIPTION' }, { value: 'CERTIFIED_DATASETS', imageUrl: '/assets/images/inventory/certified_no_shadow.png', description: 'CERTIFIED_DATASETS_DESCRIPTION' }, { value: 'ALL_DATASETS', imageUrl: '/assets/images/inventory/all-datasets.png', description: 'ALL_DATASETS_DESCRIPTION' } ]; this.selectedFilter = this.datasetsFilters[0]; } selectFilter(filter) { if (this.importing) { return; } this.selectedFilter.isSelected = false; this.selectedFilter = filter; this.selectedFilter.isSelected = true; this.onFilterSelect({ filter: filter.value }); } } export default DatasetsFiltersCtrl;
/* ============================================================================ Copyright (C) 2006-2016 Talend Inc. - www.talend.com This source code is available under agreement available at https://github.com/Talend/data-prep/blob/master/LICENSE You should have received a copy of the agreement along with this program; if not, write to Talend SA 9 rue Pages 92150 Suresnes, France ============================================================================*/ class DatasetsFiltersCtrl { constructor() { 'ngInject'; // The order is important this.datasetsFilters = [ { value: 'RECENT_DATASETS', imageUrl: '/assets/images/inventory/recent-datasets.png', description: 'RECENT_DATASETS_DESCRIPTION', isSelected: true }, { value: 'FAVORITE_DATASETS', icon: 'f', description: 'FAVORITE_DATASETS_DESCRIPTION' }, { value: 'ALL_DATASETS', imageUrl: '/assets/images/inventory/all-datasets.png', description: 'ALL_DATASETS_DESCRIPTION' } ]; this.selectedFilter = this.datasetsFilters[0]; } selectFilter(filter) { if (this.importing) { return; } this.selectedFilter.isSelected = false; this.selectedFilter = filter; this.selectedFilter.isSelected = true; this.onFilterSelect({ filter: filter.value }); } } export default DatasetsFiltersCtrl;
Fix unit test following merge of maintenance/1.2.0 changes.
[Test] Fix unit test following merge of maintenance/1.2.0 changes.
JavaScript
apache-2.0
Talend/data-prep,Talend/data-prep,Talend/data-prep
--- +++ @@ -29,11 +29,6 @@ description: 'FAVORITE_DATASETS_DESCRIPTION' }, { - value: 'CERTIFIED_DATASETS', - imageUrl: '/assets/images/inventory/certified_no_shadow.png', - description: 'CERTIFIED_DATASETS_DESCRIPTION' - }, - { value: 'ALL_DATASETS', imageUrl: '/assets/images/inventory/all-datasets.png', description: 'ALL_DATASETS_DESCRIPTION'
0b5f74f9d0a3ab08b742a537e1e900765f8f52d8
packages/resourceful-redux/src/utils/get-resources.js
packages/resourceful-redux/src/utils/get-resources.js
// Returns a list of resources by IDs or label export default function(state, resourceName, idsOrLabel) { const resourceSlice = state[resourceName]; if (!resourceSlice) { return []; } const resources = resourceSlice.resources; let idsList; // This conditional handles the situation where `idsOrLabel` is an ID if (typeof idsOrLabel === 'string') { const label = resourceSlice.labels[idsOrLabel]; if (!label) { return []; } const labelIds = label.ids; if (!labelIds) { return []; } idsList = labelIds; } else { idsList = idsOrLabel; } if (!(idsList && idsList.length)) { return []; } return idsList.map(id => resources[id]).filter(Boolean); }
// Returns a list of resources by IDs or list name export default function(state, resourceName, idsOrList) { const resourceSlice = state[resourceName]; if (!resourceSlice) { return []; } const resources = resourceSlice.resources; let idsList; // This conditional handles the situation where `idsOrList` is an list name if (typeof idsOrList === 'string') { const list = resourceSlice.lists[idsOrList]; if (!list) { return []; } idsList = list.ids; } else { idsList = idsOrList; } if (!(idsList && idsList.length)) { return []; } return idsList.map(id => resources[id]).filter(Boolean); }
Update getResources to support lists, not labels
Update getResources to support lists, not labels
JavaScript
mit
jmeas/resourceful-redux,jmeas/resourceful-redux
--- +++ @@ -1,5 +1,5 @@ -// Returns a list of resources by IDs or label -export default function(state, resourceName, idsOrLabel) { +// Returns a list of resources by IDs or list name +export default function(state, resourceName, idsOrList) { const resourceSlice = state[resourceName]; if (!resourceSlice) { return []; @@ -8,21 +8,16 @@ const resources = resourceSlice.resources; let idsList; - // This conditional handles the situation where `idsOrLabel` is an ID - if (typeof idsOrLabel === 'string') { - const label = resourceSlice.labels[idsOrLabel]; - if (!label) { + // This conditional handles the situation where `idsOrList` is an list name + if (typeof idsOrList === 'string') { + const list = resourceSlice.lists[idsOrList]; + if (!list) { return []; } - const labelIds = label.ids; - if (!labelIds) { - return []; - } - - idsList = labelIds; + idsList = list.ids; } else { - idsList = idsOrLabel; + idsList = idsOrList; } if (!(idsList && idsList.length)) {
77749a3cc52eb8ebabbdb0f13a58338fd543b6bd
src/environment-settings-template.js
src/environment-settings-template.js
// Here you can add settings which change per environment. This file will be also used by the buildserver to inject environment specific values. // Settings are made available through the configService. var environmentSettings = { host: 'localhost', port: 8001 } // Leave line below untouched. This how gulp file is also able to use this settings file. ('require' needs a module) module.exports = environmentSettings;
// Here you can add settings which change per environment. This file will be also used by the buildserver to inject environment specific values. // Settings are made available through the configService. var environmentSettings = { host: 'localhost', port: 8001 } // Leave lines below untouched. This how gulp file is also able to use this settings file. ('require' needs a module) if(typeof module !== 'undefined'){ module.exports = environmentSettings; };
Fix for module error in console.
Fix for module error in console.
JavaScript
mit
robinvanderknaap/SkaeleFrontend,robinvanderknaap/SkaeleFrontend
--- +++ @@ -5,5 +5,7 @@ port: 8001 } -// Leave line below untouched. This how gulp file is also able to use this settings file. ('require' needs a module) -module.exports = environmentSettings; +// Leave lines below untouched. This how gulp file is also able to use this settings file. ('require' needs a module) +if(typeof module !== 'undefined'){ + module.exports = environmentSettings; +};
a5bc2b05f6a2d948d596cb562796be98cfbd1d49
packages/ember-model/lib/adapter.js
packages/ember-model/lib/adapter.js
Ember.Adapter = Ember.Object.extend({ find: function(record, id) { throw new Error('Ember.Adapter subclasses must implement find'); }, findQuery: function(record, id) { throw new Error('Ember.Adapter subclasses must implement findQuery'); }, findMany: function(record, id) { throw new Error('Ember.Adapter subclasses must implement findMany'); }, findAll: function(klass, records) { throw new Error('Ember.Adapter subclasses must implement findAll'); }, load: function(record, id, data) { record.load(id, data); }, createRecord: function(record) { throw new Error('Ember.Adapter subclasses must implement createRecord'); }, saveRecord: function(record) { throw new Error('Ember.Adapter subclasses must implement saveRecord'); }, deleteRecord: function(record) { throw new Error('Ember.Adapter subclasses must implement deleteRecord'); } });
Ember.Adapter = Ember.Object.extend({ find: function(record, id) { throw new Error('Ember.Adapter subclasses must implement find'); }, findQuery: function(klass, records, params) { throw new Error('Ember.Adapter subclasses must implement findQuery'); }, findMany: function(klass, records, ids) { throw new Error('Ember.Adapter subclasses must implement findMany'); }, findAll: function(klass, records) { throw new Error('Ember.Adapter subclasses must implement findAll'); }, load: function(record, id, data) { record.load(id, data); }, createRecord: function(record) { throw new Error('Ember.Adapter subclasses must implement createRecord'); }, saveRecord: function(record) { throw new Error('Ember.Adapter subclasses must implement saveRecord'); }, deleteRecord: function(record) { throw new Error('Ember.Adapter subclasses must implement deleteRecord'); } });
Update Adapter to match API
Update Adapter to match API
JavaScript
mit
greyhwndz/ember-model,juggy/ember-model,gmedina/ember-model,sohara/ember-model,ipavelpetrov/ember-model,asquet/ember-model,ebryn/ember-model,GavinJoyce/ember-model,zenefits/ember-model,c0achmcguirk/ember-model,asquet/ember-model,ipavelpetrov/ember-model,CondeNast/ember-model,Swrve/ember-model,ckung/ember-model,julkiewicz/ember-model,intercom/ember-model,igorgoroshit/ember-model
--- +++ @@ -3,11 +3,11 @@ throw new Error('Ember.Adapter subclasses must implement find'); }, - findQuery: function(record, id) { + findQuery: function(klass, records, params) { throw new Error('Ember.Adapter subclasses must implement findQuery'); }, - findMany: function(record, id) { + findMany: function(klass, records, ids) { throw new Error('Ember.Adapter subclasses must implement findMany'); },
0ede5818a3dd1d087ef4a01511d83a76390a35e3
app/scripts/directives/help-icon.js
app/scripts/directives/help-icon.js
'use strict'; (function() { angular.module('ncsaas') .directive('helpicon', ['$document', helpicon]); function helpicon($document) { return { restrict: 'E', templateUrl: "views/directives/help-icon.html", replace: true, scope: { helpText: '@' }, link: function ($scope, element) { var trigger = element; var text = trigger.find('span'); trigger.css('position', 'relative'); trigger.bind('click', function(){ if (!text.hasClass('active')) { text.addClass('active'); text.css({ 'position': 'absolute', 'top': -(text[0].offsetHeight + 4) + 'px', 'left': '50%', 'margin-left': -text[0].offsetWidth/2 + 'px' }) } else { text.removeClass('active'); } }); } }; } })();
'use strict'; (function() { angular.module('ncsaas') .directive('helpicon', ['$document', helpicon]); function helpicon($document) { return { restrict: 'E', templateUrl: "views/directives/help-icon.html", replace: true, scope: { helpText: '@' }, link: function (scope, element) { var trigger = element; var text = trigger.find('span'); trigger.css('position', 'relative'); trigger.bind('click', function(event){ if (!text.hasClass('active')) { text.addClass('active'); text.css({ 'position': 'absolute', 'top': -(text[0].offsetHeight + 4) + 'px', 'left': '50%', 'margin-left': -text[0].offsetWidth/2 + 'px' }) } else { text.removeClass('active'); } event.stopPropagation(); }); $document.bind('click', function() { text.removeClass('active'); }) } }; } })();
Hide help text if click outside element.
Hide help text if click outside element. – SAAS-457
JavaScript
mit
opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport
--- +++ @@ -12,11 +12,12 @@ scope: { helpText: '@' }, - link: function ($scope, element) { + link: function (scope, element) { var trigger = element; var text = trigger.find('span'); + trigger.css('position', 'relative'); - trigger.bind('click', function(){ + trigger.bind('click', function(event){ if (!text.hasClass('active')) { text.addClass('active'); text.css({ @@ -28,7 +29,12 @@ } else { text.removeClass('active'); } + event.stopPropagation(); }); + $document.bind('click', function() { + text.removeClass('active'); + }) + } }; }
266e31e911e1337589aa5134efd194de6b124551
src/scripts/content/toggl.js
src/scripts/content/toggl.js
'use strict'; var userData, offlineUser; offlineUser = localStorage.getItem('offline_users'); if (offlineUser) { userData = JSON.parse(localStorage.getItem('offline_users-' + offlineUser)); if (userData && userData.offlineData) { chrome.extension.sendMessage({ type: 'userToken', apiToken: userData.offlineData.api_token }); } } (function() { var version, source, s; source = `window.TogglButton = { version: "${process.env.VERSION}" }`; s = document.createElement('script'); s.textContent = source; document.body.appendChild(s); })(); document.addEventListener('webkitvisibilitychange', function() { if (!document.webkitHidden) { chrome.extension.sendMessage({ type: 'sync' }, function() { return; }); } }); chrome.extension.sendMessage({ type: 'sync' }, function() { return; });
'use strict'; var userData, offlineUser; offlineUser = localStorage.getItem('offline_users'); if (offlineUser) { userData = JSON.parse(localStorage.getItem('offline_users-' + offlineUser)); if (userData && userData.offlineData) { chrome.extension.sendMessage({ type: 'userToken', apiToken: userData.offlineData.api_token }); } } (function() { var source, s; const version = chrome.runtime.getManifest().version; source = `window.TogglButton = { version: "${version}" }`; s = document.createElement('script'); s.textContent = source; document.body.appendChild(s); })(); document.addEventListener('webkitvisibilitychange', function() { if (!document.webkitHidden) { chrome.extension.sendMessage({ type: 'sync' }, function() { return; }); } }); chrome.extension.sendMessage({ type: 'sync' }, function() { return; });
Fix process undefined in content script
Fix process undefined in content script Fixes #1113.
JavaScript
bsd-3-clause
glensc/toggl-button,glensc/toggl-button,glensc/toggl-button
--- +++ @@ -14,8 +14,9 @@ } (function() { - var version, source, s; - source = `window.TogglButton = { version: "${process.env.VERSION}" }`; + var source, s; + const version = chrome.runtime.getManifest().version; + source = `window.TogglButton = { version: "${version}" }`; s = document.createElement('script'); s.textContent = source; document.body.appendChild(s);
94a9e274fa01e834bd88e9b03dcba8a1c643120d
build/tasks/durandal.js
build/tasks/durandal.js
var gulp = require('gulp'); //var gutil = require('gulp-util'); var fs = require('fs'); var durandal = require('gulp-durandal'); var header = require('gulp-header'); var paths = require('../paths'); gulp.task('durandal', function() { var pkg = JSON.parse(fs.readFileSync('./package.json', 'utf-8')); var banner = ['/**', ' * Copyright (c) <%= new Date().getFullYear() %> - <%= author %>', ' * <%= name %> - <%= description %>', ' * @built <%= new Date().toISOString() %>', ' * @version v<%= version %>', ' * @link <%= homepage %>', ' * @license <%= license %>', ' */', ''].join('\n'); return durandal({ baseDir: paths.root, main: 'main.js', output: 'main.js', almond: true, minify: true, rjsConfigAdapter: function(cfg) { cfg.preserveLicenseComments = true; cfg.generateSourceMaps = false; cfg.uglify2 = { output: { beautify: false }, compress: { sequences: false, global_defs: { DEBUG: false }, drop_console: true }, warnings: true, mangle: false }; return cfg; } }) .pipe(header(banner, pkg)) .pipe(gulp.dest(paths.output + paths.root)); });
var gulp = require('gulp'); var fs = require('fs'); var durandal = require('gulp-durandal'); var header = require('gulp-header'); var paths = require('../paths'); gulp.task('durandal', function() { var pkg = JSON.parse(fs.readFileSync('./package.json', 'utf-8')); var banner = ['/**', ' * Copyright (c) <%= new Date().getFullYear() %> - <%= author %>', ' * <%= name %> - <%= description %>', ' * @built <%= new Date().toISOString() %>', ' * @version v<%= version %>', ' * @link <%= homepage %>', ' * @license <%= license %>', ' */', ''].join('\n'); return durandal({ baseDir: paths.root, main: 'main.js', output: 'main.js', almond: true, minify: true, rjsConfigAdapter: function(cfg) { cfg.preserveLicenseComments = true; cfg.generateSourceMaps = false; cfg.uglify2 = { output: { beautify: false }, compress: { sequences: false, global_defs: { DEBUG: false }, drop_console: true }, warnings: true, mangle: false }; return cfg; } }) .pipe(header(banner, pkg)) .pipe(gulp.dest(paths.output + paths.root)); });
Add banner to built version
Add banner to built version
JavaScript
mit
mryellow/durandal-gulp-boilerplate,mryellow/durandal-gulp-boilerplate
--- +++ @@ -1,5 +1,4 @@ var gulp = require('gulp'); -//var gutil = require('gulp-util'); var fs = require('fs'); var durandal = require('gulp-durandal'); var header = require('gulp-header');
ebd672e35424298de480a1e19c7ac57bd0b78e67
app/utils/socketIO.js
app/utils/socketIO.js
'use strict'; /* * Socket.io related things go ! */ import { log, LOG_TYPES } from './log'; import { decodeJWT } from './JWT'; const EVENT_TYPES = { DISCONNECT : 'disconnect', CONNECTION : 'connection', TOKEN_VALID : 'token_valid', TOKEN_INVALID : 'token_invalid', CONTACT_ONLINE : 'contact:online', CONTACT_OFFLINE : 'contact:offline' }; let io; let connections = []; function createSocketIO(server, app) { io = require('socket.io')(server); io.on(EVENT_TYPES.CONNECTION, (socket) => { socket.on(EVENT_TYPES.DISCONNECT, () => { log(`Socket disconnected with id ${socket.id}`, LOG_TYPES.WARN); let i = connections.indexOf(socket); connections.splice(i, 1); }); decodeJWT(socket.handshake.query.token) .then( results => { log(`Socket connected with id ${socket.id}`); socket.emit('token_valid', {}); socket.user = results; connections.push(socket); }) .catch(error => { log(`Token from ${socket.id} is invalid`, LOG_TYPES.ALERT) socket.emit('token_invalid', {}); socket.disconnect(true); }) }); } export { io, connections, createSocketIO, EVENT_TYPES }
'use strict'; /* * Socket.io related things go ! */ import { log, LOG_TYPES } from './log'; import { decodeJWT } from './JWT'; import models from '../models'; const User = models.User; const EVENT_TYPES = { DISCONNECT : 'disconnect', CONNECTION : 'connection', TOKEN_VALID : 'token_valid', TOKEN_INVALID : 'token_invalid', CONTACT_ONLINE : 'contact:online', CONTACT_OFFLINE : 'contact:offline' }; let io; let connections = []; function createSocketIO(server, app) { io = require('socket.io')(server); io.on(EVENT_TYPES.CONNECTION, (socket) => { socket.on(EVENT_TYPES.DISCONNECT, () => { log(`Socket disconnected with id ${socket.id}`, LOG_TYPES.WARN); let i = connections.indexOf(socket); connections.splice(i, 1); }); decodeJWT(socket.handshake.query.token) .then( results => { log(`Socket connected with id ${socket.id}`); socket.emit('token_valid', {}); let lastSeen = Date.now(); results.lastSeen = lastSeen; socket.user = results; User.update({ lastSeen: lastSeen }, { where: { id: results.id } }); connections.push(socket); }) .catch(error => { log(`Token from ${socket.id} is invalid`, LOG_TYPES.ALERT) socket.emit('token_invalid', {}); socket.disconnect(true); }) }); } export { io, connections, createSocketIO, EVENT_TYPES }
Update last seen date when connecting through socket.io
Update last seen date when connecting through socket.io
JavaScript
mit
learning-layers/sardroid-server,learning-layers/sardroid-server
--- +++ @@ -6,6 +6,9 @@ import { log, LOG_TYPES } from './log'; import { decodeJWT } from './JWT'; +import models from '../models'; + +const User = models.User; const EVENT_TYPES = { DISCONNECT : 'disconnect', @@ -35,9 +38,11 @@ .then( results => { log(`Socket connected with id ${socket.id}`); socket.emit('token_valid', {}); + let lastSeen = Date.now(); + results.lastSeen = lastSeen; socket.user = results; + User.update({ lastSeen: lastSeen }, { where: { id: results.id } }); connections.push(socket); - }) .catch(error => { log(`Token from ${socket.id} is invalid`, LOG_TYPES.ALERT)
f34ad58342958656ec4b15a828349af931ea2dc3
firefox/lib/main.js
firefox/lib/main.js
var self = require("sdk/self"); var panel = require("sdk/panel"); var initToolbar = function(freedom) { // create toolbarbutton var tbb = require("pathfinder/ui/toolbarbutton").ToolbarButton({ id: "UProxyItem", label: "UProxy", image: self.data.url("common/ui/icons/uproxy-19.png"), panel: initPanel(freedom.communicator) }); tbb.moveTo({ toolbarID: "nav-bar", forceMove: false // only move from palette }); }; var initPanel = function(freedomCommunicator) { var l10n = JSON.parse(self.data.load("l10n/en/messages.json")); var uproxyPanel = panel.Panel({ contentURL: self.data.url("common/ui/popup.html"), width: 450, height: 300 }); freedomCommunicator.addContentContext(uproxyPanel); uproxyPanel.port.on("show", function() { uproxyPanel.port.emit("l10n", l10n); }); return uproxyPanel; }; var freedomEnvironment = require('./init_freedom').InitFreedom(); // TODO: Remove when uproxy.js no longer uses setTimeout // and replace with the line: // initToolbar(freedomEnvironment); require('sdk/timers').setTimeout(initToolbar, 20, freedomEnvironment);
var self = require("sdk/self"); var panel = require("sdk/panel"); var initToolbar = function(freedom) { // create toolbarbutton var tbb = require("pathfinder/ui/toolbarbutton").ToolbarButton({ id: "UProxyItem", label: "UProxy", image: self.data.url("common/ui/icons/uproxy-19.png"), panel: initPanel(freedom.communicator) }); tbb.moveTo({ toolbarID: "nav-bar", forceMove: false // only move from palette }); }; var initPanel = function(freedomCommunicator) { var l10n = JSON.parse(self.data.load("l10n/en/messages.json")); var uproxyPanel = panel.Panel({ contentURL: self.data.url("common/ui/popup.html"), width: 450, height: 300 }); freedomCommunicator.addContentContext(uproxyPanel); uproxyPanel.port.on("show", function() { uproxyPanel.port.emit("l10n", l10n); }); return uproxyPanel; }; var freedomEnvironment = require('./init_freedom').InitFreedom(); // TODO: Remove when uproxy.js no longer uses setTimeout // and replace with the line: // initToolbar(freedomEnvironment); require('sdk/timers').setTimeout(initToolbar, 500, freedomEnvironment);
Increase delay for loading toolbarbutton so that other components have a chance to load.
Increase delay for loading toolbarbutton so that other components have a chance to load.
JavaScript
apache-2.0
chinarustin/uproxy,jpevarnek/uproxy,jpevarnek/uproxy,uProxy/uproxy,itplanes/uproxy,dhkong88/uproxy,qida/uproxy,jpevarnek/uproxy,itplanes/uproxy,dhkong88/uproxy,chinarustin/uproxy,MinFu/uproxy,chinarustin/uproxy,chinarustin/uproxy,qida/uproxy,jpevarnek/uproxy,jpevarnek/uproxy,roceys/uproxy,IveWong/uproxy,itplanes/uproxy,roceys/uproxy,MinFu/uproxy,roceys/uproxy,roceys/uproxy,uProxy/uproxy,qida/uproxy,uProxy/uproxy,uProxy/uproxy,MinFu/uproxy,qida/uproxy,MinFu/uproxy,IveWong/uproxy,dhkong88/uproxy,uProxy/uproxy,dhkong88/uproxy,itplanes/uproxy,MinFu/uproxy,qida/uproxy,chinarustin/uproxy,itplanes/uproxy,IveWong/uproxy,roceys/uproxy,IveWong/uproxy,dhkong88/uproxy
--- +++ @@ -37,5 +37,5 @@ // TODO: Remove when uproxy.js no longer uses setTimeout // and replace with the line: // initToolbar(freedomEnvironment); -require('sdk/timers').setTimeout(initToolbar, 20, freedomEnvironment); +require('sdk/timers').setTimeout(initToolbar, 500, freedomEnvironment);
0717d0940e525eb17831cac42093c6a67fc658f0
src/space-case.js
src/space-case.js
import R from 'ramda'; // a -> a const spaceCase = R.compose( R.trim, R.replace(/([a-z])([A-Z])/g, '$1 $2'), R.replace(/(\.|-|_)/g, ' ') ); export default spaceCase;
import R from 'ramda'; import compose from './util/compose.js'; // a -> a const spaceCase = compose( R.trim, R.replace(/([a-z])([A-Z])/g, '$1 $2'), R.replace(/(\.|-|_)/g, ' ') ); export default spaceCase;
Refactor spaceCase function to use custom compose function
Refactor spaceCase function to use custom compose function
JavaScript
mit
restrung/restrung-js
--- +++ @@ -1,7 +1,8 @@ import R from 'ramda'; +import compose from './util/compose.js'; // a -> a -const spaceCase = R.compose( +const spaceCase = compose( R.trim, R.replace(/([a-z])([A-Z])/g, '$1 $2'), R.replace(/(\.|-|_)/g, ' ')
ddd5cae6fb518d8ea6c073ecbf90a20fc4bec8dd
src/components/box/boxProps.js
src/components/box/boxProps.js
import omit from 'lodash.omit'; import pick from 'lodash.pick'; const boxProps = [ 'alignContent', 'alignItems', 'alignSelf', 'borderWidth', 'borderBottomWidth', 'borderColor', 'borderLeftWidth', 'borderRightWidth', 'borderTint', 'borderTopWidth', 'boxSizing', 'className', 'display', 'element', 'flex', 'flexBasis', 'flexDirection', 'flexGrow', 'flexShrink', 'flexWrap', 'justifyContent', 'margin', 'marginHorizontal', 'marginVertical', 'marginBottom', 'marginLeft', 'marginRight', 'marginTop', 'order', 'overflow', 'overflowX', 'overflowY', 'padding', 'paddingHorizontal', 'paddingVertical', 'paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop', 'textAlign', ]; const omitBoxProps = props => omit(props, boxProps); const pickBoxProps = props => pick(props, boxProps); export default boxProps; export { omitBoxProps, pickBoxProps };
import omit from 'lodash.omit'; import pick from 'lodash.pick'; const boxProps = [ 'alignContent', 'alignItems', 'alignSelf', 'borderWidth', 'borderBottomWidth', 'borderColor', 'borderLeftWidth', 'borderRightWidth', 'borderTint', 'borderTopWidth', 'borderRadius', 'boxSizing', 'className', 'display', 'element', 'flex', 'flexBasis', 'flexDirection', 'flexGrow', 'flexShrink', 'flexWrap', 'justifyContent', 'margin', 'marginHorizontal', 'marginVertical', 'marginBottom', 'marginLeft', 'marginRight', 'marginTop', 'order', 'overflow', 'overflowX', 'overflowY', 'padding', 'paddingHorizontal', 'paddingVertical', 'paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop', 'textAlign', ]; const omitBoxProps = props => omit(props, boxProps); const pickBoxProps = props => pick(props, boxProps); export default boxProps; export { omitBoxProps, pickBoxProps };
Add borderRadius to the box prop list
Add borderRadius to the box prop list
JavaScript
mit
teamleadercrm/teamleader-ui
--- +++ @@ -12,6 +12,7 @@ 'borderRightWidth', 'borderTint', 'borderTopWidth', + 'borderRadius', 'boxSizing', 'className', 'display',
35cabf1fcf225e7d7168f12a52baca7c5728aa4a
frontend/app/js/containers/project/index.js
frontend/app/js/containers/project/index.js
import ServerboardView from 'app/components/project' import store from 'app/utils/store' import { projects_update_info } from 'app/actions/project' var Project=store.connect({ state(state){ if (state.project.current != "/" && localStorage.last_project != state.project.current){ localStorage.last_project = state.project.current } return { shortname: state.project.current, project: state.project.project, projects_count: (state.project.projects || []).length } }, handlers: (dispatch, props) => ({ goto(url){ console.log(url) store.goto(url.pathname, url.state) }, onAdd(){ dispatch( store.set_modal("project.add") ) }, onUpdate(){ dispatch( projects_update_info(props.params.project) ) } }), store_enter: (state, props) => [ () => projects_update_info(state.project.current), ], store_exit: (state, props) => [ () => projects_update_info(), ], subscriptions: ["service.updated"], watch: ["shortname"] }, ServerboardView) export default Project
import ServerboardView from 'app/components/project' import store from 'app/utils/store' import { projects_update_info } from 'app/actions/project' var Project=store.connect({ state(state){ if (state.project.current != "/" && localStorage.last_project != state.project.current){ localStorage.last_project = state.project.current } return { shortname: state.project.current, project: state.project.project, projects_count: (state.project.projects || []).length } }, handlers: (dispatch, props) => ({ goto(url){ console.log(url) store.goto(url.pathname || url, url.state) }, onAdd(){ dispatch( store.set_modal("project.add") ) }, onUpdate(){ dispatch( projects_update_info(props.params.project) ) } }), store_enter: (state, props) => [ () => projects_update_info(state.project.current), ], store_exit: (state, props) => [ () => projects_update_info(), ], subscriptions: ["service.updated"], watch: ["shortname"] }, ServerboardView) export default Project
Fix goto simple sections at sidebar
Fix goto simple sections at sidebar
JavaScript
apache-2.0
serverboards/serverboards,serverboards/serverboards,serverboards/serverboards,serverboards/serverboards,serverboards/serverboards
--- +++ @@ -16,7 +16,7 @@ handlers: (dispatch, props) => ({ goto(url){ console.log(url) - store.goto(url.pathname, url.state) + store.goto(url.pathname || url, url.state) }, onAdd(){ dispatch( store.set_modal("project.add") ) }, onUpdate(){ dispatch( projects_update_info(props.params.project) ) }
1b565f867fc123d54cb54c96fdb2e188ff71227a
renderer.js
renderer.js
// This file is required by the index.html file and will // be executed in the renderer process for that window. // All of the Node.js APIs are available in this process. const {clipboard} = require('electron') alert(clipboard.readText("String")) module.exports = function demoClipboard() { var text = clipboard.readText("String"); alert(text); }
// This file is required by the index.html file and will // be executed in the renderer process for that window. // All of the Node.js APIs are available in this process. const {clipboard} = require('electron') module.exports = function demoClipboard() { var text = clipboard.readText("String"); alert(text); }
Remove alert for testing purpose
Remove alert for testing purpose
JavaScript
cc0-1.0
weitalu/awesome-answering-machine,weitalu/awesome-answering-machine
--- +++ @@ -2,7 +2,6 @@ // be executed in the renderer process for that window. // All of the Node.js APIs are available in this process. const {clipboard} = require('electron') -alert(clipboard.readText("String")) module.exports = function demoClipboard() { var text = clipboard.readText("String");
466017c706bf782d868c621b4d535047b3a05259
app/config-debug.js
app/config-debug.js
var juju_config = { // These are blacklisted config items not passed into subapps mounted into // the main App. serverRouting: false, html5: true, container: '#main', viewContainer: '#main', // FIXME: turn off transitions until they are fixed. transitions: false, // These are the main application config items used and passed down into all // SubApps. consoleEnabled: true, charm_store_url: 'http://jujucharms.com/', charmworldURL: 'http://charmworld.local:2464/', // The config has three socket settings. socket_port and socket_protocol // modify the current application url to determine the websocket url (always // adding "/ws" as the final path). socket_url sets the entire websocket // url. For backwards compatibility in the GUI charm, if you provide the // socket port and/or protocol *and* the socket_url, the socket_url will be // ignored (the port/protocol behavior overrides socket_url). socket_protocol: 'ws', socket_port: 8081, user: 'admin', password: 'admin', apiBackend: 'python', // Value can be 'python' or 'go'. sandbox: false, readOnly: false, login_help: 'For this demonstration, use the password "admin" to connect.' };
var juju_config = { // These are blacklisted config items not passed into subapps mounted into // the main App. serverRouting: false, html5: true, container: '#main', viewContainer: '#main', // FIXME: turn off transitions until they are fixed. transitions: false, // These are the main application config items used and passed down into all // SubApps. consoleEnabled: true, charm_store_url: 'http://jujucharms.com/', charmworldURL: 'http://staging.jujucharms.com/', // The config has three socket settings. socket_port and socket_protocol // modify the current application url to determine the websocket url (always // adding "/ws" as the final path). socket_url sets the entire websocket // url. For backwards compatibility in the GUI charm, if you provide the // socket port and/or protocol *and* the socket_url, the socket_url will be // ignored (the port/protocol behavior overrides socket_url). socket_protocol: 'ws', socket_port: 8081, user: 'admin', password: 'admin', apiBackend: 'python', // Value can be 'python' or 'go'. sandbox: false, readOnly: false, login_help: 'For this demonstration, use the password "admin" to connect.' };
Revert local change to config.
Revert local change to config.
JavaScript
agpl-3.0
jrwren/juju-gui,bac/juju-gui,mitechie/juju-gui,mitechie/juju-gui,jrwren/juju-gui,bac/juju-gui,bac/juju-gui,mitechie/juju-gui,CanonicalJS/juju-gui,mitechie/juju-gui,jrwren/juju-gui,CanonicalJS/juju-gui,bac/juju-gui,jrwren/juju-gui,CanonicalJS/juju-gui
--- +++ @@ -12,7 +12,7 @@ // SubApps. consoleEnabled: true, charm_store_url: 'http://jujucharms.com/', - charmworldURL: 'http://charmworld.local:2464/', + charmworldURL: 'http://staging.jujucharms.com/', // The config has three socket settings. socket_port and socket_protocol // modify the current application url to determine the websocket url (always // adding "/ws" as the final path). socket_url sets the entire websocket
b52cc64da7f2ecf037c5b3226a4c6641fe4c4b73
eloquent_js_exercises/chapter06/chapter06_ex01.js
eloquent_js_exercises/chapter06/chapter06_ex01.js
function Vector(x, y) { this.x = x; this.y = y; } Vector.prototype.plus = function(vec) { return new Vector(this.x + vec.x, this.y + vec.y); } Vector.prototype.minus = function(vec) { return new Vector(this.x - vec.x, this.y - vec.y); } Object.defineProperty(Vector.prototype, "length", { get: function() { return Math.sqrt(Math.pow(this.x, 2) + Math.pow(this.y, 2)); } });
class Vec { constructor(x, y) { this.x = x; this.y = y; } plus(v) { return new Vec(this.x + v.x, this.y + v.y); } minus(v) { return new Vec(this.x - v.x, this.y - v.y); } get length() { return Math.sqrt(this.x**2 + this.y**2); } toString() { return `Vec{x: ${this.x}, y: ${this.y}}`; } }
Add Chapter 06, exercise 1
Add Chapter 06, exercise 1
JavaScript
mit
bewuethr/ctci
--- +++ @@ -1,18 +1,22 @@ -function Vector(x, y) { - this.x = x; - this.y = y; +class Vec { + constructor(x, y) { + this.x = x; + this.y = y; + } + + plus(v) { + return new Vec(this.x + v.x, this.y + v.y); + } + + minus(v) { + return new Vec(this.x - v.x, this.y - v.y); + } + + get length() { + return Math.sqrt(this.x**2 + this.y**2); + } + + toString() { + return `Vec{x: ${this.x}, y: ${this.y}}`; + } } - -Vector.prototype.plus = function(vec) { - return new Vector(this.x + vec.x, this.y + vec.y); -} - -Vector.prototype.minus = function(vec) { - return new Vector(this.x - vec.x, this.y - vec.y); -} - -Object.defineProperty(Vector.prototype, "length", { - get: function() { - return Math.sqrt(Math.pow(this.x, 2) + Math.pow(this.y, 2)); - } -});
3073499ecb1147986f6164688a5b8e4e1700ef44
eloquent_js_exercises/chapter09/chapter09_ex03.js
eloquent_js_exercises/chapter09/chapter09_ex03.js
var number = /^(\+|-)?(\d+(\.\d*)?|\.\d+)([Ee](\+|-)?\d+)?$/;
let number = /^[+-]?\d*(\d\.|\.\d)?\d*([eE][+-]?\d+)?$/;
Add Chapter 09, exercise 3
Add Chapter 09, exercise 3
JavaScript
mit
bewuethr/ctci
--- +++ @@ -1 +1 @@ -var number = /^(\+|-)?(\d+(\.\d*)?|\.\d+)([Ee](\+|-)?\d+)?$/; +let number = /^[+-]?\d*(\d\.|\.\d)?\d*([eE][+-]?\d+)?$/;
73b4e1dee95f584129f03bad8c5a7448eee31b3a
handlers/awsJobs.js
handlers/awsJobs.js
// dependencies ------------------------------------------------------------ import aws from '../libs/aws'; // handlers ---------------------------------------------------------------- /** * Jobs * * Handlers for job actions. */ let handlers = { /** * Describe Job Definitions */ describeJobDefinitions(req, res, next) { aws.batch.sdk.describeJobDefinitions({}, (err, data) => { if (err) { return next(err); } else { let definitions = {}; for (let definition of data.jobDefinitions) { if (!definitions.hasOwnProperty(definition.jobDefinitionName)) { definitions[definition.jobDefinitionName] = {}; } definitions[definition.jobDefinitionName][definition.revision] = definition; } res.send(definitions); } }); }, /** * Submit Job */ submitJob(req, res) { let job = req.body; const batchJobParams = { jobDefinition: job.jobDefinition, jobName: job.jobName, parameters: job.parameters }; batchJobParams.jobQueue = 'bids-queue'; aws.batch.sdk.submitJob(batchJobParams, (err, data) => { res.send(data); }); } }; export default handlers;
// dependencies ------------------------------------------------------------ import aws from '../libs/aws'; import scitran from '../libs/scitran'; // handlers ---------------------------------------------------------------- /** * Jobs * * Handlers for job actions. */ let handlers = { /** * Create Job Definition */ createJobDefinition(req, res, next) { }, /** * Describe Job Definitions */ describeJobDefinitions(req, res, next) { aws.batch.sdk.describeJobDefinitions({}, (err, data) => { if (err) { return next(err); } else { let definitions = {}; for (let definition of data.jobDefinitions) { if (!definitions.hasOwnProperty(definition.jobDefinitionName)) { definitions[definition.jobDefinitionName] = {}; } definitions[definition.jobDefinitionName][definition.revision] = definition; } res.send(definitions); } }); }, /** * Submit Job */ submitJob(req, res) { let job = req.body; const batchJobParams = { jobDefinition: job.jobDefinition, jobName: job.jobName, parameters: job.parameters }; batchJobParams.jobQueue = 'bids-queue'; scitran.downloadSymlinkDataset(job.snapshotId, (err, hash) => { aws.s3.uploadSnapshot(hash, () => { aws.batch.sdk.submitJob(batchJobParams, (err, data) => { res.send(data); }); }); }); } }; export default handlers;
Add stub for creating job definitions. Add back snapshot uploading prior to job submission
Add stub for creating job definitions. Add back snapshot uploading prior to job submission
JavaScript
mit
poldracklab/crn_server,poldracklab/crn_server
--- +++ @@ -1,6 +1,7 @@ // dependencies ------------------------------------------------------------ -import aws from '../libs/aws'; +import aws from '../libs/aws'; +import scitran from '../libs/scitran'; // handlers ---------------------------------------------------------------- @@ -10,6 +11,13 @@ * Handlers for job actions. */ let handlers = { + + /** + * Create Job Definition + */ + createJobDefinition(req, res, next) { + + }, /** * Describe Job Definitions @@ -45,8 +53,12 @@ }; batchJobParams.jobQueue = 'bids-queue'; - aws.batch.sdk.submitJob(batchJobParams, (err, data) => { - res.send(data); + scitran.downloadSymlinkDataset(job.snapshotId, (err, hash) => { + aws.s3.uploadSnapshot(hash, () => { + aws.batch.sdk.submitJob(batchJobParams, (err, data) => { + res.send(data); + }); + }); }); }
bbb6168aef0478fae75da18410a90dd12a9d3fd5
Gruntfile.js
Gruntfile.js
'use strict'; module.exports = function (grunt) { grunt.initConfig({ mochacli: { options: { ui: 'bdd', reporter: 'spec', require: [ 'espower_loader_helper.js' ] }, all: ['test/*Test.js'] }, jshint: { options: { jshintrc: '.jshintrc' }, gruntfile: { src: 'Gruntfile.js' }, lib: { src: ['lib/**/*.js'] }, test: { src: ['test/**/*.js'] } }, watch: { gruntfile: { files: '<%= jshint.gruntfile.src %>', tasks: ['jshint:gruntfile'] }, lib: { files: '<%= jshint.lib.src %>', tasks: ['jshint:lib'] }, test: { files: '<%= jshint.test.src %>', tasks: ['test'] } } }); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-mocha-cli'); grunt.registerTask('test', ['mochacli']); // Default task. grunt.registerTask('default', ['test']); };
'use strict'; module.exports = function (grunt) { grunt.initConfig({ mochacli: { options: { ui: 'bdd', reporter: 'spec', require: [ 'espower_loader_helper.js' ] }, all: ['test/*Test.js'] }, jshint: { options: { jshintrc: '.jshintrc' }, gruntfile: { src: 'Gruntfile.js' }, lib: { src: ['lib/**/*.js'] }, test: { src: ['test/**/*.js'] } }, watch: { gruntfile: { files: '<%= jshint.gruntfile.src %>', tasks: ['jshint:gruntfile'] }, lib: { files: '<%= jshint.lib.src %>', tasks: ['jshint:lib', 'test'] }, test: { files: '<%= jshint.test.src %>', tasks: ['test'] } } }); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-mocha-cli'); grunt.registerTask('test', ['mochacli']); // Default task. grunt.registerTask('default', ['test']); };
Watch and run tests on lib change too.
Watch and run tests on lib change too.
JavaScript
mit
takas-ho/tddbc-201411-js,takas-ho/tddbc-201411-js
--- +++ @@ -32,7 +32,7 @@ }, lib: { files: '<%= jshint.lib.src %>', - tasks: ['jshint:lib'] + tasks: ['jshint:lib', 'test'] }, test: { files: '<%= jshint.test.src %>', @@ -43,7 +43,6 @@ grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-watch'); - grunt.loadNpmTasks('grunt-mocha-cli'); grunt.registerTask('test', ['mochacli']);
d62e85df1a66f6cd6a8d7df237147164f5320190
Gruntfile.js
Gruntfile.js
'use strict'; module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), concat: { dist: { src: ['src/**/*.js'], dest: 'dist/<%= pkg.name %>.js' } }, uglify: { dist: { files: { 'dist/<%= pkg.name %>.min.js': ['<%= concat.dist.dest %>'] } } }, copy: { dist: { src: 'src/**/<%= pkg.name %>.css', dest: 'dist/<%= pkg.name %>.css' }, example: { expand: true, flatten: true, src: ['dist/*'], dest: 'examples/node_modules/gnap-map/dist/' } }, cssmin: { dist: { src: 'dist/<%= pkg.name %>.css', dest: 'dist/<%= pkg.name %>.min.css' } } }); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-contrib-cssmin'); grunt.registerTask('dist', ['concat', 'uglify', 'copy:dist', 'cssmin', 'copy:example']); };
'use strict'; module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), concat: { dist: { src: ['src/**/*.js'], dest: 'dist/<%= pkg.name %>.js' } }, uglify: { dist: { files: { 'dist/<%= pkg.name %>.min.js': ['<%= concat.dist.dest %>'] } } }, copy: { dist: { src: 'src/**/<%= pkg.name %>.css', dest: 'dist/<%= pkg.name %>.css' }, example: { expand: true, flatten: true, src: ['dist/*'], dest: 'example/node_modules/gnap-map/dist/' } }, cssmin: { dist: { src: 'dist/<%= pkg.name %>.css', dest: 'dist/<%= pkg.name %>.min.css' } } }); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-contrib-cssmin'); grunt.registerTask('dist', ['concat', 'uglify', 'copy:dist', 'cssmin', 'copy:example']); };
Fix in publish to example folder
Fix in publish to example folder
JavaScript
bsd-3-clause
infrabel/gnap-map,infrabel/gnap-map
--- +++ @@ -26,7 +26,7 @@ expand: true, flatten: true, src: ['dist/*'], - dest: 'examples/node_modules/gnap-map/dist/' + dest: 'example/node_modules/gnap-map/dist/' } }, cssmin: {
ff0e9e0c7aee05422b63e9cf5516eb9fbcfdd1d1
src/mmw/js/src/core/filters.js
src/mmw/js/src/core/filters.js
"use strict"; var nunjucks = require('nunjucks'); var utils = require('./utils'); var _ = require('lodash'); nunjucks.env = new nunjucks.Environment(); var basicFormatter = new Intl.NumberFormat('en'); var specificFormatter = function(sigFig) { return new Intl.NumberFormat('en',{minimumFractionDigits: sigFig}); }; var cachedFormatters = _.memoize(specificFormatter); nunjucks.env.addFilter('toLocaleString', function(val, n) { if (val===undefined || isNaN(val)) { return val; } if (n) { return cachedFormatters(n).format(val); } else { return basicFormatter.format(val); } }); nunjucks.env.addFilter('filterNoData', utils.filterNoData); nunjucks.env.addFilter('toFriendlyDate', function(date) { return new Date(date).toLocaleString(); });
"use strict"; var nunjucks = require('nunjucks'); var utils = require('./utils'); var _ = require('lodash'); nunjucks.env = new nunjucks.Environment(); if (window.hasOwnProperty('Intl')) { // Intl is available, we should use the faster NumberFormat var basicFormatter = new Intl.NumberFormat('en'), minDigitFormatter = function(n) { return new Intl.NumberFormat('en', { minimumFractionDigits: n }); }, cachedMinDigitFormatter = _.memoize(minDigitFormatter); var toLocaleStringFormatter = function(val, n) { if (val === undefined || isNaN(val)) { return val; } if (n) { return cachedMinDigitFormatter(n).format(val); } else { return basicFormatter.format(val); } }; } else { // Intl is not available, we should use the more compatible toLocaleString var toLocaleStringFormatter = function(val, n) { if (val === undefined || isNaN(val)) { return val; } if (n) { return val.toLocaleString('en', { minimumFractionDigits: n }); } else { return val.toLocaleString('en'); } }; } nunjucks.env.addFilter('toLocaleString', toLocaleStringFormatter); nunjucks.env.addFilter('filterNoData', utils.filterNoData); nunjucks.env.addFilter('toFriendlyDate', function(date) { return new Date(date).toLocaleString(); });
Support older browsers that lack Intl
Support older browsers that lack Intl While Intl.NumberFormat is a much more performant implementation (see #1566), and is supported by all modern browsers, there are still older browsers in the wild that lack support for it. Most notably, Safari 9 and the Android built-in browser do not support it, leaving many users stuck on older iPads and Macs unable to access the site. By checking for Intl support before using it, we ensure backwards compatibility, while also using the more performant modern options wherever available. Refs #1804 :bug: :apple: :globe_with_meridians:
JavaScript
apache-2.0
kdeloach/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,kdeloach/model-my-watershed,kdeloach/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,kdeloach/model-my-watershed,WikiWatershed/model-my-watershed,kdeloach/model-my-watershed
--- +++ @@ -6,29 +6,44 @@ nunjucks.env = new nunjucks.Environment(); -var basicFormatter = new Intl.NumberFormat('en'); +if (window.hasOwnProperty('Intl')) { + // Intl is available, we should use the faster NumberFormat + var basicFormatter = new Intl.NumberFormat('en'), + minDigitFormatter = function(n) { + return new Intl.NumberFormat('en', { minimumFractionDigits: n }); + }, + cachedMinDigitFormatter = _.memoize(minDigitFormatter); -var specificFormatter = function(sigFig) { - return new Intl.NumberFormat('en',{minimumFractionDigits: sigFig}); -}; + var toLocaleStringFormatter = function(val, n) { + if (val === undefined || isNaN(val)) { + return val; + } -var cachedFormatters = _.memoize(specificFormatter); + if (n) { + return cachedMinDigitFormatter(n).format(val); + } else { + return basicFormatter.format(val); + } + }; +} else { + // Intl is not available, we should use the more compatible toLocaleString + var toLocaleStringFormatter = function(val, n) { + if (val === undefined || isNaN(val)) { + return val; + } -nunjucks.env.addFilter('toLocaleString', function(val, n) { - if (val===undefined || isNaN(val)) { - return val; - } + if (n) { + return val.toLocaleString('en', { minimumFractionDigits: n }); + } else { + return val.toLocaleString('en'); + } + }; +} - if (n) { - return cachedFormatters(n).format(val); - } else { - return basicFormatter.format(val); - } -}); +nunjucks.env.addFilter('toLocaleString', toLocaleStringFormatter); nunjucks.env.addFilter('filterNoData', utils.filterNoData); nunjucks.env.addFilter('toFriendlyDate', function(date) { return new Date(date).toLocaleString(); }); -
6f1262a480b7d37093e1367e21a26a41ed95181e
app/assets/javascripts/switch_meter.js
app/assets/javascripts/switch_meter.js
$(document).on("turbolinks:load", function() { $(".first-date-picker").datepicker( { dateFormat: 'DD, d MM yy', altFormat: 'yy-mm-dd', altField: "#first_date", // minDate: -42, maxDate: -1, orientation: 'bottom', changeMonth: true, changeYear: true }); $(".to-date-picker").datepicker( { dateFormat: 'DD, d MM yy', altFormat: 'yy-mm-dd', altField: "#to_date", // minDate: -42, maxDate: -1, orientation: 'bottom', changeMonth: true, changeYear: true }); }); function updateChart(el) { chart_id = el.form.id.replace("-filter", ""); chart = Chartkick.charts[chart_id]; current_source = chart.getDataSource(); new_source = current_source.split("?")[0] + "?" + $(el.form).serialize(); chart.updateData(new_source); chart.getChartObject().showLoading(); } $(document).on('change', '.meter-filter', function() { updateChart(this); }); $(document).on('change', '.first-date-picker', function() { updateChart(this); }); $(document).on('change', '.to-date-picker', function() { updateChart(this); });
$(document).on("turbolinks:load", function() { $(".first-date-picker").datepicker( { dateFormat: 'DD, d MM yy', altFormat: 'yy-mm-dd', altField: $(".first-date-picker").parents("form:first").find("#first_date"), // minDate: -42, maxDate: -1, orientation: 'bottom', changeMonth: true, changeYear: true }); $(".to-date-picker").datepicker( { dateFormat: 'DD, d MM yy', altFormat: 'yy-mm-dd', altField: $(".first-date-picker").parents("form:first").find("#to_date"), // minDate: -42, maxDate: -1, orientation: 'bottom', changeMonth: true, changeYear: true }); }); function updateChart(el) { chart_id = el.form.id.replace("-filter", ""); chart = Chartkick.charts[chart_id]; current_source = chart.getDataSource(); new_source = current_source.split("?")[0] + "?" + $(el.form).serialize(); chart.updateData(new_source); chart.getChartObject().showLoading(); } $(document).on('change', '.meter-filter', function() { updateChart(this); }); $(document).on('change', '.first-date-picker', function() { updateChart(this); }); $(document).on('change', '.to-date-picker', function() { updateChart(this); });
Fix issue with switching when there is dual supply
Fix issue with switching when there is dual supply
JavaScript
mit
BathHacked/energy-sparks,BathHacked/energy-sparks,BathHacked/energy-sparks,BathHacked/energy-sparks
--- +++ @@ -4,7 +4,7 @@ { dateFormat: 'DD, d MM yy', altFormat: 'yy-mm-dd', - altField: "#first_date", + altField: $(".first-date-picker").parents("form:first").find("#first_date"), // minDate: -42, maxDate: -1, orientation: 'bottom', @@ -16,7 +16,7 @@ { dateFormat: 'DD, d MM yy', altFormat: 'yy-mm-dd', - altField: "#to_date", + altField: $(".first-date-picker").parents("form:first").find("#to_date"), // minDate: -42, maxDate: -1, orientation: 'bottom',
7cc81eb68da50a7b505a8669885af646e4a45241
app/containers/HomePage/Login/index.js
app/containers/HomePage/Login/index.js
import ActionExitToApp from 'material-ui/svg-icons/action/exit-to-app'; import { defaultProps, setDisplayName, setPropTypes } from 'recompose'; import RaisedButton from 'material-ui/RaisedButton'; import React from 'react'; import R from 'ramda'; const Login = () => <RaisedButton label="login with imgur" fullWidth style={{ marginTop: '15%' }} > <ActionExitToApp /> </RaisedButton>; const enhance = R.pipe( defaultProps({ getImgurToken: () => {}, }), setPropTypes({ getImgurToken: React.PropTypes.func, }), setDisplayName('Login'), ); export { Login }; export default enhance(Login);
import ActionExitToApp from 'material-ui/svg-icons/action/exit-to-app'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import { defaultProps, setDisplayName, setPropTypes } from 'recompose'; import RaisedButton from 'material-ui/RaisedButton'; import React from 'react'; import R from 'ramda'; import getImgurTokenAction from '../../../interactions/imgur/actions'; const Login = ({ getImgurToken }) => // eslint-disable-line react/prop-types <RaisedButton label="login with imgur" fullWidth style={{ marginTop: '15%' }} onClick={getImgurToken} > <ActionExitToApp /> </RaisedButton>; const mapDispatchToProps = (dispatch) => bindActionCreators({ getImgurToken: getImgurTokenAction, }, dispatch); const enhance = R.pipe( defaultProps({ getImgurToken: () => {}, }), setPropTypes({ getImgurToken: React.PropTypes.func, }), connect(null, mapDispatchToProps), setDisplayName('Login'), ); export { Login }; export default enhance(Login);
Add onClick function to `Login`
Add onClick function to `Login` Use a suffix for `getImgurToken` to solve the no-shadow linting conflict. Although the prop types for `getImgurToken` are defined through a recompose function, the linter indicates a false error.
JavaScript
mit
romy/personal-imgur-gallery,romy/personal-imgur-gallery
--- +++ @@ -1,18 +1,28 @@ import ActionExitToApp from 'material-ui/svg-icons/action/exit-to-app'; +import { bindActionCreators } from 'redux'; +import { connect } from 'react-redux'; import { defaultProps, setDisplayName, setPropTypes } from 'recompose'; import RaisedButton from 'material-ui/RaisedButton'; import React from 'react'; import R from 'ramda'; +import getImgurTokenAction from '../../../interactions/imgur/actions'; -const Login = () => + +const Login = ({ getImgurToken }) => // eslint-disable-line react/prop-types <RaisedButton label="login with imgur" fullWidth style={{ marginTop: '15%' }} + onClick={getImgurToken} > <ActionExitToApp /> </RaisedButton>; + +const mapDispatchToProps = (dispatch) => + bindActionCreators({ + getImgurToken: getImgurTokenAction, + }, dispatch); const enhance = R.pipe( defaultProps({ @@ -21,6 +31,7 @@ setPropTypes({ getImgurToken: React.PropTypes.func, }), + connect(null, mapDispatchToProps), setDisplayName('Login'), );
94ed33ff52d90b3b153f5fd09069e09b29d530d1
xmlToJson/index.js
xmlToJson/index.js
var fs = rquire('fs'); module.exports = function (context, xmlZipBlob) { context.log('Node.js blob trigger function processed blob:', xmlZipBlob); console.log(`typeof xmlZipBlob:`, typeof xmlZipBlob); fs.writeFile('xmlZip.zip', xmlZipBlob, (err) => { if (err) { throw err; } console.log('saved blob to loal file called xmlZip.zip'); }); context.done(); };
var fs = require('fs'); module.exports = function (context, xmlZipBlob) { context.log('Node.js blob trigger function processed blob:', xmlZipBlob); context.log(`typeof xmlZipBlob:`, typeof xmlZipBlob); fs.writeFile('xmlZip.zip', xmlZipBlob, (err) => { if (err) { throw err; } context.log('saved blob to loal file called xmlZip.zip'); }); context.done(); };
Fix typos and use context instead of console
Fix typos and use context instead of console
JavaScript
mit
mattmazzola/sc2iq-azure-functions
--- +++ @@ -1,15 +1,15 @@ -var fs = rquire('fs'); +var fs = require('fs'); module.exports = function (context, xmlZipBlob) { context.log('Node.js blob trigger function processed blob:', xmlZipBlob); - console.log(`typeof xmlZipBlob:`, typeof xmlZipBlob); + context.log(`typeof xmlZipBlob:`, typeof xmlZipBlob); fs.writeFile('xmlZip.zip', xmlZipBlob, (err) => { if (err) { throw err; } - console.log('saved blob to loal file called xmlZip.zip'); + context.log('saved blob to loal file called xmlZip.zip'); }); context.done();
d53860ae453ed40e410af32ac5d1b7baa84f5950
Gruntfile.js
Gruntfile.js
module.exports = function (grunt) { 'use strict'; grunt.initConfig({ jshint: { options: grunt.file.readJSON('.jshintrc'), gruntfile: 'Gruntfile.js', bin: { src: [ 'bin/*.js', 'bin/yo' ] }, test: { options: { globals: { describe: true, it: true, beforeEach: true, afterEach: true, before: true, after: true } }, src: 'test/**/*.js' } }, watch: { files: [ 'Gruntfile.js', '<%= jshint.test.src %>', '<%= jshint.bin.src %>' ], tasks: [ 'jshint', 'mochaTest' ] }, mochaTest: { test: { options: { slow: 1500, timeout: 50000, reporter: 'spec', globals: [ 'events', 'AssertionError', 'TAP_Global_Harness' ] }, src: ['test/**/*.js'] } } }); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-mocha-test'); grunt.registerTask('default', ['jshint', 'mochaTest']); };
module.exports = function (grunt) { 'use strict'; grunt.initConfig({ jshint: { options: grunt.file.readJSON('.jshintrc'), gruntfile: 'Gruntfile.js', bin: [ 'cli.js', 'yoyo.js' ], test: { options: { globals: { describe: true, it: true, beforeEach: true, afterEach: true, before: true, after: true } }, src: 'test/**/*.js' } }, watch: { files: [ 'Gruntfile.js', '<%= jshint.test.src %>', '<%= jshint.bin.src %>' ], tasks: [ 'jshint', 'mochaTest' ] }, mochaTest: { test: { options: { slow: 1500, timeout: 50000, reporter: 'spec', globals: [ 'events', 'AssertionError', 'TAP_Global_Harness' ] }, src: ['test/**/*.js'] } } }); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-mocha-test'); grunt.registerTask('default', ['jshint', 'mochaTest']); };
Fix linting paths to match previous refactor
Fix linting paths to match previous refactor
JavaScript
bsd-2-clause
yeoman/yo
--- +++ @@ -5,12 +5,7 @@ jshint: { options: grunt.file.readJSON('.jshintrc'), gruntfile: 'Gruntfile.js', - bin: { - src: [ - 'bin/*.js', - 'bin/yo' - ] - }, + bin: [ 'cli.js', 'yoyo.js' ], test: { options: { globals: { @@ -30,7 +25,7 @@ 'Gruntfile.js', '<%= jshint.test.src %>', '<%= jshint.bin.src %>' - + ], tasks: [ 'jshint',
7efd2e90aa25f7ded66d2c69d78a285825d02f2d
Gruntfile.js
Gruntfile.js
module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), run: { app: { options: { wait: false }, cmd: 'node', args: ['app.js'] } }, simplemocha: { control: { src: ['specs/sandbox-control.spec.js'] }, jsonRpc: { src: ['specs/sandbox-json-rpc.spec.js'] } } }); grunt.loadNpmTasks('grunt-run'); grunt.loadNpmTasks('grunt-simple-mocha'); grunt.registerTask('test', [ 'run:app', 'simplemocha', 'stop:app' ]); grunt.registerTask('default', []); };
module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), run: { app: { options: { wait: false }, cmd: 'node', args: ['app.js'] } }, simplemocha: { control: { src: ['specs/sandbox-control.spec.js'] }, jsonRpc: { src: ['specs/sandbox-json-rpc.spec.js'] } } }); grunt.loadNpmTasks('grunt-run'); grunt.loadNpmTasks('grunt-simple-mocha'); grunt.registerTask('simplemochaGrep', function() { grunt.config('simplemocha.options.grep', grunt.option('grep')); grunt.task.run('simplemocha'); }); grunt.registerTask('test', [ 'run:app', 'simplemochaGrep', 'stop:app' ]); grunt.registerTask('default', []); };
Add grep argument to run tests with a filter
Add grep argument to run tests with a filter
JavaScript
agpl-3.0
ether-camp/ethereum-sandbox
--- +++ @@ -19,9 +19,14 @@ grunt.loadNpmTasks('grunt-run'); grunt.loadNpmTasks('grunt-simple-mocha'); + grunt.registerTask('simplemochaGrep', function() { + grunt.config('simplemocha.options.grep', grunt.option('grep')); + grunt.task.run('simplemocha'); + }); + grunt.registerTask('test', [ 'run:app', - 'simplemocha', + 'simplemochaGrep', 'stop:app' ]); grunt.registerTask('default', []);
e7e7da9fac092e06d6a234d2be0fc522da5585a5
Gruntfile.js
Gruntfile.js
module.exports = function(grunt) { var attache = { buildDir: 'dist' }; // Project configuration. grunt.initConfig({ appConfig: attache, pkg: grunt.file.readJSON('package.json'), jsdoc : { dist : { src: ['attache.js', 'attache-jquery.js'], options: { destination: 'doc' } } } // copy: { // // NOTE: copy MUST have a target - just using copy: { files: ... } yields an 'missing indexOf' error // build: { // files: [ // {src: ['css/fonts/*'], dest: '<%= appConfig.buildDir %>/', filter: 'isFile'}, // {src: ['videos/*'], dest: '<%= appConfig.buildDir %>/', filter: 'isFile'} // ] // } // }, // uglify: { // options: { // report: 'gzip', // mangle: false // } // } }); grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-jsdoc'); grunt.registerTask('default', [ 'jsdoc' ]); };
module.exports = function(grunt) { var attache = { buildDir: 'dist' }; // Project configuration. grunt.initConfig({ appConfig: attache, pkg: grunt.file.readJSON('package.json'), jsdoc : { dist : { src: ['attache.js', 'attache-jquery.js'], options: { destination: 'doc', private: false } } } // copy: { // // NOTE: copy MUST have a target - just using copy: { files: ... } yields an 'missing indexOf' error // build: { // files: [ // {src: ['css/fonts/*'], dest: '<%= appConfig.buildDir %>/', filter: 'isFile'}, // {src: ['videos/*'], dest: '<%= appConfig.buildDir %>/', filter: 'isFile'} // ] // } // }, // uglify: { // options: { // report: 'gzip', // mangle: false // } // } }); grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-jsdoc'); grunt.registerTask('default', [ 'jsdoc' ]); };
Exclude private functions from documentation
Exclude private functions from documentation
JavaScript
mit
janfoeh/attachejs,janfoeh/attachejs,janfoeh/attachejs
--- +++ @@ -12,7 +12,8 @@ dist : { src: ['attache.js', 'attache-jquery.js'], options: { - destination: 'doc' + destination: 'doc', + private: false } } }
6aa47fbe9e0185398d1dce628a9f7308455c1600
Gruntfile.js
Gruntfile.js
module.exports = function (grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), bower: { install: { options: { targetDir: './lib/ui', layout: 'byComponent', install: true, verbose: false, cleanTargetDir: true, cleanBowerDir: true, bowerOptions: {} } } }, jasmine_node: { all: 'spec/server/' }, jasmine: { }, express: { options: { }, dev: { options: { script: 'src/server/app.js', port: 1234 } } }, watch: { express: { files: [ 'src/server/**/*.js' ], tasks: [ 'express:dev' ], options: { spawn: false } } } }); grunt.loadNpmTasks('grunt-bower-task'); grunt.loadNpmTasks('grunt-jasmine-node'); grunt.loadNpmTasks('grunt-contrib-jasmine'); grunt.loadNpmTasks('grunt-express-server'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.registerTask('default', ['jasmine_node']); grunt.registerTask('run', ['express:dev', 'watch']); };
module.exports = function (grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), bower: { install: { options: { targetDir: './lib/ui', layout: 'byComponent', install: true, verbose: false, cleanTargetDir: true, cleanBowerDir: true, bowerOptions: {} } } }, jasmine_node: { all: 'spec/server/' }, jasmine: { }, express: { options: { }, dev: { options: { script: 'src/server/app.js', port: 3000 } } }, watch: { express: { files: [ 'src/server/**/*.js' ], tasks: [ 'express:dev' ], options: { spawn: false } } } }); grunt.loadNpmTasks('grunt-bower-task'); grunt.loadNpmTasks('grunt-jasmine-node'); grunt.loadNpmTasks('grunt-contrib-jasmine'); grunt.loadNpmTasks('grunt-express-server'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.registerTask('default', ['jasmine_node']); grunt.registerTask('run', ['express:dev', 'watch']); };
Set dev port back to 3000
Set dev port back to 3000
JavaScript
mit
iknowcss/rmd-dashboard
--- +++ @@ -28,7 +28,7 @@ dev: { options: { script: 'src/server/app.js', - port: 1234 + port: 3000 } } },
f9c828be3c1a9c647757565f285a67c5e6d814cb
scopes-chains-closures/scopes.js
scopes-chains-closures/scopes.js
function foo() { var bar; function zip() { var quux; } }
function foo() { var bar; quux = 42; function zip() { var quux = 42+42; } }
Complete 'Global scope & Shadowing' challenge in 'Scopes chains closures' tutorial
Complete 'Global scope & Shadowing' challenge in 'Scopes chains closures' tutorial
JavaScript
mit
PaoloLaurenti/nodeschool
--- +++ @@ -1,6 +1,7 @@ function foo() { var bar; + quux = 42; function zip() { - var quux; + var quux = 42+42; } }
4447aedd0b2fa88be5ffa8f0d1aef7e0a9289116
gulpfile.js/tasks/styles.js
gulpfile.js/tasks/styles.js
var gulp = require('gulp'); var browserSync = require('browser-sync'); var sass = require('gulp-sass'); var sourcemaps = require('gulp-sourcemaps'); var handleErrors = require('../util/handleErrors'); var config = require('../config').styles; var autoprefixer = require('gulp-autoprefixer'); gulp.task('styles', function () { return gulp.src(config.src) .pipe(sourcemaps.init()) .pipe(sass(config.settings)) .on('error', handleErrors) .pipe(sourcemaps.write()) .pipe(autoprefixer({ browsers: ['last 2 version'] })) .pipe(gulp.dest(config.dest)) .pipe(browserSync.reload({stream:true})); });
var gulp = require('gulp'); var browserSync = require('browser-sync'); var sass = require('gulp-sass'); var sourcemaps = require('gulp-sourcemaps'); var handleErrors = require('../util/handleErrors'); var config = require('../config').styles; var autoprefixer = require('gulp-autoprefixer'); gulp.task('styles', function () { return gulp.src(config.src) .pipe(sourcemaps.init()) .pipe(sass(config.settings)) .on('error', handleErrors) .pipe(autoprefixer({ browsers: ['last 2 version'] })) .pipe(sourcemaps.write()) .pipe(gulp.dest(config.dest)) .pipe(browserSync.reload({stream:true})); });
Include Autoprefixer into sourcemaps process
Include Autoprefixer into sourcemaps process
JavaScript
mit
Bastly/bastly-tumblr-theme,Bastly/bastly-tumblr-theme
--- +++ @@ -11,8 +11,8 @@ .pipe(sourcemaps.init()) .pipe(sass(config.settings)) .on('error', handleErrors) + .pipe(autoprefixer({ browsers: ['last 2 version'] })) .pipe(sourcemaps.write()) - .pipe(autoprefixer({ browsers: ['last 2 version'] })) .pipe(gulp.dest(config.dest)) .pipe(browserSync.reload({stream:true})); });
beea183636b98f0a8119625365e8af37384edc4d
api/db/migrations/20170418114929_remove_login_from_users.js
api/db/migrations/20170418114929_remove_login_from_users.js
const TABLE_NAME = 'users'; exports.up = function(knex, Promise) { return Promise.all([ knex.schema.table(TABLE_NAME, function (table) { table.dropColumn('login'); table.boolean('cgu'); }) ]); }; exports.down = function(knex, Promise) { return Promise.all([ knex.schema.table(TABLE_NAME, function (table) { table.string('login').defaultTo("").notNullable(); table.dropColumn('cgu'); }) ]); };
const TABLE_NAME = 'users'; exports.up = function(knex, Promise) { return Promise.all([ knex.schema.table(TABLE_NAME, function (table) { table.dropColumn('login'); table.boolean('cgu'); table.unique('email'); }) ]); }; exports.down = function(knex, Promise) { return Promise.all([ knex.schema.table(TABLE_NAME, function (table) { table.string('login').defaultTo("").notNullable(); table.dropColumn('cgu'); }) ]); };
Revert "FIX - Removing unique constraint on user.email from migration script"
Revert "FIX - Removing unique constraint on user.email from migration script" This reverts commit c6cedc7fa613c9f376b5d59938acdaad1e4eae7f.
JavaScript
agpl-3.0
sgmap/pix,sgmap/pix,sgmap/pix,sgmap/pix
--- +++ @@ -6,6 +6,7 @@ knex.schema.table(TABLE_NAME, function (table) { table.dropColumn('login'); table.boolean('cgu'); + table.unique('email'); }) ]);
bc11793c04236270996f506e7bd4b6bceddc9543
examples/todomvc-flux/js/components/Header.react.js
examples/todomvc-flux/js/components/Header.react.js
/** * Copyright 2013-2014 Facebook, 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. * * @jsx React.DOM */ var React = require('react'); var TodoActions = require('../actions/TodoActions'); var TodoTextInput = require('./TodoTextInput.react'); var Header = React.createClass({ /** * @return {object} */ render: function() { return ( <header id="header"> <h1>todos</h1> <TodoTextInput id="new-todo" placeholder="What needs to be done?" onSave={this._onSave} /> </header> ); }, /** * Event handler called within TodoTextInput. * Defining this here allows TodoTextInput to be used in multiple places * in different ways. * @param {string} text */ _onSave: function(text) { if(text.trim()){ TodoActions.create(text); } } }); module.exports = Header;
/** * Copyright 2013-2014 Facebook, 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. * * @jsx React.DOM */ var React = require('react'); var TodoActions = require('../actions/TodoActions'); var TodoTextInput = require('./TodoTextInput.react'); var Header = React.createClass({ /** * @return {object} */ render: function() { return ( <header id="header"> <h1>todos</h1> <TodoTextInput id="new-todo" placeholder="What needs to be done?" onSave={this._onSave} /> </header> ); }, /** * Event handler called within TodoTextInput. * Defining this here allows TodoTextInput to be used in multiple places * in different ways. * @param {string} text */ _onSave: function(text) { if (text.trim()){ TodoActions.create(text); } } }); module.exports = Header;
Fix code style in TodoMVC Flux example
Fix code style in TodoMVC Flux example
JavaScript
bsd-3-clause
ms-carterk/react,gregrperkins/react,sejoker/react,BreemsEmporiumMensToiletriesFragrances/react,mohitbhatia1994/react,dmitriiabramov/react,ning-github/react,pyitphyoaung/react,chicoxyzzy/react,bruderstein/server-react,insionng/react,jordanpapaleo/react,Nieralyte/react,liyayun/react,glenjamin/react,magalhas/react,Jyrno42/react,kaushik94/react,dortonway/react,arasmussen/react,lucius-feng/react,gfogle/react,temnoregg/react,MichelleTodd/react,k-cheng/react,yisbug/react,zhangwei001/react,honger05/react,nickpresta/react,salzhrani/react,OculusVR/react,cody/react,Jonekee/react,stanleycyang/react,hejld/react,nhunzaker/react,cpojer/react,alvarojoao/react,stardev24/react,agideo/react,it33/react,pswai/react,jordanpapaleo/react,jordanpapaleo/react,1yvT0s/react,pletcher/react,jagdeesh109/react,framp/react,neomadara/react,tywinstark/react,hejld/react,mjul/react,jkcaptain/react,zs99/react,restlessdesign/react,orneryhippo/react,andrescarceller/react,chacbumbum/react,dgdblank/react,richiethomas/react,btholt/react,bestwpw/react,ABaldwinHunter/react-engines,billfeller/react,huanglp47/react,0x00evil/react,levibuzolic/react,shergin/react,pdaddyo/react,supriyantomaftuh/react,temnoregg/react,shripadk/react,livepanzo/react,gold3bear/react,tomv564/react,patrickgoudjoako/react,vikbert/react,richiethomas/react,silvestrijonathan/react,sarvex/react,nickpresta/react,vjeux/react,thr0w/react,guoshencheng/react,wesbos/react,glenjamin/react,apaatsio/react,cesine/react,ericyang321/react,reggi/react,rohannair/react,maxschmeling/react,VukDukic/react,savelichalex/react,christer155/react,andrescarceller/react,honger05/react,leohmoraes/react,it33/react,empyrical/react,BorderTravelerX/react,trellowebinars/react,claudiopro/react,wmydz1/react,dgdblank/react,vjeux/react,facebook/react,AlmeroSteyn/react,joecritch/react,jsdf/react,nLight/react,reactjs-vn/reactjs_vndev,dmitriiabramov/react,zorojean/react,glenjamin/react,billfeller/react,reactkr/react,thr0w/react,ramortegui/react,ABaldwinHunter/react-engines,DJCordhose/react,livepanzo/react,mtsyganov/react,evilemon/react,garbles/react,sebmarkbage/react,krasimir/react,chrisbolin/react,lonely8rain/react,luomiao3/react,inuscript/react,lyip1992/react,tywinstark/react,jfschwarz/react,psibi/react,rgbkrk/react,dmatteo/react,tako-black/react-1,mcanthony/react,reactkr/react,ABaldwinHunter/react-classic,aickin/react,reggi/react,greglittlefield-wf/react,zorojean/react,vikbert/react,dfosco/react,ZhouYong10/react,vjeux/react,mingyaaaa/react,gfogle/react,rickbeerendonk/react,obimod/react,howtolearntocode/react,odysseyscience/React-IE-Alt,nomanisan/react,shergin/react,kolmstead/react,musofan/react,alexanther1012/react,jbonta/react,soulcm/react,iOSDevBlog/react,DJCordhose/react,gajus/react,AlexJeng/react,ManrajGrover/react,yiminghe/react,haoxutong/react,hzoo/react,Nieralyte/react,roth1002/react,ericyang321/react,joon1030/react,dariocravero/react,ssyang0102/react,kamilio/react,wjb12/react,pwmckenna/react,Furzikov/react,andreypopp/react,billfeller/react,jontewks/react,theseyi/react,prathamesh-sonpatki/react,jdlehman/react,deepaksharmacse12/react,genome21/react,yongxu/react,kolmstead/react,roylee0704/react,garbles/react,ridixcr/react,syranide/react,zofuthan/react,niubaba63/react,Jonekee/react,pswai/react,haoxutong/react,linqingyicen/react,yjyi/react,venkateshdaram434/react,tjsavage/react,AnSavvides/react,pswai/react,jzmq/react,edvinerikson/react,kevinrobinson/react,zofuthan/react,jonhester/react,AlmeroSteyn/react,Furzikov/react,silvestrijonathan/react,carlosipe/react,Spotinux/react,cinic/react,jagdeesh109/react,rasj/react,joe-strummer/react,salier/react,bspaulding/react,ameyms/react,vipulnsward/react,genome21/react,conorhastings/react,mgmcdermott/react,spt110/react,greysign/react,yulongge/react,prometheansacrifice/react,jessebeach/react,MotherNature/react,ericyang321/react,VioletLife/react,jquense/react,zeke/react,jimfb/react,glenjamin/react,agideo/react,levibuzolic/react,gleborgne/react,kaushik94/react,yjyi/react,wmydz1/react,silkapp/react,OculusVR/react,nhunzaker/react,scottburch/react,linmic/react,salzhrani/react,airondumael/react,wuguanghai45/react,zenlambda/react,mik01aj/react,hzoo/react,zs99/react,studiowangfei/react,jlongster/react,nhunzaker/react,TheBlasfem/react,zigi74/react,leohmoraes/react,flarnie/react,lennerd/react,livepanzo/react,conorhastings/react,cody/react,ZhouYong10/react,kay-is/react,brigand/react,benjaffe/react,rgbkrk/react,cpojer/react,jzmq/react,rickbeerendonk/react,agileurbanite/react,Simek/react,gpbl/react,Rafe/react,yisbug/react,concerned3rdparty/react,musofan/react,jlongster/react,ilyachenko/react,brigand/react,soulcm/react,mgmcdermott/react,chrismoulton/react,joe-strummer/react,it33/react,dirkliu/react,yiminghe/react,stardev24/react,linmic/react,thr0w/react,quip/react,iamdoron/react,varunparkhe/react,ms-carterk/react,cinic/react,krasimir/react,RReverser/react,supriyantomaftuh/react,yuhualingfeng/react,greglittlefield-wf/react,joshblack/react,jessebeach/react,jzmq/react,jessebeach/react,brillantesmanuel/react,ashwin01/react,temnoregg/react,dirkliu/react,Jericho25/react,mik01aj/react,Jericho25/react,gpazo/react,gajus/react,devonharvey/react,cpojer/react,gxr1020/react,dilidili/react,yangshun/react,jedwards1211/react,silkapp/react,TaaKey/react,jontewks/react,eoin/react,sasumi/react,skyFi/react,Flip120/react,zs99/react,jedwards1211/react,LoQIStar/react,albulescu/react,xiaxuewuhen001/react,lonely8rain/react,MotherNature/react,tarjei/react,ManrajGrover/react,musofan/react,jakeboone02/react,yuhualingfeng/react,silppuri/react,patrickgoudjoako/react,MotherNature/react,lastjune/react,rgbkrk/react,k-cheng/react,nickdima/react,iammerrick/react,christer155/react,psibi/react,PeterWangPo/react,wushuyi/react,camsong/react,brigand/react,Instrument/react,felixgrey/react,miaozhirui/react,wmydz1/react,jakeboone02/react,conorhastings/react,hzoo/react,zigi74/react,kalloc/react,STRML/react,dgreensp/react,jontewks/react,iamchenxin/react,bitshadow/react,perperyu/react,claudiopro/react,jfschwarz/react,thomasboyt/react,tom-wang/react,chacbumbum/react,bspaulding/react,jmacman007/react,shripadk/react,joshblack/react,cpojer/react,usgoodus/react,jimfb/react,savelichalex/react,ms-carterk/react,ouyangwenfeng/react,panhongzhi02/react,salier/react,JoshKaufman/react,qq316278987/react,digideskio/react,rohannair/react,jonhester/react,dirkliu/react,JoshKaufman/react,ThinkedCoder/react,tako-black/react-1,gpbl/react,anushreesubramani/react,perterest/react,venkateshdaram434/react,manl1100/react,hejld/react,jameszhan/react,lennerd/react,framp/react,kakadiya91/react,conorhastings/react,skomski/react,yabhis/react,react-china/react-docs,misnet/react,bhamodi/react,gougouGet/react,levibuzolic/react,stanleycyang/react,gregrperkins/react,mosoft521/react,easyfmxu/react,gitignorance/react,bhamodi/react,yungsters/react,levibuzolic/react,staltz/react,react-china/react-docs,STRML/react,kchia/react,edmellum/react,yongxu/react,quip/react,jorrit/react,dgladkov/react,billfeller/react,mjul/react,camsong/react,vikbert/react,joecritch/react,TylerBrock/react,iamchenxin/react,concerned3rdparty/react,Flip120/react,yut148/react,nLight/react,elquatro/react,sergej-kucharev/react,mfunkie/react,wushuyi/react,dgreensp/react,edmellum/react,slongwang/react,airondumael/react,evilemon/react,mnordick/react,andreypopp/react,howtolearntocode/react,slongwang/react,zs99/react,songawee/react,slongwang/react,honger05/react,ssyang0102/react,crsr/react,vikbert/react,JoshKaufman/react,PrecursorApp/react,ericyang321/react,wesbos/react,getshuvo/react,trellowebinars/react,jakeboone02/react,deepaksharmacse12/react,1234-/react,laogong5i0/react,perterest/react,richiethomas/react,mjackson/react,skevy/react,spt110/react,ledrui/react,elquatro/react,jorrit/react,angeliaz/react,tomocchino/react,ledrui/react,dustin-H/react,stevemao/react,microlv/react,bitshadow/react,sdiaz/react,brillantesmanuel/react,mosoft521/react,MichelleTodd/react,10fish/react,bspaulding/react,tomocchino/react,alvarojoao/react,rickbeerendonk/react,inuscript/react,misnet/react,gregrperkins/react,JoshKaufman/react,trungda/react,dittos/react,vincentism/react,glenjamin/react,yongxu/react,magalhas/react,dmitriiabramov/react,stardev24/react,rohannair/react,mhhegazy/react,jeffchan/react,quip/react,gitoneman/react,aaron-goshine/react,tomv564/react,aaron-goshine/react,bitshadow/react,dfosco/react,jbonta/react,ipmobiletech/react,usgoodus/react,ericyang321/react,yasaricli/react,jameszhan/react,pletcher/react,arkist/react,juliocanares/react,facebook/react,theseyi/react,zeke/react,ramortegui/react,sebmarkbage/react,cody/react,eoin/react,vipulnsward/react,yiminghe/react,yuhualingfeng/react,diegobdev/react,patryknowak/react,usgoodus/react,wushuyi/react,JanChw/react,dgreensp/react,anushreesubramani/react,edvinerikson/react,jeffchan/react,sasumi/react,jedwards1211/react,mcanthony/react,mtsyganov/react,lonely8rain/react,spicyj/react,leexiaosi/react,jeffchan/react,zigi74/react,jfschwarz/react,gajus/react,wjb12/react,ninjaofawesome/reaction,laskos/react,kevinrobinson/react,chippieTV/react,chenglou/react,lastjune/react,10fish/react,insionng/react,yasaricli/react,vincentnacar02/react,inuscript/react,mjul/react,Jonekee/react,gj262/react,nomanisan/react,lina/react,neusc/react,yhagio/react,linqingyicen/react,patrickgoudjoako/react,ArunTesco/react,BreemsEmporiumMensToiletriesFragrances/react,willhackett/react,empyrical/react,haoxutong/react,varunparkhe/react,AlmeroSteyn/react,kchia/react,gregrperkins/react,honger05/react,joecritch/react,conorhastings/react,tako-black/react-1,michaelchum/react,agileurbanite/react,STRML/react,Simek/react,chinakids/react,chacbumbum/react,eoin/react,mohitbhatia1994/react,ashwin01/react,songawee/react,jmacman007/react,mtsyganov/react,jquense/react,gajus/react,marocchino/react,popovsh6/react,linqingyicen/react,felixgrey/react,tywinstark/react,arasmussen/react,concerned3rdparty/react,yut148/react,LoQIStar/react,bleyle/react,with-git/react,devonharvey/react,sasumi/react,rricard/react,ms-carterk/react,alvarojoao/react,dgdblank/react,1040112370/react,magalhas/react,Flip120/react,camsong/react,maxschmeling/react,jlongster/react,benchling/react,nsimmons/react,james4388/react,Simek/react,sverrejoh/react,gold3bear/react,AmericanSundown/react,yangshun/react,kevinrobinson/react,1234-/react,linalu1/react,jeromjoy/react,james4388/react,flarnie/react,jsdf/react,nathanmarks/react,jeffchan/react,dariocravero/react,acdlite/react,skevy/react,aickin/react,deepaksharmacse12/react,jsdf/react,neusc/react,prometheansacrifice/react,digideskio/react,psibi/react,zs99/react,kaushik94/react,jorrit/react,jsdf/react,pdaddyo/react,TaaKey/react,MoOx/react,marocchino/react,jfschwarz/react,andreypopp/react,savelichalex/react,microlv/react,pyitphyoaung/react,dgdblank/react,Riokai/react,Duc-Ngo-CSSE/react,concerned3rdparty/react,szhigunov/react,chippieTV/react,orneryhippo/react,wzpan/react,laskos/react,dgladkov/react,OculusVR/react,chenglou/react,iamdoron/react,MichelleTodd/react,miaozhirui/react,garbles/react,dittos/react,reactjs-vn/reactjs_vndev,k-cheng/react,roylee0704/react,nickdima/react,pletcher/react,kay-is/react,AlmeroSteyn/react,agideo/react,ABaldwinHunter/react-classic,Rafe/react,wzpan/react,KevinTCoughlin/react,andrerpena/react,AlmeroSteyn/react,andrewsokolov/react,Diaosir/react,ajdinhedzic/react,AlmeroSteyn/react,IndraVikas/react,S0lahart-AIRpanas-081905220200-Service/react,it33/react,haoxutong/react,gajus/react,genome21/react,bitshadow/react,howtolearntocode/react,stanleycyang/react,TylerBrock/react,dgdblank/react,AlexJeng/react,arasmussen/react,pyitphyoaung/react,zyt01/react,jiangzhixiao/react,terminatorheart/react,Furzikov/react,popovsh6/react,neomadara/react,mgmcdermott/react,angeliaz/react,billfeller/react,guoshencheng/react,staltz/react,Spotinux/react,STRML/react,roylee0704/react,hawsome/react,vipulnsward/react,jmptrader/react,jlongster/react,roylee0704/react,hawsome/react,zofuthan/react,haoxutong/react,vikbert/react,ajdinhedzic/react,davidmason/react,vipulnsward/react,framp/react,1040112370/react,niubaba63/react,vjeux/react,gougouGet/react,tjsavage/react,jimfb/react,ashwin01/react,1234-/react,edmellum/react,dittos/react,PeterWangPo/react,mnordick/react,AlexJeng/react,brigand/react,TaaKey/react,richiethomas/react,DigitalCoder/react,claudiopro/react,yiminghe/react,jquense/react,brigand/react,TaaKey/react,shripadk/react,james4388/react,getshuvo/react,miaozhirui/react,Simek/react,sitexa/react,anushreesubramani/react,k-cheng/react,savelichalex/react,dortonway/react,kieranjones/react,facebook/react,trungda/react,skomski/react,demohi/react,wushuyi/react,syranide/react,chrismoulton/react,chenglou/react,VukDukic/react,spt110/react,prometheansacrifice/react,blue68/react,quip/react,claudiopro/react,yulongge/react,mjul/react,iOSDevBlog/react,KevinTCoughlin/react,TaaKey/react,Simek/react,andrerpena/react,10fish/react,christer155/react,jordanpapaleo/react,VukDukic/react,joe-strummer/react,ABaldwinHunter/react-classic,zilaiyedaren/react,camsong/react,pdaddyo/react,zhangwei001/react,facebook/react,deepaksharmacse12/react,dmatteo/react,afc163/react,ZhouYong10/react,vipulnsward/react,chippieTV/react,inuscript/react,kakadiya91/react,andrewsokolov/react,ashwin01/react,zenlambda/react,niubaba63/react,lastjune/react,pyitphyoaung/react,levibuzolic/react,yongxu/react,jessebeach/react,szhigunov/react,sdiaz/react,sasumi/react,wzpan/react,concerned3rdparty/react,huanglp47/react,reactjs-vn/reactjs_vndev,zanjs/react,IndraVikas/react,TaaKey/react,wuguanghai45/react,lhausermann/react,Riokai/react,cmfcmf/react,cpojer/react,bspaulding/react,jlongster/react,chrisbolin/react,joshblack/react,gitoneman/react,anushreesubramani/react,pandoraui/react,zigi74/react,benchling/react,theseyi/react,kalloc/react,yungsters/react,roth1002/react,orneryhippo/react,JasonZook/react,andrerpena/react,jbonta/react,pdaddyo/react,ABaldwinHunter/react-engines,mingyaaaa/react,stanleycyang/react,OculusVR/react,pandoraui/react,framp/react,laogong5i0/react,MoOx/react,bruderstein/server-react,nsimmons/react,jdlehman/react,prathamesh-sonpatki/react,jeffchan/react,wjb12/react,savelichalex/react,spt110/react,brillantesmanuel/react,jasonwebster/react,sarvex/react,JasonZook/react,iamchenxin/react,arush/react,lennerd/react,quip/react,IndraVikas/react,trueadm/react,shergin/react,cody/react,Jyrno42/react,dortonway/react,luomiao3/react,mingyaaaa/react,microlv/react,nickdima/react,jonhester/react,mosoft521/react,linmic/react,devonharvey/react,arush/react,Rafe/react,it33/react,tom-wang/react,evilemon/react,haoxutong/react,ramortegui/react,rlugojr/react,ajdinhedzic/react,manl1100/react,pletcher/react,gfogle/react,jabhishek/react,bruderstein/server-react,hzoo/react,insionng/react,zyt01/react,VukDukic/react,varunparkhe/react,kamilio/react,mcanthony/react,ABaldwinHunter/react-engines,elquatro/react,joe-strummer/react,jbonta/react,digideskio/react,leohmoraes/react,chippieTV/react,ArunTesco/react,pze/react,qq316278987/react,juliocanares/react,yangshun/react,jorrit/react,patryknowak/react,zs99/react,rohannair/react,cmfcmf/react,rricard/react,ridixcr/react,blainekasten/react,zigi74/react,odysseyscience/React-IE-Alt,trungda/react,jonhester/react,spicyj/react,ThinkedCoder/react,jzmq/react,silkapp/react,thr0w/react,silvestrijonathan/react,tarjei/react,speedyGonzales/react,chippieTV/react,alwayrun/react,pandoraui/react,zhangwei900808/react,rlugojr/react,javascriptit/react,zilaiyedaren/react,Simek/react,k-cheng/react,silkapp/react,acdlite/react,flarnie/react,lina/react,ropik/react,theseyi/react,kevinrobinson/react,lastjune/react,yulongge/react,glenjamin/react,theseyi/react,bleyle/react,leeleo26/react,airondumael/react,kieranjones/react,aickin/react,chenglou/react,nathanmarks/react,lonely8rain/react,agileurbanite/react,dustin-H/react,react-china/react-docs,neusc/react,0x00evil/react,obimod/react,gitignorance/react,bruderstein/server-react,IndraVikas/react,Flip120/react,reactjs-vn/reactjs_vndev,jameszhan/react,nhunzaker/react,mcanthony/react,apaatsio/react,chacbumbum/react,LoQIStar/react,iOSDevBlog/react,gpazo/react,huanglp47/react,ArunTesco/react,stevemao/react,TaaKey/react,zhangwei900808/react,pyitphyoaung/react,vincentnacar02/react,jmptrader/react,anushreesubramani/react,iOSDevBlog/react,bitshadow/react,Diaosir/react,joecritch/react,pandoraui/react,Lonefy/react,eoin/react,ning-github/react,joaomilho/react,guoshencheng/react,iammerrick/react,dirkliu/react,supriyantomaftuh/react,VioletLife/react,tjsavage/react,panhongzhi02/react,nhunzaker/react,speedyGonzales/react,trungda/react,dilidili/react,Jyrno42/react,aaron-goshine/react,yulongge/react,yungsters/react,framp/react,kamilio/react,nathanmarks/react,zyt01/react,Instrument/react,zhangwei001/react,gj262/react,juliocanares/react,camsong/react,dilidili/react,DJCordhose/react,Furzikov/react,kchia/react,guoshencheng/react,isathish/react,dmatteo/react,shadowhunter2/react,ThinkedCoder/react,tzq668766/react,dariocravero/react,flarnie/react,sekiyaeiji/react,jordanpapaleo/react,pod4g/react,trellowebinars/react,with-git/react,cesine/react,reggi/react,mardigtch/react,wmydz1/react,Chiens/react,arkist/react,Instrument/react,salzhrani/react,orneryhippo/react,mhhegazy/react,nhunzaker/react,jdlehman/react,JungMinu/react,jorrit/react,deepaksharmacse12/react,zenlambda/react,ABaldwinHunter/react-engines,skyFi/react,roth1002/react,mingyaaaa/react,facebook/react,jsdf/react,AnSavvides/react,aaron-goshine/react,gpazo/react,pze/react,BorderTravelerX/react,garbles/react,ABaldwinHunter/react-classic,RReverser/react,gfogle/react,laogong5i0/react,trellowebinars/react,james4388/react,silvestrijonathan/react,mcanthony/react,joaomilho/react,greglittlefield-wf/react,wangyzyoga/react,salier/react,sergej-kucharev/react,hzoo/react,AnSavvides/react,VioletLife/react,KevinTCoughlin/react,dilidili/react,dfosco/react,yut148/react,nLight/react,livepanzo/react,dariocravero/react,Diaosir/react,mnordick/react,Chiens/react,joshbedo/react,DigitalCoder/react,lennerd/react,sitexa/react,jordanpapaleo/react,ABaldwinHunter/react-classic,negativetwelve/react,zenlambda/react,syranide/react,ameyms/react,zofuthan/react,richiethomas/react,AlexJeng/react,lonely8rain/react,vipulnsward/react,zhangwei001/react,facebook/react,AlmeroSteyn/react,jbonta/react,shripadk/react,aaron-goshine/react,IndraVikas/react,yongxu/react,isathish/react,mhhegazy/react,jameszhan/react,magalhas/react,VioletLife/react,savelichalex/react,nsimmons/react,yungsters/react,krasimir/react,joecritch/react,laskos/react,chicoxyzzy/react,6feetsong/react,reggi/react,bhamodi/react,luomiao3/react,linalu1/react,nhunzaker/react,dustin-H/react,brigand/react,empyrical/react,silkapp/react,wmydz1/react,salier/react,crsr/react,perperyu/react,chrisbolin/react,anushreesubramani/react,jimfb/react,RReverser/react,silppuri/react,jorrit/react,shergin/react,Jericho25/react,pze/react,studiowangfei/react,cody/react,mgmcdermott/react,sugarshin/react,ameyms/react,iammerrick/react,airondumael/react,cinic/react,roth1002/react,arkist/react,willhackett/react,ZhouYong10/react,angeliaz/react,Furzikov/react,billfeller/react,rasj/react,hejld/react,jordanpapaleo/react,lyip1992/react,iOSDevBlog/react,kaushik94/react,stardev24/react,slongwang/react,dariocravero/react,claudiopro/react,mgmcdermott/react,hawsome/react,jzmq/react,nickpresta/react,TaaKey/react,bspaulding/react,silppuri/react,jbonta/react,temnoregg/react,carlosipe/react,ssyang0102/react,chrisjallen/react,reactkr/react,TaaKey/react,MotherNature/react,zeke/react,soulcm/react,nathanmarks/react,neusc/react,brillantesmanuel/react,neusc/react,kalloc/react,studiowangfei/react,Nieralyte/react,ramortegui/react,scottburch/react,hawsome/react,maxschmeling/react,davidmason/react,supriyantomaftuh/react,rickbeerendonk/react,Chiens/react,skyFi/react,eoin/react,wesbos/react,pod4g/react,patrickgoudjoako/react,thomasboyt/react,tlwirtz/react,songawee/react,dariocravero/react,restlessdesign/react,vincentism/react,ropik/react,SpencerCDixon/react,supriyantomaftuh/react,jontewks/react,phillipalexander/react,OculusVR/react,zhangwei001/react,Galactix/react,joaomilho/react,gxr1020/react,tako-black/react-1,6feetsong/react,mjackson/react,MoOx/react,joshbedo/react,magalhas/react,Duc-Ngo-CSSE/react,BreemsEmporiumMensToiletriesFragrances/react,reactkr/react,chinakids/react,kakadiya91/react,jkcaptain/react,TylerBrock/react,Zeboch/react-tap-event-plugin,ericyang321/react,andrescarceller/react,jmacman007/react,felixgrey/react,orneryhippo/react,tom-wang/react,linqingyicen/react,Instrument/react,skevy/react,kevin0307/react,prometheansacrifice/react,yisbug/react,Spotinux/react,sebmarkbage/react,sarvex/react,empyrical/react,tomv564/react,JoshKaufman/react,bhamodi/react,0x00evil/react,tywinstark/react,sdiaz/react,jeromjoy/react,1040112370/react,sarvex/react,tlwirtz/react,ThinkedCoder/react,gfogle/react,reactkr/react,restlessdesign/react,jdlehman/react,zorojean/react,magalhas/react,szhigunov/react,jedwards1211/react,chrisjallen/react,bruderstein/server-react,lhausermann/react,ipmobiletech/react,nickdima/react,yasaricli/react,flipactual/react,leohmoraes/react,salzhrani/react,sejoker/react,sejoker/react,cmfcmf/react,crsr/react,niole/react,leeleo26/react,yangshun/react,pwmckenna/react,miaozhirui/react,thomasboyt/react,michaelchum/react,kaushik94/react,blainekasten/react,nLight/react,jsdf/react,jedwards1211/react,huanglp47/react,brigand/react,rickbeerendonk/react,apaatsio/react,zyt01/react,btholt/react,zorojean/react,sekiyaeiji/react,albulescu/react,ameyms/react,ianb/react,xiaxuewuhen001/react,yhagio/react,kevin0307/react,michaelchum/react,alwayrun/react,salzhrani/react,cmfcmf/react,MichelleTodd/react,maxschmeling/react,gpazo/react,davidmason/react,jorrit/react,jquense/react,0x00evil/react,DJCordhose/react,ABaldwinHunter/react-engines,patryknowak/react,arkist/react,sekiyaeiji/react,wmydz1/react,krasimir/react,kevin0307/react,ninjaofawesome/reaction,skevy/react,Spotinux/react,staltz/react,1234-/react,trellowebinars/react,dilidili/react,nickpresta/react,rlugojr/react,andrewsokolov/react,trueadm/react,rgbkrk/react,garbles/react,dmitriiabramov/react,linmic/react,wudouxingjun/react,vincentism/react,alvarojoao/react,tzq668766/react,chicoxyzzy/react,arasmussen/react,crsr/react,pyitphyoaung/react,niole/react,alexanther1012/react,dilidili/react,S0lahart-AIRpanas-081905220200-Service/react,glenjamin/react,kaushik94/react,MoOx/react,studiowangfei/react,rlugojr/react,KevinTCoughlin/react,pdaddyo/react,dilidili/react,1040112370/react,syranide/react,SpencerCDixon/react,PeterWangPo/react,restlessdesign/react,odysseyscience/React-IE-Alt,neomadara/react,Instrument/react,panhongzhi02/react,jmacman007/react,ramortegui/react,lyip1992/react,marocchino/react,jameszhan/react,henrik/react,ninjaofawesome/reaction,christer155/react,wangyzyoga/react,Datahero/react,mhhegazy/react,jquense/react,stardev24/react,rlugojr/react,yangshun/react,jmptrader/react,yut148/react,kay-is/react,tomocchino/react,jasonwebster/react,inuscript/react,yangshun/react,diegobdev/react,rlugojr/react,nLight/react,varunparkhe/react,flowbywind/react,crsr/react,concerned3rdparty/react,linmic/react,Instrument/react,mjackson/react,iammerrick/react,musofan/react,6feetsong/react,gajus/react,lhausermann/react,salier/react,joaomilho/react,cpojer/react,iammerrick/react,mhhegazy/react,ms-carterk/react,dgdblank/react,roylee0704/react,thr0w/react,zyt01/react,claudiopro/react,bruderstein/server-react,10fish/react,popovsh6/react,terminatorheart/react,patrickgoudjoako/react,acdlite/react,trueadm/react,btholt/react,javascriptit/react,miaozhirui/react,AnSavvides/react,patrickgoudjoako/react,rricard/react,gpbl/react,marocchino/react,hawsome/react,joe-strummer/react,ipmobiletech/react,nomanisan/react,scottburch/react,terminatorheart/react,easyfmxu/react,jagdeesh109/react,joe-strummer/react,arkist/react,jameszhan/react,javascriptit/react,huanglp47/react,gitoneman/react,honger05/react,benjaffe/react,AnSavvides/react,with-git/react,conorhastings/react,jameszhan/react,Galactix/react,dfosco/react,Riokai/react,alvarojoao/react,wmydz1/react,qq316278987/react,yasaricli/react,jlongster/react,skevy/react,jontewks/react,andrerpena/react,ianb/react,pandoraui/react,trueadm/react,scottburch/react,Zeboch/react-tap-event-plugin,TaaKey/react,tarjei/react,chicoxyzzy/react,felixgrey/react,jonhester/react,jimfb/react,Diaosir/react,STRML/react,Jericho25/react,aickin/react,blainekasten/react,ManrajGrover/react,labs00/react,maxschmeling/react,MoOx/react,gleborgne/react,dgreensp/react,reactkr/react,yulongge/react,roth1002/react,obimod/react,studiowangfei/react,niubaba63/react,insionng/react,mik01aj/react,flipactual/react,joshbedo/react,hejld/react,manl1100/react,james4388/react,mfunkie/react,dortonway/react,elquatro/react,gpazo/react,darobin/react,yuhualingfeng/react,andreypopp/react,blue68/react,pswai/react,prathamesh-sonpatki/react,ameyms/react,dgreensp/react,tarjei/react,jagdeesh109/react,ilyachenko/react,tako-black/react-1,shadowhunter2/react,ledrui/react,sugarshin/react,benjaffe/react,JasonZook/react,mosoft521/react,aickin/react,pletcher/react,MotherNature/react,shergin/react,easyfmxu/react,jmptrader/react,jimfb/react,odysseyscience/React-IE-Alt,howtolearntocode/react,yungsters/react,TheBlasfem/react,bspaulding/react,chrisjallen/react,leexiaosi/react,greyhwndz/react,MichelleTodd/react,8398a7/react,vincentism/react,afc163/react,dittos/react,Jyrno42/react,hawsome/react,restlessdesign/react,ridixcr/react,airondumael/react,1040112370/react,brian-murray35/react,tom-wang/react,zeke/react,gitoneman/react,pswai/react,BreemsEmporiumMensToiletriesFragrances/react,pze/react,prathamesh-sonpatki/react,hejld/react,ms-carterk/react,trueadm/react,salier/react,PrecursorApp/react,nickpresta/react,spicyj/react,vincentism/react,Datahero/react,chicoxyzzy/react,ropik/react,perterest/react,claudiopro/react,AmericanSundown/react,tomocchino/react,reactjs-vn/reactjs_vndev,silvestrijonathan/react,pwmckenna/react,iamchenxin/react,rwwarren/react,orzyang/react,rwwarren/react,gfogle/react,jessebeach/react,arasmussen/react,dmatteo/react,roth1002/react,empyrical/react,blue68/react,ianb/react,DJCordhose/react,8398a7/react,rasj/react,yiminghe/react,negativetwelve/react,ZhouYong10/react,marocchino/react,eoin/react,shergin/react,Spotinux/react,rickbeerendonk/react,darobin/react,benchling/react,lastjune/react,shadowhunter2/react,AlexJeng/react,sarvex/react,iamdoron/react,dittos/react,tomocchino/react,yiminghe/react,acdlite/react,mardigtch/react,it33/react,sugarshin/react,stardev24/react,jedwards1211/react,ropik/react,kamilio/react,1234-/react,negativetwelve/react,andrerpena/react,BorderTravelerX/react,laskos/react,dmatteo/react,framp/react,angeliaz/react,kamilio/react,sergej-kucharev/react,niubaba63/react,ljhsai/react,jmacman007/react,rohannair/react,maxschmeling/react,jfschwarz/react,yasaricli/react,lyip1992/react,camsong/react,yut148/react,camsong/react,apaatsio/react,staltz/react,react-china/react-docs,musofan/react,sugarshin/react,niubaba63/react,usgoodus/react,VukDukic/react,dustin-H/react,nLight/react,Riokai/react,arush/react,benchling/react,devonharvey/react,qq316278987/react,shergin/react,pswai/react,dmitriiabramov/react,gleborgne/react,ljhsai/react,JanChw/react,jabhishek/react,chicoxyzzy/react,guoshencheng/react,sugarshin/react,jontewks/react,gxr1020/react,dirkliu/react,neusc/react,wudouxingjun/react,ridixcr/react,edvinerikson/react,gxr1020/react,S0lahart-AIRpanas-081905220200-Service/react,afc163/react,vincentism/react,S0lahart-AIRpanas-081905220200-Service/react,angeliaz/react,kakadiya91/react,zenlambda/react,zeke/react,chenglou/react,willhackett/react,nathanmarks/react,Diaosir/react,nickpresta/react,mjackson/react,silvestrijonathan/react,restlessdesign/react,iamdoron/react,pwmckenna/react,howtolearntocode/react,henrik/react,chacbumbum/react,zofuthan/react,sejoker/react,zilaiyedaren/react,zhengqiangzi/react,trueadm/react,chrisjallen/react,joon1030/react,TheBlasfem/react,brian-murray35/react,Riokai/react,trellowebinars/react,joshbedo/react,felixgrey/react,gpbl/react,qq316278987/react,lennerd/react,flarnie/react,tom-wang/react,Jyrno42/react,edvinerikson/react,greysign/react,gregrperkins/react,cpojer/react,free-memory/react,KevinTCoughlin/react,algolia/react,TheBlasfem/react,prathamesh-sonpatki/react,Lonefy/react,ledrui/react,xiaxuewuhen001/react,TheBlasfem/react,mosoft521/react,jdlehman/react,manl1100/react,tlwirtz/react,easyfmxu/react,kakadiya91/react,mardigtch/react,iamchenxin/react,pwmckenna/react,MichelleTodd/react,panhongzhi02/react,andrescarceller/react,gxr1020/react,panhongzhi02/react,levibuzolic/react,Simek/react,lhausermann/react,zorojean/react,mik01aj/react,phillipalexander/react,RReverser/react,jakeboone02/react,skevy/react,labs00/react,easyfmxu/react,Jyrno42/react,mohitbhatia1994/react,Flip120/react,chippieTV/react,tomocchino/react,afc163/react,chenglou/react,digideskio/react,jkcaptain/react,trungda/react,jonhester/react,edmellum/react,apaatsio/react,gold3bear/react,trungda/react,obimod/react,davidmason/react,yisbug/react,staltz/react,mjackson/react,dgreensp/react,linalu1/react,flowbywind/react,blainekasten/react,prometheansacrifice/react,kakadiya91/react,ZhouYong10/react,ninjaofawesome/reaction,kevinrobinson/react,devonharvey/react,flarnie/react,niubaba63/react,microlv/react,orneryhippo/react,dirkliu/react,blainekasten/react,JasonZook/react,reggi/react,benchling/react,mosoft521/react,with-git/react,empyrical/react,livepanzo/react,lonely8rain/react,DJCordhose/react,TaaKey/react,acdlite/react,joecritch/react,dortonway/react,laskos/react,venkateshdaram434/react,iamdoron/react,lina/react,ilyachenko/react,tako-black/react-1,tywinstark/react,mhhegazy/react,BreemsEmporiumMensToiletriesFragrances/react,rwwarren/react,liyayun/react,mhhegazy/react,songawee/react,Rafe/react,zyt01/react,1040112370/react,musofan/react,isathish/react,tomv564/react,dmitriiabramov/react,usgoodus/react,stanleycyang/react,gpazo/react,JanChw/react,richiethomas/react,theseyi/react,demohi/react,0x00evil/react,panhongzhi02/react,gpbl/react,kolmstead/react,joaomilho/react,dittos/react,rlugojr/react,dortonway/react,VioletLife/react,with-git/react,gitoneman/react,wangyzyoga/react,ning-github/react,KevinTCoughlin/react,negativetwelve/react,shripadk/react,nathanmarks/react,bleyle/react,rricard/react,mjackson/react,niole/react,1yvT0s/react,Lonefy/react,henrik/react,Galactix/react,Spotinux/react,niole/react,PrecursorApp/react,andrerpena/react,spicyj/react,microlv/react,neomadara/react,mjackson/react,quip/react,kolmstead/react,roylee0704/react,albulescu/react,kamilio/react,0x00evil/react,jdlehman/react,tomocchino/react,reactjs-vn/reactjs_vndev,chinakids/react,speedyGonzales/react,edmellum/react,bitshadow/react,shripadk/react,angeliaz/react,sverrejoh/react,greyhwndz/react,STRML/react,free-memory/react,PrecursorApp/react,kaushik94/react,jquense/react,Rafe/react,AmericanSundown/react,perperyu/react,yungsters/react,rickbeerendonk/react,arkist/react,carlosipe/react,gitignorance/react,alwayrun/react,laskos/react,gougouGet/react,andreypopp/react,facebook/react,1234-/react,thomasboyt/react,zhangwei001/react,garbles/react,lucius-feng/react,perterest/react,easyfmxu/react,ridixcr/react,mcanthony/react,ridixcr/react,JungMinu/react,microlv/react,niole/react,wjb12/react,iamchenxin/react,stevemao/react,krasimir/react,wuguanghai45/react,guoshencheng/react,obimod/react,chrismoulton/react,digideskio/react,cesine/react,zhangwei900808/react,kevinrobinson/react,howtolearntocode/react,tarjei/react,ljhsai/react,jquense/react,staltz/react,miaozhirui/react,isathish/react,insionng/react,arasmussen/react,ashwin01/react,jasonwebster/react,yabhis/react,usgoodus/react,dustin-H/react,mgmcdermott/react,PrecursorApp/react,roth1002/react,flipactual/react,marocchino/react,TheBlasfem/react,sverrejoh/react,lhausermann/react,mtsyganov/react,leexiaosi/react,zhengqiangzi/react,bestwpw/react,kchia/react,jiangzhixiao/react,andreypopp/react,richiethomas/react,thomasboyt/react,stanleycyang/react,edmellum/react,labs00/react,quip/react,insionng/react,tzq668766/react,apaatsio/react,laogong5i0/react,Jericho25/react,Lonefy/react,lyip1992/react,neomadara/react,cody/react,yhagio/react,rohannair/react,with-git/react,jagdeesh109/react,tlwirtz/react,krasimir/react,JasonZook/react,tlwirtz/react,afc163/react,orzyang/react,phillipalexander/react,gold3bear/react,gregrperkins/react,algolia/react,misnet/react,qq316278987/react,laogong5i0/react,yuhualingfeng/react,dgladkov/react,wushuyi/react,yisbug/react,nickdima/react,lucius-feng/react,isathish/react,ashwin01/react,chrisjallen/react,silvestrijonathan/react,zigi74/react,darobin/react,k-cheng/react,prathamesh-sonpatki/react,krasimir/react,jzmq/react,SpencerCDixon/react,temnoregg/react,kieranjones/react,aaron-goshine/react,empyrical/react,joshblack/react,james4388/react,terminatorheart/react,manl1100/react,spt110/react,mingyaaaa/react,leohmoraes/react,VioletLife/react,rricard/react,VioletLife/react,maxschmeling/react,Duc-Ngo-CSSE/react,prometheansacrifice/react,psibi/react,joshblack/react,IndraVikas/react,chenglou/react,acdlite/react,yiminghe/react,AmericanSundown/react,wudouxingjun/react,thomasboyt/react,benchling/react,Jericho25/react,digideskio/react,sverrejoh/react,cmfcmf/react,sejoker/react,edvinerikson/react,alvarojoao/react,brillantesmanuel/react,ouyangwenfeng/react,psibi/react,zanjs/react,getshuvo/react,with-git/react,yut148/react,AnSavvides/react,Riokai/react,jdlehman/react,ledrui/react,dustin-H/react,linqingyicen/react,cmfcmf/react,reggi/react,mosoft521/react,bhamodi/react,gpbl/react,zanjs/react,christer155/react,wjb12/react,gold3bear/react,bhamodi/react,mik01aj/react,JoshKaufman/react,free-memory/react,iOSDevBlog/react,joon1030/react,jeffchan/react,DigitalCoder/react,alexanther1012/react,btholt/react,chicoxyzzy/react,davidmason/react,yangshun/react,davidmason/react,zenlambda/react,flowbywind/react,joecritch/react,anushreesubramani/react,elquatro/react,leeleo26/react,yabhis/react,diegobdev/react,edvinerikson/react,rricard/react,vikbert/react,jmptrader/react,linmic/react,prometheansacrifice/react,aickin/react,kolmstead/react,brian-murray35/react,yisbug/react,spt110/react,zorojean/react,tomv564/react,AlexJeng/react,8398a7/react,zhengqiangzi/react,vincentnacar02/react,ABaldwinHunter/react-classic,scottburch/react,pyitphyoaung/react,thr0w/react,greysign/react,Furzikov/react,ameyms/react,ropik/react,dfosco/react,aickin/react,Datahero/react,sasumi/react,odysseyscience/React-IE-Alt,sarvex/react,yungsters/react,jmacman007/react,jiangzhixiao/react,jeromjoy/react,brillantesmanuel/react,trueadm/react,apaatsio/react,sverrejoh/react,STRML/react,pze/react,jakeboone02/react,liyayun/react,devonharvey/react,ropik/react,slongwang/react,1yvT0s/react,ericyang321/react,btholt/react,JungMinu/react,gj262/react,lyip1992/react,terminatorheart/react,billfeller/react,lhausermann/react,orzyang/react,zeke/react,tlwirtz/react,skomski/react,demohi/react,tom-wang/react,rohannair/react,negativetwelve/react,iamdoron/react,acdlite/react,sverrejoh/react,terminatorheart/react,S0lahart-AIRpanas-081905220200-Service/react,bestwpw/react,sugarshin/react,sebmarkbage/react,sitexa/react,joaomilho/react,inuscript/react,ouyangwenfeng/react,yjyi/react,AmericanSundown/react,ThinkedCoder/react,mfunkie/react,pod4g/react,elquatro/react,blainekasten/react,jzmq/react,jabhishek/react,flarnie/react,algolia/react,bspaulding/react,edvinerikson/react,mfunkie/react,jasonwebster/react,andrescarceller/react,rgbkrk/react,greyhwndz/react,perterest/react,salzhrani/react
--- +++ @@ -45,10 +45,10 @@ * @param {string} text */ _onSave: function(text) { - if(text.trim()){ + if (text.trim()){ TodoActions.create(text); } - + } });
d62ffda36104d6620756a2d083b125d893d07419
frontend/scripts/controllers/install_update_ctrl.js
frontend/scripts/controllers/install_update_ctrl.js
angular.module("protonet.platform").controller("InstallUpdateCtrl", function($scope, $state, $timeout, API, Notification) { function toggleDetailedUpdateStatus() { $scope.showDetailedUpdateStatus = !$scope.showDetailedUpdateStatus; } $scope.toggleDetailedUpdateStatus = toggleDetailedUpdateStatus; function updateDetailedStatus(images) { $scope.status = {}; for (var property in images) { if (images.hasOwnProperty(property)) { var image = images[property]; $scope.status[property] = { local: image.local, remote: image.remote, upToDate: image.local === image.remote } } } $scope.statusAvailable = !$.isEmptyObject($scope.status); } function check() { $timeout(function() { API.get("/admin/api/system/update").then(function(data) { if (data.up_to_date) { Notification.notice("Update successfully installed"); $state.go("dashboard.index"); } else { updateDetailedStatus(data.images); check(); } }).catch(check); }, 10000); } check(); });
angular.module("protonet.platform").controller("InstallUpdateCtrl", function($scope, $state, $timeout, API, Notification) { function toggleDetailedUpdateStatus() { $scope.showDetailedUpdateStatus = !$scope.showDetailedUpdateStatus; } $scope.toggleDetailedUpdateStatus = toggleDetailedUpdateStatus; function updateDetailedStatus(images) { $scope.status = {}; for (var property in images) { if (images.hasOwnProperty(property)) { var image = images[property]; $scope.status[property] = { local: image.local, remote: image.remote, upToDate: image.local === image.remote } } } $scope.statusAvailable = !$.isEmptyObject($scope.status); } function check() { $timeout(function() { API.get("/admin/api/system/update").then(function(data) { if (data.up_to_date) { Notification.success("Update successfully installed"); $state.go("dashboard.index"); } else { updateDetailedStatus(data.images); check(); } }).catch(check); }, 10000); } check(); });
Fix js error after update
Fix js error after update
JavaScript
apache-2.0
experimental-platform/platform-frontend,DarkSwoop/platform-frontend,DarkSwoop/platform-frontend,experimental-platform/platform-frontend,DarkSwoop/platform-frontend,experimental-platform/platform-frontend
--- +++ @@ -24,7 +24,7 @@ $timeout(function() { API.get("/admin/api/system/update").then(function(data) { if (data.up_to_date) { - Notification.notice("Update successfully installed"); + Notification.success("Update successfully installed"); $state.go("dashboard.index"); } else { updateDetailedStatus(data.images);
197563cf26894571304abb762aeb192c5f63c21a
src/sanity/inputs/Reference.js
src/sanity/inputs/Reference.js
import {ReferenceInput} from 'role:@sanity/form-builder' import client from 'client:@sanity/base/client' import {unprefixType} from '../utils/unprefixType' function fetchSingle(id) { return client.fetch('*[.$id == %id]', {id}).then(response => unprefixType(response.result[0])) } export default ReferenceInput.createBrowser({ fetch(field) { const toFieldTypes = field.to.map(toField => toField.type) const params = toFieldTypes.reduce((acc, toFieldType, i) => { acc[`toFieldType${i}`] = `beerfiesta.${toFieldType}` return acc }, {}) const eqls = Object.keys(params).map(key => ( `.$type == %${key}` )).join(' || ') return client.fetch(`*[${eqls}]`, params) .then(response => response.result.map(unprefixType)) }, materializeReferences(referenceIds) { return Promise.all(referenceIds.map(fetchSingle)) } })
import client from 'client:@sanity/base/client' import {ReferenceInput} from 'role:@sanity/form-builder' import {unprefixType} from '../utils/unprefixType' function fetchSingle(id) { return client.data.getDocument(id).then(doc => unprefixType(doc)) } export default ReferenceInput.createBrowser({ fetch(field) { const toFieldTypes = field.to.map(toField => toField.type) const dataset = client.config().dataset const params = toFieldTypes.reduce((acc, toFieldType, i) => { acc[`toFieldType${i}`] = `${dataset}.${toFieldType}` return acc }, {}) const eqls = Object.keys(params).map(key => ( `.$type == %${key}` )).join(' || ') return client.data.fetch(`*[${eqls}]`, params) .then(response => response.map(unprefixType)) }, materializeReferences(referenceIds) { return Promise.all(referenceIds.map(fetchSingle)) } })
Make reference input use new Sanity client syntax
Make reference input use new Sanity client syntax
JavaScript
mit
sanity-io/sanity,sanity-io/sanity,sanity-io/sanity,sanity-io/sanity
--- +++ @@ -1,18 +1,17 @@ +import client from 'client:@sanity/base/client' import {ReferenceInput} from 'role:@sanity/form-builder' -import client from 'client:@sanity/base/client' import {unprefixType} from '../utils/unprefixType' function fetchSingle(id) { - return client.fetch('*[.$id == %id]', {id}).then(response => unprefixType(response.result[0])) + return client.data.getDocument(id).then(doc => unprefixType(doc)) } export default ReferenceInput.createBrowser({ fetch(field) { - const toFieldTypes = field.to.map(toField => toField.type) - + const dataset = client.config().dataset const params = toFieldTypes.reduce((acc, toFieldType, i) => { - acc[`toFieldType${i}`] = `beerfiesta.${toFieldType}` + acc[`toFieldType${i}`] = `${dataset}.${toFieldType}` return acc }, {}) @@ -20,9 +19,10 @@ `.$type == %${key}` )).join(' || ') - return client.fetch(`*[${eqls}]`, params) - .then(response => response.result.map(unprefixType)) + return client.data.fetch(`*[${eqls}]`, params) + .then(response => response.map(unprefixType)) }, + materializeReferences(referenceIds) { return Promise.all(referenceIds.map(fetchSingle)) }
bd3b6698e3cfa10a758aa93441ed36b029fbc3cd
js/source/github.js
js/source/github.js
(function() { 'use strict'; var _ = Timeline.helpers; Timeline.Stream.source.GitHub = { icon: 'github', options: { response: 'json', paginate: 10, url: 'https://api.github.com/', action: '{stream}/events/public', }, params: { page: function(action) { return (action == 'poll') ? 1 : '{page}'; }, }, headers: { Accept: 'applicatioin/vnd.github.v3+json', }, getEvents: function(data) { return data; }, getEventID: function(event) { return parseInt(this.getEventDate(event), 10); }, getEventDate: function(event) { return _.parseTime(event.created_at); }, getEventMessage: function(event) { return 'GitHub: ' + event.actor.login + ' ' + event.type; }, getEventLink: function(event) {}, }; })();
(function() { 'use strict'; var _ = Timeline.helpers; Timeline.Stream.source.GitHub = { icon: 'github', options: { response: 'json', paginate: 10, url: 'https://api.github.com/', action: '{stream}/events/public', }, params: { page: function(action) { return (action == 'poll') ? 1 : '{page}'; }, }, headers: { Accept: 'applicatioin/vnd.github.v3+json', }, getEvents: function(data) { return data; }, getEventID: function(event) { return parseInt(this.getEventDate(event), 10); }, getEventDate: function(event) { return _.parseTime(event.created_at); }, getEventMessage: function(event) { var message = ''; var params = {}; switch (event.type) { case 'PushEvent': message = 'Pushed {commits} commit{s} to <code>{ref}</code> ' + 'on <a href="{repo_url}">{repo}</a>'; params = { commits: event.payload.size, s: event.payload.size == 1 ? '' : 's', ref: event.payload.ref.replace(/^refs\/heads\//, ''), repo_url: event.repo.url, repo: event.repo.name, }; break; } if (message.length) return _.template(message, params); }, getEventLink: function(event) {}, }; })();
Adjust GitHub source to produce meaningful output
Adjust GitHub source to produce meaningful output
JavaScript
mpl-2.0
rummik/zenosphere.js
--- +++ @@ -36,7 +36,26 @@ }, getEventMessage: function(event) { - return 'GitHub: ' + event.actor.login + ' ' + event.type; + var message = ''; + var params = {}; + + switch (event.type) { + case 'PushEvent': + message = 'Pushed {commits} commit{s} to <code>{ref}</code> ' + + 'on <a href="{repo_url}">{repo}</a>'; + + params = { + commits: event.payload.size, + s: event.payload.size == 1 ? '' : 's', + ref: event.payload.ref.replace(/^refs\/heads\//, ''), + repo_url: event.repo.url, + repo: event.repo.name, + }; + break; + } + + if (message.length) + return _.template(message, params); }, getEventLink: function(event) {},
39c5facffd81d7e768d6519036d0f0f0a7ed3ad2
migrations/20141022152322_init.js
migrations/20141022152322_init.js
'use strict'; exports.up = function(knex, Promise) { return knex.schema.createTable('Transactions', function (table) { table.increments("id").primary(); table.string("address", 128); table.integer("amount"); table.string("memo", 512); table.text("txblob"); table.string("txhash", 128); table.integer("sequence"); table.text("error"); table.timestamp("signedAt").nullable(); table.timestamp("submittedAt").nullable(); table.timestamp("confirmedAt").nullable(); table.timestamp("abortedAt").nullable(); }); }; exports.down = function(knex, Promise) { return knex.schema.dropTable("Transactions"); };
'use strict'; exports.up = function(knex, Promise) { return knex.schema.createTable('Transactions', function (table) { table.increments("id").primary(); table.string("address", 128); table.integer("amount"); table.string("currency", 3); table.string("issuer", 128); table.string("memo", 512); table.text("txblob"); table.string("txhash", 128); table.integer("sequence"); table.text("error"); table.timestamp("signedAt").nullable(); table.timestamp("submittedAt").nullable(); table.timestamp("confirmedAt").nullable(); table.timestamp("abortedAt").nullable(); }); }; exports.down = function(knex, Promise) { return knex.schema.dropTable("Transactions"); };
Change migration to add currency and issuer
Change migration to add currency and issuer
JavaScript
isc
Payshare/stellar-payments,nybbs2003/stellar-payments,Payshares/payshares-payments
--- +++ @@ -5,6 +5,8 @@ table.increments("id").primary(); table.string("address", 128); table.integer("amount"); + table.string("currency", 3); + table.string("issuer", 128); table.string("memo", 512); table.text("txblob"); table.string("txhash", 128);
0562d99c152305c93a6dbb1298549c766018358f
lib/randomstring.js
lib/randomstring.js
"use strict"; var crypto = require('crypto'); var charset = require('./charset.js'); exports.generate = function(length, options) { var chars; if (typeof options === 'object') { if (options.charset) { chars = charset.generate(options.charset, options.readable); } else { charset.generate('default', options.readable); } } else { chars = charset.generate('default'); } length = length || 32; var string = ''; while(string.length < length) { var bf; try { bf = crypto.randomBytes(length); } catch (e) { continue; } for (var i = 0; i < bf.length; i++) { var index = bf.readUInt8(i) % chars.length; string += chars.charAt(index); } } return string; }
"use strict"; var crypto = require('crypto'); var charset = require('./charset.js'); exports.generate = function(options) { var length, chars, string = ''; // Handle options if (typeof options === 'object') { length = options.length || 32; if (options.charset) { chars = charset.generate(options.charset, options.readable); } else { charset.generate('default', options.readable); } } else if (typeof options === 'number') { length = options; chars = charset.generate('default'); } else { length = 32; chars = charset.generate('default'); } // Generate the string while (string.length < length) { var bf; try { bf = crypto.randomBytes(length); } catch (e) { continue; } for (var i = 0; i < bf.length; i++) { var index = bf.readUInt8(i) % chars.length; string += chars.charAt(index); } } return string; }
Move length to options while keeping support for legacy params
Move length to options while keeping support for legacy params
JavaScript
mit
prashantgupta24/node-randomstring,prashantgupta24/node-randomstring,klughammer/node-randomstring
--- +++ @@ -3,11 +3,14 @@ var crypto = require('crypto'); var charset = require('./charset.js'); -exports.generate = function(length, options) { +exports.generate = function(options) { - var chars; + var length, chars, string = ''; + // Handle options if (typeof options === 'object') { + length = options.length || 32; + if (options.charset) { chars = charset.generate(options.charset, options.readable); } @@ -15,15 +18,17 @@ charset.generate('default', options.readable); } } + else if (typeof options === 'number') { + length = options; + chars = charset.generate('default'); + } else { - chars = charset.generate('default'); + length = 32; + chars = charset.generate('default'); } - - length = length || 32; - - var string = ''; - - while(string.length < length) { + + // Generate the string + while (string.length < length) { var bf; try { bf = crypto.randomBytes(length);
6b691039e6a2a6bcd7e45d291fbc42650c6c1f01
tests/current_route_tests.js
tests/current_route_tests.js
Tinytest.addAsync('CurrentRoute.name returns the name of the current route', function (test, next) { Router.go('apple'); setTimeout(function () { test.equal(CurrentRoute.name, 'apple'); next(); }, 500); }); Tinytest.addAsync('CurrentRoute.is returns false when routeName is not current route name', function (test, next) { Router.go('orange'); setTimeout(function () { test.isFalse(CurrentRoute.is('apple')); next(); }, 500); }); Tinytest.addAsync('CurrentRoute.is returns true when routeName is the current route name', function (test, next) { Router.go('apple'); setTimeout(function () { test.isTrue(CurrentRoute.is('apple')); next(); }, 500); }); Tinytest.addAsync('CurrentRoute.params returns an array of params', function (test, next) { Router.go('fruit.show', {name: 'banana'}); setTimeout(function () { test.isTrue(CurrentRoute.params.indexOf('banana') > -1); next(); }, 500); });
Tinytest.addAsync('CurrentRoute.name returns the name of the current route', function (test, next) { Router.go('apple'); Meteor.defer(function () { test.equal(CurrentRoute.name, 'apple'); next(); }, 500); }); Tinytest.addAsync('CurrentRoute.is returns false when routeName is not current route name', function (test, next) { Router.go('orange'); Meteor.defer(function () { test.isFalse(CurrentRoute.is('apple')); next(); }, 500); }); Tinytest.addAsync('CurrentRoute.is returns true when routeName is the current route name', function (test, next) { Router.go('apple'); Meteor.defer(function () { test.isTrue(CurrentRoute.is('apple')); next(); }, 500); }); Tinytest.addAsync('CurrentRoute.params returns an array of params', function (test, next) { Router.go('fruit.show', {name: 'banana'}); Meteor.defer(function () { test.isTrue(CurrentRoute.params.indexOf('banana') > -1); next(); }, 500); });
Fix TravisCI issue where the build hangs after starting
Fix TravisCI issue where the build hangs after starting
JavaScript
mit
sungwoncho/iron-utils
--- +++ @@ -1,6 +1,6 @@ Tinytest.addAsync('CurrentRoute.name returns the name of the current route', function (test, next) { Router.go('apple'); - setTimeout(function () { + Meteor.defer(function () { test.equal(CurrentRoute.name, 'apple'); next(); }, 500); @@ -8,7 +8,7 @@ Tinytest.addAsync('CurrentRoute.is returns false when routeName is not current route name', function (test, next) { Router.go('orange'); - setTimeout(function () { + Meteor.defer(function () { test.isFalse(CurrentRoute.is('apple')); next(); }, 500); @@ -16,7 +16,7 @@ Tinytest.addAsync('CurrentRoute.is returns true when routeName is the current route name', function (test, next) { Router.go('apple'); - setTimeout(function () { + Meteor.defer(function () { test.isTrue(CurrentRoute.is('apple')); next(); }, 500); @@ -25,7 +25,7 @@ Tinytest.addAsync('CurrentRoute.params returns an array of params', function (test, next) { Router.go('fruit.show', {name: 'banana'}); - setTimeout(function () { + Meteor.defer(function () { test.isTrue(CurrentRoute.params.indexOf('banana') > -1); next(); }, 500);
a05a9eb968458117c00de3a196ed8891be52b3a0
admin/src/components/FormHeading.js
admin/src/components/FormHeading.js
var React = require('react'); function evalDependsOn(dependsOn, values) { if (!_.isObject(dependsOn)) return true; var keys = _.keys(dependsOn); return (keys.length) ? _.every(keys, function(key) { var matches = _.isArray(dependsOn[key]) ? dependsOn[key] : [dependsOn[key]]; return _.contains(matches, values[key]); }, this) : true; } module.exports = React.createClass({ displayName: 'FormHeading', render: function() { if (!evalDependsOn(this.props.options.dependsOn, this.props.options.values)) { return null; } return <h3 className="form-heading">{this.props.content}</h3>; } });
var React = require('react'); function evalDependsOn(dependsOn, values) { if (!_.isObject(dependsOn)) return true; var keys = _.keys(dependsOn); return (keys.length) ? _.every(keys, function(key) { var dependsValue = dependsOn[key]; if(_.isBoolean(dependsValue)) { return dependsValue !== _.isEmpty(values[key]); } var matches = _.isArray(dependsValue) ? dependsValue : [dependsValue]; return _.contains(matches, values[key]); }, this) : true; } module.exports = React.createClass({ displayName: 'FormHeading', render: function() { if (!evalDependsOn(this.props.options.dependsOn, this.props.options.values)) { return null; } return <h3 className="form-heading">{this.props.content}</h3>; } });
Allow boolean evaluation of dependsOn on headings
Allow boolean evaluation of dependsOn on headings
JavaScript
mit
Adam14Four/keystone,sendyhalim/keystone,webteckie/keystone,andrewlinfoot/keystone,MORE-HEALTH/keystone,webteckie/keystone,kidaa/keystone,the1sky/keystone,dryna/keystone-twoje-urodziny,kidaa/keystone,Yaska/keystone,asifiqbal84/keystone,kloudsio/keystone,nickhsine/keystone,Adam14Four/keystone,francesconero/keystone,vokal/keystone,creynders/keystone,dvdcastro/keystone,matthieugayon/keystone,ligson/keystone,jeffreypriebe/keystone,trentmillar/keystone,BlakeRxxk/keystone,stosorio/keystone,youprofit/keystone,efernandesng/keystone,tomasztunik/keystone,developer-prosenjit/keystone,lojack/keystone,vokal/keystone,danielmahon/keystone,kloudsio/keystone,sarriaroman/keystone,unsworn/keystone,brianjd/keystone,wmertens/keystone,linhanyang/keystone,SJApps/keystone,mbayfield/keystone,mbayfield/keystone,dryna/keystone-twoje-urodziny,naustudio/keystone,lastjune/keystone,jstockwin/keystone,beni55/keystone,Ftonso/keystone,wilsonfletcher/keystone,magalhas/keystone,joerter/keystone,w01fgang/keystone,gemscng/keystone,pr1ntr/keystone,frontyard/keystone,tony2cssc/keystone,DenisNeustroev/keystone,akoesnan/keystone,andrewlinfoot/keystone,vokal/keystone,mekanics/keystone,jrit/keystone,Pylipala/keystone,davibe/keystone,antonj/keystone,nickhsine/keystone,stunjiturner/keystone,andreufirefly/keystone,geminiyellow/keystone,Pylipala/keystone,woody0907/keystone,cermati/keystone,andreufirefly/keystone,benkroeger/keystone,kristianmandrup/keystone,Tangcuyu/keystone,cermati/keystone,matthewstyers/keystone,kumo/keystone,everisARQ/keystone,pr1ntr/keystone,kwangkim/keystone,belafontestudio/keystone,geminiyellow/keystone,Pop-Code/keystone,Pop-Code/keystone,benkroeger/keystone,frontyard/keystone,danielmahon/keystone,Yaska/keystone,matthewstyers/keystone,woody0907/keystone,joerter/keystone,pswoodworth/keystone,ONode/keystone,tony2cssc/keystone,SJApps/keystone,Tangcuyu/keystone,dvdcastro/keystone,onenorth/keystone,KZackery/keystone,creynders/keystone,MORE-HEALTH/keystone,qwales1/keystone,onenorth/keystone,SlashmanX/keystone,lojack/keystone,codevlabs/keystone,michaelerobertsjr/keystone,chrisgornall/d29blog,Yaska/keystone,the1sky/keystone,akoesnan/keystone,jeffreypriebe/keystone,davibe/keystone,w01fgang/keystone,stosorio/keystone,WofloW/keystone,tomasztunik/keystone,ratecity/keystone,developer-prosenjit/keystone,Redmart/keystone,asifiqbal84/keystone,DenisNeustroev/keystone,andrewlinfoot/keystone,trentmillar/keystone,kristianmandrup/keystone,jacargentina/keystone,WingedToaster/keystone,snowkeeper/keystone,wustxing/keystone,sendyhalim/keystone,trentmillar/keystone,suryagh/keystone,beni55/keystone,mekanics/keystone,efernandesng/keystone,matthieugayon/keystone,omnibrain/keystone,WofloW/keystone,rafmsou/keystone,vmkcom/keystone,jrit/keystone,codevlabs/keystone,concoursbyappointment/keystoneRedux,vmkcom/keystone,trystant/keystone,gcortese/keystone,omnibrain/keystone,youprofit/keystone,xyzteam2016/keystone,riyadhalnur/keystone,concoursbyappointment/keystoneRedux,magalhas/keystone,naustudio/keystone,everisARQ/keystone,francesconero/keystone,kwangkim/keystone,riyadhalnur/keystone,ratecity/keystone,trystant/keystone,wustxing/keystone,stunjiturner/keystone,jacargentina/keystone,douglasf/keystone,udp/keystone,udp/keystone,sarriaroman/keystone,rafmsou/keystone,KZackery/keystone,jstockwin/keystone,douglasf/keystone,BlakeRxxk/keystone,tanbo800/keystone,qwales1/keystone,tanbo800/keystone,gcortese/keystone,Freakland/keystone,kumo/keystone,unsworn/keystone,xyzteam2016/keystone,suryagh/keystone,matthewstyers/keystone,frontyard/keystone,Ftonso/keystone,danielmahon/keystone,snowkeeper/keystone,brianjd/keystone,lastjune/keystone,gemscng/keystone,alobodig/keystone,belafontestudio/keystone,WingedToaster/keystone,wilsonfletcher/keystone,SlashmanX/keystone,naustudio/keystone,ligson/keystone,antonj/keystone,michaelerobertsjr/keystone,alobodig/keystone,mikaoelitiana/keystone,Freakland/keystone,chrisgornall/d29blog,pswoodworth/keystone,Redmart/keystone,benkroeger/keystone,mikaoelitiana/keystone,ONode/keystone,wmertens/keystone
--- +++ @@ -4,7 +4,11 @@ if (!_.isObject(dependsOn)) return true; var keys = _.keys(dependsOn); return (keys.length) ? _.every(keys, function(key) { - var matches = _.isArray(dependsOn[key]) ? dependsOn[key] : [dependsOn[key]]; + var dependsValue = dependsOn[key]; + if(_.isBoolean(dependsValue)) { + return dependsValue !== _.isEmpty(values[key]); + } + var matches = _.isArray(dependsValue) ? dependsValue : [dependsValue]; return _.contains(matches, values[key]); }, this) : true; }
b30f6630199cb723a59d5581161c60a742d29c14
app/assets/javascripts/responses.js
app/assets/javascripts/responses.js
$(document).ready( function () { $(".upvote").click( function() { var commentId = $(".upvote").data("id"); event.preventDefault(); $.ajax({ url: '/response/up_vote', method: 'POST', data: { id: commentId }, dataType: 'JSON' }).done( function (voteCount) { if (voteCount == 1) { $("span[data-id=" + commentId + "]").html(voteCount + " vote"); } else { $("span[data-id=" + commentId + "]").html(voteCount + " vote"); } }).fail( function (voteCount) { console.log("Failed. Here is the voteCount:"); console.log(voteCount); }) }) })
$(document).ready( function () { $(".upvote").click( function() { var commentId = $(".upvote").data("id"); event.preventDefault(); $.ajax({ url: '/response/up_vote', method: 'POST', data: { id: commentId }, dataType: 'JSON' }).done( function (voteCount) { if (voteCount == 1) { $("span[data-id=" + commentId + "]").html(voteCount + " vote"); } else { $("span[data-id=" + commentId + "]").html(voteCount + " vote"); } }).fail( function (failureInfo) { console.log("Failed. Here is why:"); console.log(failureInfo.responseText); }) }) })
Change failure callback to show responding html embedded failure message from Active Record.
Change failure callback to show responding html embedded failure message from Active Record.
JavaScript
mit
great-horned-owls-2014/dbc-what-is-this,great-horned-owls-2014/dbc-what-is-this
--- +++ @@ -13,9 +13,9 @@ } else { $("span[data-id=" + commentId + "]").html(voteCount + " vote"); } - }).fail( function (voteCount) { - console.log("Failed. Here is the voteCount:"); - console.log(voteCount); + }).fail( function (failureInfo) { + console.log("Failed. Here is why:"); + console.log(failureInfo.responseText); }) }) })
e5c56ff931be01e97055f47fd05da85d56acca74
app/scripts/services/offlinemode.js
app/scripts/services/offlinemode.js
'use strict'; angular.module('offlineMode', []) .config(function ($httpProvider) { $httpProvider.interceptors.push('httpInterceptor'); }) .factory('httpInterceptor', function ($q) { var OFFLINE = location.search.indexOf('offline=true') > -1, _config = { OFFLINE_DATA_PATH: '/offline_data', API_PATH: '/api' }; return { request: function(req) { if (OFFLINE && req) { if (req.url.indexOf(_config.API_PATH) === 0) { var path = req.url.substring(_config.API_PATH.length); req.url = _config.OFFLINE_DATA_PATH + path + '.' + req.method.toLowerCase() + '.json'; } } return req || $q.when(req); }, config: _config }; } );
'use strict'; angular.module('offlineMode', []) .config(function ($httpProvider) { $httpProvider.interceptors.push('httpInterceptor'); }) .factory('httpInterceptor', function ($q) { var OFFLINE = location.search.indexOf('offline=true') > -1, config = { OFFLINE_DATA_PATH: '/offline_data', API_PATH: '/api' }; return { request: function(req) { if (OFFLINE && req) { if (req.url.indexOf(config.API_PATH) === 0) { var path = req.url.substring(config.API_PATH.length); req.url = config.OFFLINE_DATA_PATH + path + '.' + req.method.toLowerCase() + '.json'; } } return req || $q.when(req); }, config: config }; } );
Rename _config to config now
Rename _config to config now
JavaScript
mit
MartinSandstrom/angular-apimock,seriema/angular-apimock,seriema/angular-apimock,MartinSandstrom/angular-apimock
--- +++ @@ -7,7 +7,7 @@ .factory('httpInterceptor', function ($q) { var OFFLINE = location.search.indexOf('offline=true') > -1, - _config = { + config = { OFFLINE_DATA_PATH: '/offline_data', API_PATH: '/api' }; @@ -15,15 +15,15 @@ return { request: function(req) { if (OFFLINE && req) { - if (req.url.indexOf(_config.API_PATH) === 0) { - var path = req.url.substring(_config.API_PATH.length); - req.url = _config.OFFLINE_DATA_PATH + path + '.' + req.method.toLowerCase() + '.json'; + if (req.url.indexOf(config.API_PATH) === 0) { + var path = req.url.substring(config.API_PATH.length); + req.url = config.OFFLINE_DATA_PATH + path + '.' + req.method.toLowerCase() + '.json'; } } return req || $q.when(req); }, - config: _config + config: config }; } );
ce41f4599a9a68c23ccb9569f702ee1c0bb25bd0
lib/assets/javascripts/cartodb/common/public_footer_view.js
lib/assets/javascripts/cartodb/common/public_footer_view.js
var cdb = require('cartodb.js-v3'); var DEFAULT_LIGHT_ACTIVE = false; module.exports = cdb.core.View.extend({ initialize: function () { this._initModels(); this.template = this.isHosted ? cdb.templates.getTemplate('public/views/public_footer') : cdb.templates.getTemplate('common/views/footer_static'); }, render: function () { this.$el.html( this.template({ isHosted: this.isHosted, light: this.light, onpremiseVersion: this.onpremiseVersion }) ); return this; }, _initModels: function () { this.isHosted = cdb.config.get('cartodb_com_hosted'); this.onpremiseVersion = cdb.config.get('onpremise_version'); this.light = !!this.options.light || DEFAULT_LIGHT_ACTIVE; } });
var cdb = require('cartodb.js-v3'); var DEFAULT_LIGHT_ACTIVE = false; module.exports = cdb.core.View.extend({ initialize: function () { this._initModels(); this.template = this.isHosted ? cdb.templates.getTemplate('common/views/footer_static') : cdb.templates.getTemplate('public/views/public_footer'); }, render: function () { this.$el.html( this.template({ isHosted: this.isHosted, light: this.light, onpremiseVersion: this.onpremiseVersion }) ); return this; }, _initModels: function () { this.isHosted = cdb.config.get('cartodb_com_hosted'); this.onpremiseVersion = cdb.config.get('onpremise_version'); this.light = !!this.options.light || DEFAULT_LIGHT_ACTIVE; } });
Fix the proper footer based on cartodb_com_hosted.
Fix the proper footer based on cartodb_com_hosted.
JavaScript
bsd-3-clause
CartoDB/cartodb,CartoDB/cartodb,splashblot/dronedb,CartoDB/cartodb,splashblot/dronedb,splashblot/dronedb,CartoDB/cartodb,splashblot/dronedb,CartoDB/cartodb,splashblot/dronedb
--- +++ @@ -7,8 +7,8 @@ this._initModels(); this.template = this.isHosted - ? cdb.templates.getTemplate('public/views/public_footer') - : cdb.templates.getTemplate('common/views/footer_static'); + ? cdb.templates.getTemplate('common/views/footer_static') + : cdb.templates.getTemplate('public/views/public_footer'); }, render: function () {
856b1f29230acc829d627aa8779f345c71a3ddaa
packages/babel-plugin-transform-react-jsx-self/src/index.js
packages/babel-plugin-transform-react-jsx-self/src/index.js
/** * This adds {fileName, lineNumber} annotations to React component definitions * and to jsx tag literals. * * * == JSX Literals == * * <sometag /> * * becomes: * * <sometag __self={this} /> */ const TRACE_ID = "__self"; export default function ({ types: t }) { let visitor = { JSXOpeningElement(node) { const id = t.jSXIdentifier(TRACE_ID); const trace = t.identifier("this"); node.container.openingElement.attributes.push(t.jSXAttribute(id, t.jSXExpressionContainer(trace))); } }; return { visitor }; }
/** * This adds a __self={this} JSX attribute to all JSX elements, which React will use * to generate some runtime warnings. * * * == JSX Literals == * * <sometag /> * * becomes: * * <sometag __self={this} /> */ const TRACE_ID = "__self"; export default function ({ types: t }) { let visitor = { JSXOpeningElement({ node }) { const id = t.jSXIdentifier(TRACE_ID); const trace = t.thisExpression(); node.attributes.push(t.jSXAttribute(id, t.jSXExpressionContainer(trace))); } }; return { visitor }; }
Fix some mistakes in the jsx-self transform.
Fix some mistakes in the jsx-self transform.
JavaScript
mit
babel/babel,claudiopro/babel,kaicataldo/babel,tikotzky/babel,hzoo/babel,samwgoldman/babel,kellyselden/babel,shuhei/babel,PolymerLabs/babel,kassens/babel,babel/babel,iamchenxin/babel,samwgoldman/babel,hulkish/babel,tikotzky/babel,garyjN7/babel,hzoo/babel,KunGha/babel,Skillupco/babel,shuhei/babel,jridgewell/babel,jridgewell/babel,kassens/babel,ccschneidr/babel,iamchenxin/babel,hulkish/babel,kedromelon/babel,existentialism/babel,zertosh/babel,zjmiller/babel,jridgewell/babel,rmacklin/babel,hulkish/babel,KunGha/babel,bcoe/babel,guybedford/babel,PolymerLabs/babel,kaicataldo/babel,rmacklin/babel,chicoxyzzy/babel,Skillupco/babel,bcoe/babel,ccschneidr/babel,STRML/babel,claudiopro/babel,jchip/babel,jridgewell/babel,kellyselden/babel,babel/babel,kellyselden/babel,kellyselden/babel,hzoo/babel,guybedford/babel,zertosh/babel,existentialism/babel,guybedford/babel,PolymerLabs/babel,chicoxyzzy/babel,maurobringolf/babel,jchip/babel,vadzim/babel,lxe/babel,kaicataldo/babel,maurobringolf/babel,Skillupco/babel,garyjN7/babel,maurobringolf/babel,zjmiller/babel,hzoo/babel,STRML/babel,kaicataldo/babel,lxe/babel,chicoxyzzy/babel,babel/babel,vadzim/babel,chicoxyzzy/babel,existentialism/babel,shuhei/babel,Skillupco/babel,claudiopro/babel,kedromelon/babel,iamchenxin/babel,kedromelon/babel,hulkish/babel,samwgoldman/babel
--- +++ @@ -1,7 +1,6 @@ - - /** - * This adds {fileName, lineNumber} annotations to React component definitions - * and to jsx tag literals. +/** + * This adds a __self={this} JSX attribute to all JSX elements, which React will use + * to generate some runtime warnings. * * * == JSX Literals == @@ -17,10 +16,11 @@ export default function ({ types: t }) { let visitor = { - JSXOpeningElement(node) { + JSXOpeningElement({ node }) { const id = t.jSXIdentifier(TRACE_ID); - const trace = t.identifier("this"); - node.container.openingElement.attributes.push(t.jSXAttribute(id, t.jSXExpressionContainer(trace))); + const trace = t.thisExpression(); + + node.attributes.push(t.jSXAttribute(id, t.jSXExpressionContainer(trace))); } };
977c9fe1b897e8ed3a25eab75c01f60f828319a0
src/js/app/pagespeed-app.module.js
src/js/app/pagespeed-app.module.js
;(function() { 'use strict'; angular.module('pagespeedApp', ['pagespeed.templates']).config(function($sceDelegateProvider) { $sceDelegateProvider.resourceUrlWhitelist([ 'self', 'https://www.googleapis.com/pagespeedonline/v2/runPagespeed' // TODO pull from service instead of hard coded ]); }); })();
;(function() { 'use strict'; angular.module('pagespeedApp', ['pagespeed.templates']).config(['$sceDelegateProvider', function($sceDelegateProvider) { $sceDelegateProvider.resourceUrlWhitelist([ 'self', 'https://www.googleapis.com/pagespeedonline/v2/runPagespeed' // TODO pull from service instead of hard coded ]); }]); })();
Use inline annotation in config block
Use inline annotation in config block Fixes minification issues
JavaScript
mit
WileESpaghetti/demo-pagespeed,WileESpaghetti/demo-pagespeed
--- +++ @@ -1,9 +1,9 @@ ;(function() { 'use strict'; - angular.module('pagespeedApp', ['pagespeed.templates']).config(function($sceDelegateProvider) { + angular.module('pagespeedApp', ['pagespeed.templates']).config(['$sceDelegateProvider', function($sceDelegateProvider) { $sceDelegateProvider.resourceUrlWhitelist([ 'self', 'https://www.googleapis.com/pagespeedonline/v2/runPagespeed' // TODO pull from service instead of hard coded ]); - }); + }]); })();
cc719f1526929d67df889ad2edfbb15f12445fbe
src/Chromabits/Loader/Loader.js
src/Chromabits/Loader/Loader.js
'use strict'; var ensure = require('ensure.js'), ClassNotFoundException = require('./Exceptions/ClassNotFoundException.js'), ClassMap = require('../Mapper/ClassMap.js'); var Loader; /** * ClassLoader * * Capable of loading a class using multiple class maps. A class will be * resolved in the order the class maps have been added. * * @return {undefined} - */ Loader = function () { this.maps = []; }; /** * Add a map to the loader * * @param {enclosure.Chromabits.Mapper.ClassMap} map - * * @return {undefined} - */ Loader.prototype.addMap = function (map) { ensure(map, ClassMap); this.maps.push(map); }; /** * Get the constructor for the specified class * * @param {String} fullClassName - * * @return {Function} - */ Loader.prototype.get = function (fullClassName) { for (var map in this.maps) { if (map.has(fullClassName)) { return map.get(fullClassName); } } throw new ClassNotFoundException(fullClassName); }; module.exports = Loader;
'use strict'; var ensure = require('ensure.js'), ClassNotFoundException = require('./Exceptions/ClassNotFoundException.js'), ClassMap = require('../Mapper/ClassMap.js'); var Loader; /** * ClassLoader * * Capable of loading a class using multiple class maps. A class will be * resolved in the order the class maps have been added. * * @return {undefined} - */ Loader = function () { this.maps = []; }; /** * Add a map to the loader * * @param {enclosure.Chromabits.Mapper.ClassMap} map - * * @return {undefined} - */ Loader.prototype.addMap = function (map) { ensure(map, ClassMap); this.maps.push(map); }; /** * Get the constructor for the specified class * * @param {String} fullClassName - * * @return {Function} - */ Loader.prototype.get = function (fullClassName) { for (var key in this.maps) { if (this.maps.hasOwnProperty(key)) { var map = this.maps[key]; if (map.has(fullClassName)) { return map.get(fullClassName); } } } throw new ClassNotFoundException(fullClassName); }; module.exports = Loader;
Fix bug on the class loader
Fix bug on the class loader
JavaScript
mit
etcinit/enclosure
--- +++ @@ -39,9 +39,13 @@ * @return {Function} - */ Loader.prototype.get = function (fullClassName) { - for (var map in this.maps) { - if (map.has(fullClassName)) { - return map.get(fullClassName); + for (var key in this.maps) { + if (this.maps.hasOwnProperty(key)) { + var map = this.maps[key]; + + if (map.has(fullClassName)) { + return map.get(fullClassName); + } } }
1a12317c2c9fa53e0ead42abe63b55ad222f9b49
test/conf/karma-common.conf.js
test/conf/karma-common.conf.js
/*eslint-env node */ var sourceList = require("../../src/source-list"); var sourceFiles = sourceList.list.map(function(src) { return "src/" + src; }); var commonJsSourceFiles = sourceList.commonJsModuleList; var testFiles = [ "test/util/dom.js", "test/util/matchers.js", "test/util/mock/vivliostyle/logging-mock.js", "test/util/mock/vivliostyle/plugin-mock.js", "test/spec/**/*.js" ]; module.exports = function(config) { return { basePath: "../..", frameworks: ["jasmine", 'commonjs'], files: sourceFiles.concat(testFiles).concat(commonJsSourceFiles), preprocessors: { }, commonjsPreprocessor: { modulesRoot: './' }, port: 9876, colors: true, logLevel: config.LOG_INFO }; };
/*eslint-env node */ var sourceList = require("../../src/source-list"); var sourceFiles = sourceList.list.map(function(src) { return "src/" + src; }); var commonJsSourceFiles = sourceList.commonJsModuleList; var testFiles = [ "test/util/dom.js", "test/util/matchers.js", "test/util/mock/vivliostyle/logging-mock.js", "test/util/mock/vivliostyle/plugin-mock.js", "test/spec/**/*.js" ]; module.exports = function(config) { return { basePath: "../..", frameworks: ["jasmine"], files: sourceFiles.concat(testFiles).concat(commonJsSourceFiles), // frameworks: ["jasmine", 'commonjs'], // preprocessors: { // "node_modules/dummy/*.js": ['commonjs'] // }, // commonjsPreprocessor: { // modulesRoot: './' // }, port: 9876, colors: true, logLevel: config.LOG_INFO }; };
Remove karma-commonjs settings for avoiding error.
Remove karma-commonjs settings for avoiding error. - If you require commonjs modules, Add settings below: - Add `commonjs` to `frameworks`. ``` frameworks: ["jasmine", 'commonjs'], ``` - Add `preprocessors` and `commonjsPreprocessor` setting. ``` preprocessors: { "node_modules/dummy/*.js": ['commonjs'] }, commonjsPreprocessor: { modulesRoot: './' }, ```
JavaScript
agpl-3.0
vivliostyle/vivliostyle.js,vivliostyle/vivliostyle.js,vivliostyle/vivliostyle.js,vivliostyle/vivliostyle.js
--- +++ @@ -16,13 +16,15 @@ module.exports = function(config) { return { basePath: "../..", - frameworks: ["jasmine", 'commonjs'], + frameworks: ["jasmine"], files: sourceFiles.concat(testFiles).concat(commonJsSourceFiles), - preprocessors: { - }, - commonjsPreprocessor: { - modulesRoot: './' - }, + // frameworks: ["jasmine", 'commonjs'], + // preprocessors: { + // "node_modules/dummy/*.js": ['commonjs'] + // }, + // commonjsPreprocessor: { + // modulesRoot: './' + // }, port: 9876, colors: true, logLevel: config.LOG_INFO
40ee9312b1d8c6f1d13f737ffc0846bb4c104d8e
test/integration/proxy.test.js
test/integration/proxy.test.js
import {browser} from '../mini-testium-mocha'; import {delay} from 'Bluebird'; describe('proxy', () => { before(browser.beforeHook); describe('handles errors', () => { it('with no content type and preserves status code', () => browser .navigateTo('/').assertStatusCode(200) .navigateTo('/error').assertStatusCode(500)); it('that crash and preserves status code', () => browser.navigateTo('/crash').assertStatusCode(500)); }); it('handles request abortion', async () => { // loads a page that has a resource that will // be black holed await browser .navigateTo('/blackholed-resource.html').assertStatusCode(200); // this can't simply be sync // because firefox blocks dom-ready // if we don't wait on the client-side await delay(50); // when navigating away, the proxy should // abort the resource request; // this should not interfere with the new page load // or status code retrieval await browser.navigateTo('/').assertStatusCode(200); }); it('handles hashes in urls', () => browser.navigateTo('/#deals').assertStatusCode(200)); });
import {browser} from '../mini-testium-mocha'; import {delay} from 'bluebird'; describe('proxy', () => { before(browser.beforeHook); describe('handles errors', () => { it('with no content type and preserves status code', () => browser .navigateTo('/').assertStatusCode(200) .navigateTo('/error').assertStatusCode(500)); it('that crash and preserves status code', () => browser.navigateTo('/crash').assertStatusCode(500)); }); it('handles request abortion', async () => { // loads a page that has a resource that will // be black holed await browser .navigateTo('/blackholed-resource.html').assertStatusCode(200); // this can't simply be sync // because firefox blocks dom-ready // if we don't wait on the client-side await delay(50); // when navigating away, the proxy should // abort the resource request; // this should not interfere with the new page load // or status code retrieval await browser.navigateTo('/').assertStatusCode(200); }); it('handles hashes in urls', () => browser.navigateTo('/#deals').assertStatusCode(200)); });
Fix casing of bluebird import
Fix casing of bluebird import
JavaScript
bsd-3-clause
testiumjs/testium-driver-wd
--- +++ @@ -1,5 +1,5 @@ import {browser} from '../mini-testium-mocha'; -import {delay} from 'Bluebird'; +import {delay} from 'bluebird'; describe('proxy', () => { before(browser.beforeHook);
a27e54cf245444f6b858ff57549967795e11021b
lib/hydrater-tika/helpers/hydrate.js
lib/hydrater-tika/helpers/hydrate.js
'use strict'; /** * @file Hydrate the file from scratch. * Download it from Cluestr, save it to local storage, run tika and returns the result. * * This helper is used in the server queue. */ var async = require('async'); var request = require('request'); var crypto = require('crypto'); var fs = require('fs'); var tikaShell = require('./tika-shell.js'); /** * Take a Cluestr document and returns metadatas * * @param {Object} task Task object, keys must be file_path (file URL) and callback (URL) * @param {Function} cb Callback, first parameter is the error. */ module.exports = function(task, done) { var serverUrl = require('../../../app.js').url; // Download the file async.waterfall([ function(cb) { request.get(task.file_path, cb); }, function(res, body, cb) { var path = '/tmp/' + crypto.randomBytes(20).toString('hex'); fs.writeFile(path, body, function(err) { cb(err, path); }); }, function(path, cb) { tikaShell(path , cb); }, function(data, cb) { // Upload to server var params = { url: task.callback, json: { hydrater: serverUrl + '/hydrate', metadatas: data, } }; request.patch(params, cb); } ], done); };
'use strict'; /** * @file Hydrate the file from scratch. * Download it from Cluestr, save it to local storage, run tika and returns the result. * * This helper is used in the server queue. */ var async = require('async'); var request = require('request'); var crypto = require('crypto'); var fs = require('fs'); var tikaShell = require('./tika-shell.js'); /** * Take a Cluestr document and returns metadatas * * @param {Object} task Task object, keys must be file_path (file URL) and callback (URL) * @param {Function} cb Callback, first parameter is the error. */ module.exports = function(task, done) { var serverUrl = require('../../../app.js').url; async.waterfall([ function(cb) { var path = '/tmp/' + crypto.randomBytes(20).toString('hex'); // Download the file request(task.file_path) .pipe(fs.createWriteStream(path)) .on('finish', function() { cb(null, path); }); }, function(path, cb) { tikaShell(path , cb); }, function(data, cb) { // Upload to server var params = { url: task.callback, json: { hydrater: serverUrl + '/hydrate', metadatas: data, } }; request.patch(params, cb); } ], done); };
Use stream while reading file
Use stream while reading file
JavaScript
mit
AnyFetch/anyfetch-hydrater.js
--- +++ @@ -25,16 +25,15 @@ module.exports = function(task, done) { var serverUrl = require('../../../app.js').url; - // Download the file async.waterfall([ function(cb) { - request.get(task.file_path, cb); - }, - function(res, body, cb) { var path = '/tmp/' + crypto.randomBytes(20).toString('hex'); - fs.writeFile(path, body, function(err) { - cb(err, path); - }); + // Download the file + request(task.file_path) + .pipe(fs.createWriteStream(path)) + .on('finish', function() { + cb(null, path); + }); }, function(path, cb) { tikaShell(path , cb);
a34b2269c3749a5c014e2fcdd663795f3c8f1731
lib/auth/token-container.js
lib/auth/token-container.js
var crypto = require('crypto'); var _ = require('underscore'); function TokenContainer() { this._tokens = {}; this._startGarbageCollecting(); } TokenContainer._hourMs = 60 * 60 * 1000; TokenContainer._collectorIntervalMs = 12 * TokenContainer._hourMs; TokenContainer._oudatedTimeMs = 48 * TokenContainer._hourMs; TokenContainer.prototype.saveToken = function(res, token) { var cookie = crypto.randomBytes(32).toString('hex'); this._tokens[cookie] = {token: token, lastUsage: Date.now()}; res.cookies.set('userid', cookie, {path: '/', secure: true, httpOnly: false}); }; TokenContainer.prototype.hasToken = function(tokenKey) { var info = this._tokens[tokenKey]; if (info) { info.lastUsage = Date.now(); } return !!info; }; TokenContainer.prototype.extractTokenKeyFromRequest = function(req) { return req.cookies.get('userid'); }; TokenContainer.prototype._startGarbageCollecting = function() { setInterval(function() { var now = Date.now(); _.each(this._tokens, function(info, cookie, cookies) { if (now - info.lastUsage > TokenContainer._oudatedTimeMs) { delete cookies[cookie]; } }); }.bind(this), TokenContainer._collectorIntervalMs); }; module.exports = TokenContainer;
var crypto = require('crypto'); var _ = require('underscore'); function TokenContainer() { this._tokens = {}; this._startGarbageCollecting(); } TokenContainer._hourMs = 60 * 60 * 1000; TokenContainer._collectorIntervalMs = 12 * TokenContainer._hourMs; TokenContainer._oudatedTimeMs = 48 * TokenContainer._hourMs; TokenContainer.prototype.saveToken = function(res, token) { var cookie = crypto.randomBytes(32).toString('hex'); this._tokens[cookie] = {token: token, lastUsage: Date.now()}; res.cookies.set('userid', cookie, {path: '/'}); }; TokenContainer.prototype.hasToken = function(tokenKey) { var info = this._tokens[tokenKey]; if (info) { info.lastUsage = Date.now(); } return !!info; }; TokenContainer.prototype.extractTokenKeyFromRequest = function(req) { return req.cookies.get('userid'); }; TokenContainer.prototype._startGarbageCollecting = function() { setInterval(function() { var now = Date.now(); _.each(this._tokens, function(info, cookie, cookies) { if (now - info.lastUsage > TokenContainer._oudatedTimeMs) { delete cookies[cookie]; } }); }.bind(this), TokenContainer._collectorIntervalMs); }; module.exports = TokenContainer;
Remove https restriction from cookie setter.
Remove https restriction from cookie setter.
JavaScript
mit
cargomedia/pulsar-rest-api,njam/pulsar-rest-api,cargomedia/pulsar-rest-api,njam/pulsar-rest-api,cargomedia/pulsar-rest-api,vogdb/pulsar-rest-api,cargomedia/pulsar-rest-api,njam/pulsar-rest-api,vogdb/pulsar-rest-api,njam/pulsar-rest-api,vogdb/pulsar-rest-api
--- +++ @@ -13,7 +13,7 @@ TokenContainer.prototype.saveToken = function(res, token) { var cookie = crypto.randomBytes(32).toString('hex'); this._tokens[cookie] = {token: token, lastUsage: Date.now()}; - res.cookies.set('userid', cookie, {path: '/', secure: true, httpOnly: false}); + res.cookies.set('userid', cookie, {path: '/'}); }; TokenContainer.prototype.hasToken = function(tokenKey) {
e5f08ef8be8d7484c963454e84e89e9f28aae810
tests/e2e/utils/page-wait.js
tests/e2e/utils/page-wait.js
/** * Utlity to have the page wait for a given length. * * Site Kit by Google, Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in 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 const E2E_PAGE_WAIT = 250; /** * Set the page to wait for the passed time. Defaults to 250 milliseconds. * * @since 1.10.0 * * @param {number} [delay] Optional. The amount of milliseconds to wait. */ export const pageWait = async ( delay = E2E_PAGE_WAIT ) => { if ( typeof delay !== 'number' ) { throw new Error( 'pageWait requires a number to be passed.' ); } await page.waitFor( delay ); };
/** * Utility to have the page wait for a given length. * * Site Kit by Google, Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in 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 const E2E_PAGE_WAIT = 250; /** * Set the page to wait for the passed time. Defaults to 250 milliseconds. * * @since 1.10.0 * * @param {number} [delay] Optional. The amount of milliseconds to wait. */ export const pageWait = async ( delay = E2E_PAGE_WAIT ) => { if ( typeof delay !== 'number' ) { throw new Error( 'pageWait requires a number to be passed.' ); } await page.waitFor( delay ); };
Fix spelling error in file header.
Fix spelling error in file header.
JavaScript
apache-2.0
google/site-kit-wp,google/site-kit-wp,google/site-kit-wp,google/site-kit-wp
--- +++ @@ -1,5 +1,5 @@ /** - * Utlity to have the page wait for a given length. + * Utility to have the page wait for a given length. * * Site Kit by Google, Copyright 2020 Google LLC *
3bc6773ac0ae53037a53dfea0df672ba2fa613f8
lib/collections/requests.js
lib/collections/requests.js
Requests = new Mongo.Collection('requests'); Meteor.methods({ addRequest: function(requestAttributes) { check(Meteor.userId(), String); check(requestAttributes, { user: Object, project: Object }); if (hasRequestPending(requestAttributes.user.userId, requestAttributes.project.projectId)) { throw new Meteor.Error('User has already requested to join'); } var request = _.extend(requestAttributes, { createdAt: new Date(), status: 'pending' }); Requests.insert(request); createRequestNotification(request); } }); hasRequestPending = function(userId, projectId) { return Requests.find({ 'user.userId': userId, 'project.projectId': projectId, status: 'pending' }).count() > 0; };
Requests = new Mongo.Collection('requests'); Meteor.methods({ addRequest: function(requestAttributes) { check(Meteor.userId(), String); check(requestAttributes, { user: Object, project: Object }); if (hasRequestPending(requestAttributes.user.userId, requestAttributes.project.projectId)) { throw new Meteor.Error('User has already requested to join'); } var request = _.extend(requestAttributes, { createdAt: new Date(), status: 'pending' }); var requestId = Requests.insert(request); var request = _.extend(request, { _id: requestId }); createRequestNotification(request); } }); hasRequestPending = function(userId, projectId) { return Requests.find({ 'user.userId': userId, 'project.projectId': projectId, status: 'pending' }).count() > 0; };
Add extra field so _id is passed to make notification read
Add extra field so _id is passed to make notification read
JavaScript
mit
PUMATeam/puma,PUMATeam/puma
--- +++ @@ -17,7 +17,11 @@ status: 'pending' }); - Requests.insert(request); + var requestId = Requests.insert(request); + var request = _.extend(request, { + _id: requestId + }); + createRequestNotification(request); } });
fadf55c806d8339d2aca59fdbc1b1ebcc92de81d
webpack.config.js
webpack.config.js
var path = require('path'); var process = require('process'); var fs = require('fs'); var nodeModules = {}; fs.readdirSync('node_modules') .filter(function(x) { return ['.bin'].indexOf(x) === -1; }) .forEach(function(mod) { nodeModules[mod] = 'commonjs ' + mod; }); module.exports = { context: path.join(process.env.PWD, 'frontend'), entry: "./index.js", target: 'node', output: { path: path.join(__dirname, 'dist'), filename: 'webpack.bundle.js' }, externals: nodeModules, module: { loaders: [ { test: /\.js$/, loader: 'babel' } ] } };
var path = require('path'); var process = require('process'); var fs = require('fs'); module.exports = { context: path.join(process.env.PWD, 'frontend'), entry: "./index.js", target: 'node', output: { path: path.join(__dirname, 'dist'), filename: 'webpack.bundle.js' }, module: { loaders: [ { test: /\.js$/, loader: 'babel' } ] } };
Remove externals option for import React, ReactDOM, etc...
Remove externals option for import React, ReactDOM, etc...
JavaScript
mit
mgi166/usi-front,mgi166/usi-front
--- +++ @@ -1,15 +1,6 @@ var path = require('path'); var process = require('process'); var fs = require('fs'); - -var nodeModules = {}; -fs.readdirSync('node_modules') - .filter(function(x) { - return ['.bin'].indexOf(x) === -1; - }) - .forEach(function(mod) { - nodeModules[mod] = 'commonjs ' + mod; - }); module.exports = { context: path.join(process.env.PWD, 'frontend'), @@ -19,7 +10,6 @@ path: path.join(__dirname, 'dist'), filename: 'webpack.bundle.js' }, - externals: nodeModules, module: { loaders: [ { test: /\.js$/, loader: 'babel' }
df4ec07d287066f89ae9077bbcc622426005ae06
webpack.config.js
webpack.config.js
/* global __dirname, require, module*/ const webpack = require('webpack'); const UglifyJsPlugin = webpack.optimize.UglifyJsPlugin; const path = require('path'); const env = require('yargs').argv.env; // use --env with webpack 2 let libraryName = 'library'; let plugins = [], outputFile; if (env === 'build') { plugins.push(new UglifyJsPlugin({ minimize: true })); outputFile = libraryName + '.min.js'; } else { outputFile = libraryName + '.js'; } const config = { entry: __dirname + '/src/index.js', devtool: 'source-map', output: { path: __dirname + '/lib', filename: outputFile, library: libraryName, libraryTarget: 'umd', umdNamedDefine: true }, module: { rules: [ { test: /(\.jsx|\.js)$/, loader: 'babel-loader', exclude: /(node_modules|bower_components)/ }, { test: /(\.jsx|\.js)$/, loader: 'eslint-loader', exclude: /node_modules/ } ] }, resolve: { modules: [path.resolve('./node_modules'), path.resolve('./src')], extensions: ['.json', '.js'] }, plugins: plugins }; module.exports = config;
/* global __dirname, require, module*/ const webpack = require('webpack'); const UglifyJsPlugin = webpack.optimize.UglifyJsPlugin; const path = require('path'); const env = require('yargs').argv.env; // use --env with webpack 2 const pkg = require('./package.json'); let libraryName = pkg.name; let plugins = [], outputFile; if (env === 'build') { plugins.push(new UglifyJsPlugin({ minimize: true })); outputFile = libraryName + '.min.js'; } else { outputFile = libraryName + '.js'; } const config = { entry: __dirname + '/src/index.js', devtool: 'source-map', output: { path: __dirname + '/lib', filename: outputFile, library: libraryName, libraryTarget: 'umd', umdNamedDefine: true }, module: { rules: [ { test: /(\.jsx|\.js)$/, loader: 'babel-loader', exclude: /(node_modules|bower_components)/ }, { test: /(\.jsx|\.js)$/, loader: 'eslint-loader', exclude: /node_modules/ } ] }, resolve: { modules: [path.resolve('./node_modules'), path.resolve('./src')], extensions: ['.json', '.js'] }, plugins: plugins }; module.exports = config;
Use name of package.json as build output
Use name of package.json as build output
JavaScript
mit
krasimir/webpack-library-starter
--- +++ @@ -4,8 +4,9 @@ const UglifyJsPlugin = webpack.optimize.UglifyJsPlugin; const path = require('path'); const env = require('yargs').argv.env; // use --env with webpack 2 +const pkg = require('./package.json'); -let libraryName = 'library'; +let libraryName = pkg.name; let plugins = [], outputFile;
dbe77896c2233f3ae06e539a4c3a50cbee778b28
web/src/main/ng/client/assets/js/context/List.Controller.js
web/src/main/ng/client/assets/js/context/List.Controller.js
angular.module('contextModule').controller('Context.ListController', [ '$scope', '$http', '$filter', '$routeParams', 'FoundationApi', 'Event.Service', function ($scope, $http, $filter, $routeParams, foundationApi, eventService) { self = this; var contexts; eventService.register('Context.ListController', processEvent); function processEvent(event) { if (event.type === 'greenmoonsoftware.tidewater.web.context.events.PipelineContextEndedEvent') { var c = $filter('getBy')(self.contexts, 'contextId', event.aggregateId); c.status = event.status; c.endTime = event.endTime.epochSecond * 1000; $scope.$apply(); } }; $scope.pipelineName = $routeParams.pipelineName; $http.get('/pipelines/' + $scope.pipelineName + '/contexts'). then (function (response) { self.contexts = response.data.reverse(); $scope.contexts = self.contexts; }, function(response) { foundationApi.publish('main-notifications', { color: 'alert', autoclose: 3000, content: 'Failed' }); }); } ]);
angular.module('contextModule').controller('Context.ListController', [ '$scope', '$http', '$filter', '$routeParams', 'FoundationApi', 'Event.Service', function ($scope, $http, $filter, $routeParams, foundationApi, eventService) { self = this; var contexts; eventService.register('Context.ListController', processEvent); function processEvent(event) { if (event.type === 'greenmoonsoftware.tidewater.web.context.events.PipelineContextStartedEvent') { $scope.contexts.unshift({ contextId: event.aggregateId, pipelineName: $routeParams.pipelineName, status: 'IN_PROGRESS', startTime: event.eventDateTime.epochSecond * 1000, }); $scope.apply(); } else if (event.type === 'greenmoonsoftware.tidewater.web.context.events.PipelineContextEndedEvent') { var c = $filter('getBy')(self.contexts, 'contextId', event.aggregateId); c.status = event.status; c.endTime = event.endTime.epochSecond * 1000; $scope.$apply(); } }; $scope.pipelineName = $routeParams.pipelineName; $http.get('/pipelines/' + $scope.pipelineName + '/contexts'). then (function (response) { self.contexts = response.data.reverse(); $scope.contexts = self.contexts; }, function(response) { foundationApi.publish('main-notifications', { color: 'alert', autoclose: 3000, content: 'Failed' }); }); } ]);
Add context to list upon start event
Add context to list upon start event
JavaScript
apache-2.0
greathouse/tidewater,greathouse/tidewater,greathouse/tidewater
--- +++ @@ -13,7 +13,16 @@ eventService.register('Context.ListController', processEvent); function processEvent(event) { - if (event.type === 'greenmoonsoftware.tidewater.web.context.events.PipelineContextEndedEvent') { + if (event.type === 'greenmoonsoftware.tidewater.web.context.events.PipelineContextStartedEvent') { + $scope.contexts.unshift({ + contextId: event.aggregateId, + pipelineName: $routeParams.pipelineName, + status: 'IN_PROGRESS', + startTime: event.eventDateTime.epochSecond * 1000, + }); + $scope.apply(); + } + else if (event.type === 'greenmoonsoftware.tidewater.web.context.events.PipelineContextEndedEvent') { var c = $filter('getBy')(self.contexts, 'contextId', event.aggregateId); c.status = event.status; c.endTime = event.endTime.epochSecond * 1000;
4ac5daf222c879222677d66049505637a9a7836d
resources/assets/js/app.js
resources/assets/js/app.js
/** * First we will load all of this project's JavaScript dependencies which * includes Vue and other libraries. It is a great starting point when * building robust, powerful web applications using Vue and Laravel. */ require('./bootstrap'); window.Vue = require('vue'); /** * Next, we will create a fresh Vue application instance and attach it to * the page. Then, you may begin adding components to this application * or customize the JavaScript scaffolding to fit your unique needs. */ // Vue.component('example', require('./components/Example.vue')); Vue.component('app-tracker', require('./components/Tracker.vue')); const app = new Vue({ el: '#app-canvas', data: { coinSaved: ['Awjp27', 'LEc69S', 'cgSvK4'], coinData: [] }, created: function() { axios.get('/api/coins/list') .then(function (response) { app.coinData = response.data; }).catch(function (response) { return response; }) } });
/** * First we will load all of this project's JavaScript dependencies which * includes Vue and other libraries. It is a great starting point when * building robust, powerful web applications using Vue and Laravel. */ require('./bootstrap'); window.Vue = require('vue'); /** * Next, we will create a fresh Vue application instance and attach it to * the page. Then, you may begin adding components to this application * or customize the JavaScript scaffolding to fit your unique needs. */ // Vue.component('example', require('./components/Example.vue')); Vue.component('app-tracker', require('./components/Tracker.vue')); const app = new Vue({ el: '#app-canvas', data: { coinSaved: ['Awjp27', 'LEc69S', 'cgSvK4'], coinData: [] }, methods: { getPrices: function(coinUids) { return axios.post('/api/coins/prices', { coins: coinUids }) .then(function (response) { app.coinData = response.data; }).catch(function (error) { return error; }) }, getAllPrices: function() { return axios.get('/api/coins/prices') .then(function (response) { app.coinData = response.data; }).catch(function (error) { return error; }) } }, created: function() { if (this.coinSaved.length > 0) { this.getPrices(this.coinSaved); } else { this.getAllPrices(); } } });
Add method for limited coin retreival
Add method for limited coin retreival
JavaScript
mit
vadremix/zealoustools-core,vadremix/zealoustools-core
--- +++ @@ -28,12 +28,33 @@ coinData: [] }, + methods: { + getPrices: function(coinUids) { + return axios.post('/api/coins/prices', { + coins: coinUids + }) + .then(function (response) { + app.coinData = response.data; + }).catch(function (error) { + return error; + }) + }, + + getAllPrices: function() { + return axios.get('/api/coins/prices') + .then(function (response) { + app.coinData = response.data; + }).catch(function (error) { + return error; + }) + } + }, + created: function() { - axios.get('/api/coins/list') - .then(function (response) { - app.coinData = response.data; - }).catch(function (response) { - return response; - }) + if (this.coinSaved.length > 0) { + this.getPrices(this.coinSaved); + } else { + this.getAllPrices(); + } } });
eaad32c88ae888c9e479ec5a7bef08f6d0f4502a
src/scene/scene_depthmaterial.js
src/scene/scene_depthmaterial.js
pc.extend(pc, function () { /** * @name pc.DepthMaterial * @class A Depth material is is for rendering linear depth values to a render target. * @author Will Eastcott */ var DepthMaterial = function () { }; DepthMaterial = pc.inherits(DepthMaterial, pc.Material); pc.extend(DepthMaterial.prototype, { /** * @function * @name pc.DepthMaterial#clone * @description Duplicates a Depth material. * @returns {pc.DepthMaterial} A cloned Depth material. */ clone: function () { var clone = new pc.DepthMaterial(); Material.prototype._cloneInternal.call(this, clone); clone.update(); return clone; }, update: function () { }, updateShader: function (device) { var options = { skin: !!this.meshInstances[0].skinInstance }; var library = device.getProgramLibrary(); this.shader = library.getProgram('depth', options); } }); return { DepthMaterial: DepthMaterial }; }());
pc.extend(pc, function () { /** * @private * @name pc.DepthMaterial * @class A Depth material is is for rendering linear depth values to a render target. * @author Will Eastcott */ var DepthMaterial = function () { }; DepthMaterial = pc.inherits(DepthMaterial, pc.Material); pc.extend(DepthMaterial.prototype, { /** * @private * @function * @name pc.DepthMaterial#clone * @description Duplicates a Depth material. * @returns {pc.DepthMaterial} A cloned Depth material. */ clone: function () { var clone = new pc.DepthMaterial(); Material.prototype._cloneInternal.call(this, clone); clone.update(); return clone; }, update: function () { }, updateShader: function (device) { var options = { skin: !!this.meshInstances[0].skinInstance }; var library = device.getProgramLibrary(); this.shader = library.getProgram('depth', options); } }); return { DepthMaterial: DepthMaterial }; }());
Remove pc.DepthMaterial from API ref.
Remove pc.DepthMaterial from API ref.
JavaScript
mit
guycalledfrank/engine,aidinabedi/playcanvas-engine,guycalledfrank/engine,sereepap2029/playcanvas,H1Gdev/engine,sereepap2029/playcanvas,H1Gdev/engine,sereepap2029/playcanvas,MicroWorldwide/PlayCanvas,playcanvas/engine,aidinabedi/playcanvas-engine,MicroWorldwide/PlayCanvas,playcanvas/engine
--- +++ @@ -1,6 +1,7 @@ pc.extend(pc, function () { /** + * @private * @name pc.DepthMaterial * @class A Depth material is is for rendering linear depth values to a render target. * @author Will Eastcott @@ -12,6 +13,7 @@ pc.extend(DepthMaterial.prototype, { /** + * @private * @function * @name pc.DepthMaterial#clone * @description Duplicates a Depth material.
a54ed8d797aa22cdeefc30c28f18e737fda1265c
src/test/resources/specRunner.js
src/test/resources/specRunner.js
var scanner = require('./scanner'); module.exports = { run: function(pattern) { // load jasmine and a terminal reporter into global load("jasmine-1.3.1/jasmine.js"); load('./terminalReporter.js'); // load the specs var jasmineEnv = jasmine.getEnv(), specs = scanner.findSpecs(pattern), reporter = new jasmine.TerminalReporter({verbosity:3,color:true}); jasmineEnv.addReporter(reporter); for(var i = 0; i < specs.length; i++) { require(specs[i]); } process.nextTick(jasmineEnv.execute.bind(jasmineEnv)); } };
var scanner = require('./scanner'); module.exports = { run: function(pattern) { // load jasmine and a terminal reporter into global load("jasmine-1.3.1/jasmine.js"); load('./terminalReporter.js'); color = !process.env.JASMINE_NOCOLOR; // load the specs var jasmineEnv = jasmine.getEnv(), specs = scanner.findSpecs(pattern), reporter = new jasmine.TerminalReporter({verbosity:3,color:color}); jasmineEnv.addReporter(reporter); for(var i = 0; i < specs.length; i++) { require(specs[i]); } process.nextTick(jasmineEnv.execute.bind(jasmineEnv)); } };
Use an env var to determine whether spec output should colorize
Use an env var to determine whether spec output should colorize
JavaScript
apache-2.0
dherges/nodyn,tony--/nodyn,tony--/nodyn,tony--/nodyn,dherges/nodyn,nodyn/nodyn,nodyn/nodyn,dherges/nodyn,nodyn/nodyn
--- +++ @@ -6,11 +6,12 @@ // load jasmine and a terminal reporter into global load("jasmine-1.3.1/jasmine.js"); load('./terminalReporter.js'); + color = !process.env.JASMINE_NOCOLOR; // load the specs var jasmineEnv = jasmine.getEnv(), specs = scanner.findSpecs(pattern), - reporter = new jasmine.TerminalReporter({verbosity:3,color:true}); + reporter = new jasmine.TerminalReporter({verbosity:3,color:color}); jasmineEnv.addReporter(reporter);
58d581984caa03c468f4b5d05d7e2a61cc66374b
src/util/server/requestLogger.js
src/util/server/requestLogger.js
const uuid = require('uuid'); const DEFAULT_HEADER_NAME = 'x-request-id'; /** * Create a request loging express middleware * @param {Object} logger - a logger instance * @param {Object} options * @param {String?} options.headerName * @returns {Function} */ export default function createRequestLogger(logger, options = { headerName: DEFAULT_HEADER_NAME }) { /** * Request Logger Middleware * Adds base logging to every request * Attaches a `log` child to each request object * * @param {Object} req * @param {Object} res * @param {Function} next * @returns {undefined} */ return function requestLoggerMiddleware(req, res, next) { const id = req.get(options.headerName) || uuid.v4(); let log = logger.child({ component: 'request', req_id: id, req }); // attach a logger to each request req.log = log; res.setHeader(options.headerName, id); log.info('start request'); const time = process.hrtime(); res.on('finish', () => { const diff = process.hrtime(time); const duration = diff[0] * 1e3 + diff[1] * 1e-6; log.info({ res, duration }, 'end request'); // Release the request logger for GC req.log = null; log = null; }); next(); }; }
const uuid = require('uuid'); const DEFAULT_HEADER_NAME = 'x-request-id'; /** * Create a request loging express middleware * @param {Object} logger - a logger instance * @param {Object} options * @param {String?} options.reqIdHeader * @returns {Function} */ export default function createRequestLogger(logger, { reqIdHeader = DEFAULT_HEADER_NAME } = {}) { /** * Request Logger Middleware * Adds base logging to every request * Attaches a `log` child to each request object * * @param {Object} req * @param {Object} res * @param {Function} next * @returns {undefined} */ return function requestLoggerMiddleware(req, res, next) { const id = req.get(reqIdHeader) || uuid.v4(); let log = logger.child({ component: 'request', req_id: id, req }); // attach a logger to each request req.log = log; res.setHeader(reqIdHeader, id); log.info('start request'); const time = process.hrtime(); res.on('finish', () => { const diff = process.hrtime(time); const duration = diff[0] * 1e3 + diff[1] * 1e-6; log.info({ res, duration }, 'end request'); // Release the request logger for GC req.log = null; log = null; }); next(); }; }
Rename server request logger request id header name option and make the config object optional
Rename server request logger request id header name option and make the config object optional
JavaScript
mit
wework/we-js-logger
--- +++ @@ -6,10 +6,10 @@ * Create a request loging express middleware * @param {Object} logger - a logger instance * @param {Object} options - * @param {String?} options.headerName + * @param {String?} options.reqIdHeader * @returns {Function} */ -export default function createRequestLogger(logger, options = { headerName: DEFAULT_HEADER_NAME }) { +export default function createRequestLogger(logger, { reqIdHeader = DEFAULT_HEADER_NAME } = {}) { /** * Request Logger Middleware @@ -22,13 +22,13 @@ * @returns {undefined} */ return function requestLoggerMiddleware(req, res, next) { - const id = req.get(options.headerName) || uuid.v4(); + const id = req.get(reqIdHeader) || uuid.v4(); let log = logger.child({ component: 'request', req_id: id, req }); // attach a logger to each request req.log = log; - res.setHeader(options.headerName, id); + res.setHeader(reqIdHeader, id); log.info('start request');
30d95d67c12157692037c015a41d18b352de5a89
packages/card-picker/addon/components/field-editors/cardstack-cards-editor.js
packages/card-picker/addon/components/field-editors/cardstack-cards-editor.js
import Component from '@ember/component'; import { inject as service } from '@ember/service'; import layout from '../../templates/components/field-editors/cardstack-cards-editor'; export default Component.extend({ tools: service('cardstack-card-picker'), layout, actions: { addCard() { this.tools.pickCard().then((card) => { this.get(`content.${this.get('field')}`).pushObject(card); }) }, orderChanged(rearrangedCards) { this.set(`content.${this.get('field')}`, rearrangedCards); }, deleteCard(card) { this.get(`content.${this.get('field')}`).removeObject(card); } } });
import Component from '@ember/component'; import { inject as service } from '@ember/service'; import { get, set } from '@ember/object'; import layout from '../../templates/components/field-editors/cardstack-cards-editor'; export default Component.extend({ tools: service('cardstack-card-picker'), layout, actions: { addCard() { let field = get(this, 'field'); let content = get(this, 'content'); this.tools.pickCard().then((card) => { content.watchRelationship(field, () => { get(content, field).pushObject(card); }); }) }, orderChanged(rearrangedCards) { let field = get(this, 'field'); let content = get(this, 'content'); content.watchRelationship(field, () => { set(content, field, rearrangedCards); }); }, deleteCard(card) { let field = get(this, 'field'); let content = get(this, 'content'); content.watchRelationship(field, () => { get(content, field).removeObject(card); }); } } });
Use ember-data-relationship-tracker in cards editor
Use ember-data-relationship-tracker in cards editor
JavaScript
mit
cardstack/cardstack,cardstack/cardstack,cardstack/cardstack,cardstack/cardstack,cardstack/cardstack,cardstack/cardstack
--- +++ @@ -1,5 +1,6 @@ import Component from '@ember/component'; import { inject as service } from '@ember/service'; +import { get, set } from '@ember/object'; import layout from '../../templates/components/field-editors/cardstack-cards-editor'; @@ -9,15 +10,32 @@ actions: { addCard() { + let field = get(this, 'field'); + let content = get(this, 'content'); + this.tools.pickCard().then((card) => { - this.get(`content.${this.get('field')}`).pushObject(card); + content.watchRelationship(field, () => { + get(content, field).pushObject(card); + }); }) }, + orderChanged(rearrangedCards) { - this.set(`content.${this.get('field')}`, rearrangedCards); + let field = get(this, 'field'); + let content = get(this, 'content'); + + content.watchRelationship(field, () => { + set(content, field, rearrangedCards); + }); }, + deleteCard(card) { - this.get(`content.${this.get('field')}`).removeObject(card); + let field = get(this, 'field'); + let content = get(this, 'content'); + + content.watchRelationship(field, () => { + get(content, field).removeObject(card); + }); } } });
9fe2c911f946bb05c6883405d24b7f61283f6aa4
app/index.js
app/index.js
'use strict'; var Generator = module.exports = function () { var cb = this.async(); var ignores = [ '.git', 'CHANGELOG.md', 'CONTRIBUTING.md', 'LICENSE.md', 'README.md' ]; this.prompt([{ name: 'docs', message: 'Would you like docs included?', default: 'y/N' }], function (err, props) { if (err) { return this.emit('error', err); } if (!/n/i.test(props.docs)) { this.directory('doc'); } this.directory('css'); this.directory('img'); this.directory('js'); this.expandFiles('*', { cwd: this.sourceRoot(), dot: true }).forEach(function (el) { if (/n/i.test(props.docs)) { if (ignores.indexOf(el) === -1) { this.copy(el, el); } } else { if (el !== '.git') { this.copy(el, el); } } }, this); cb(); }.bind(this)); }; Generator.name = 'HTML5 Boilerplate';
'use strict'; var Generator = module.exports = function () { var cb = this.async(); var ignores = [ '.git', 'CHANGELOG.md', 'CONTRIBUTING.md', 'LICENSE.md', 'README.md' ]; this.prompt([{ type: 'confirm', name: 'docs', message: 'Would you like docs included?' }], function (props) { if (props.docs) { this.directory('doc'); } this.directory('css'); this.directory('img'); this.directory('js'); this.expandFiles('*', { cwd: this.sourceRoot(), dot: true }).forEach(function (el) { if (props.docs) { if (ignores.indexOf(el) === -1) { this.copy(el, el); } } else { if (el !== '.git') { this.copy(el, el); } } }, this); cb(); }.bind(this)); }; Generator.name = 'HTML5 Boilerplate';
Prepare for new Yeoman Generator prompt()s.
Prepare for new Yeoman Generator prompt()s.
JavaScript
mit
h5bp/generator-h5bp
--- +++ @@ -11,15 +11,11 @@ ]; this.prompt([{ + type: 'confirm', name: 'docs', - message: 'Would you like docs included?', - default: 'y/N' - }], function (err, props) { - if (err) { - return this.emit('error', err); - } - - if (!/n/i.test(props.docs)) { + message: 'Would you like docs included?' + }], function (props) { + if (props.docs) { this.directory('doc'); } @@ -30,7 +26,7 @@ cwd: this.sourceRoot(), dot: true }).forEach(function (el) { - if (/n/i.test(props.docs)) { + if (props.docs) { if (ignores.indexOf(el) === -1) { this.copy(el, el); }
c632fde791d79cd58b010189a9995ef9917f0040
app/store.js
app/store.js
import { createStore, combineReducers } from 'redux' import Task from './reducers/Task' export default createStore( combineReducers( { Task } ) )
import { createStore, combineReducers } from 'redux' import Task from './reducers/Task' export default createStore( combineReducers( { tasks: Task } ) )
Rename the state from 'Task' to 'tasks'.
Rename the state from 'Task' to 'tasks'.
JavaScript
mit
rhberro/the-react-client,rhberro/the-react-client
--- +++ @@ -5,7 +5,7 @@ export default createStore( combineReducers( { - Task + tasks: Task } ) )
b4c8c52d3bd293c7067a5a9d16121aa34a4b855e
frontend/app/components/source-code.js
frontend/app/components/source-code.js
var LanguageMap = { "crystal": "ruby", "gcc": "c++" }; export default Ember.Component.extend({ highlightLanguage: function() { return LanguageMap[this.get('language')] || this.get('language'); }.property('language'), watchForChanges: function() { this.rerender(); }.observes('code'), didInsertElement: function() { var code = this.$('pre > code')[0]; code.innerHTML = window.ansi_up.ansi_to_html(code.innerHTML, {use_classes: true}); window.hljs.highlightBlock(this.$('pre > code')[0]); window.hljs.lineNumbersBlock(this.$('pre > code')[0]); } });
var LanguageMap = { "crystal": "ruby", "gcc": "c++" }; export default Ember.Component.extend({ highlightLanguage: function() { return LanguageMap[this.get('language')] || this.get('language'); }.property('language'), watchForChanges: function() { this.rerender(); }.observes('code'), didInsertElement: function() { var code = this.$('pre > code')[0]; code.innerHTML = window.ansi_up.ansi_to_html(code.innerHTML, {use_classes: true}); window.hljs.highlightBlock(this.$('pre > code')[0]); // window.hljs.lineNumbersBlock(this.$('pre > code')[0]); } });
Revert "Enable line numbers on result view"
Revert "Enable line numbers on result view" This reverts commit cba57c3ab39796c9ac007d4e26f9c4ad94aa7a3f. Still broken on FF
JavaScript
mit
jhass/carc.in,jhass/carc.in
--- +++ @@ -14,6 +14,6 @@ var code = this.$('pre > code')[0]; code.innerHTML = window.ansi_up.ansi_to_html(code.innerHTML, {use_classes: true}); window.hljs.highlightBlock(this.$('pre > code')[0]); - window.hljs.lineNumbersBlock(this.$('pre > code')[0]); + // window.hljs.lineNumbersBlock(this.$('pre > code')[0]); } });