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
10770a4da9bd0fdc611111152ea841232572fe89
src/pages/home/index.js
src/pages/home/index.js
import React from 'react' import Page from '../../components/page' import Header from './header' import PreviousEpisodeSection from './sections/previous-episodes' import EpisodesSection from './sections/episodes' import PanelistsSection from './sections/panelists' import SponsorsSection from '../../components/sponsors' import Footer from './sections/footer' import FeatureShowScript from './scripts/feature-show' export default Home function Home( { futureEpisodes = [], pastEpisodes = [], sponsors, panelists, } ) { return ( <Page> <Header /> <EpisodesSection episodes={futureEpisodes} /> <PanelistsSection panelists={panelists} /> <Footer /> <div className="container"> <SponsorsSection {...sponsors} /> <PreviousEpisodeSection episodes={pastEpisodes} /> <FeatureShowScript /> </div> </Page> ) }
import React from 'react' import Page from '../../components/page' import Header from './header' import PreviousEpisodeSection from './sections/previous-episodes' import EpisodesSection from './sections/episodes' import PanelistsSection from './sections/panelists' import SponsorsSection from '../../components/sponsors' import Footer from './sections/footer' import FeatureShowScript from './scripts/feature-show' export default Home function Home( { futureEpisodes = [], pastEpisodes = [], sponsors, panelists, } ) { return ( <Page> <Header /> <EpisodesSection episodes={futureEpisodes} /> <div className="container"> <PreviousEpisodeSection episodes={pastEpisodes} /> <SponsorsSection {...sponsors} /> </div> <PanelistsSection panelists={panelists} /> <Footer /> <FeatureShowScript /> </Page> ) }
Put sections in desired order
Put sections in desired order
JavaScript
mit
javascriptair/site,javascriptair/site,javascriptair/site
--- +++ @@ -25,17 +25,14 @@ <Header /> <EpisodesSection episodes={futureEpisodes} /> + <div className="container"> + <PreviousEpisodeSection episodes={pastEpisodes} /> + <SponsorsSection {...sponsors} /> + </div> <PanelistsSection panelists={panelists} /> <Footer /> - <div className="container"> - - <SponsorsSection {...sponsors} /> - - <PreviousEpisodeSection episodes={pastEpisodes} /> - - <FeatureShowScript /> - </div> + <FeatureShowScript /> </Page> ) }
457086edfb55377b1a7ec24bbfa95c47f076515d
test/test-queue-bind-callbacks-cascaded.js
test/test-queue-bind-callbacks-cascaded.js
require('./harness'); var testName = __filename.replace(__dirname+'/','').replace('.js',''); connection.addListener('ready', function () { puts("connected to " + connection.serverProperties.product); var callbacksCalled = 0; connection.exchange('node.'+testName+'.exchange', {type: 'topic'}, function(exchange) { connection.queue( 'node.'+testName+'.queue', { durable: false, autoDelete : true }, function (queue) { puts("Queue ready"); // main test for callback queue.bind(exchange, 'node.'+testName+'.topic.bindCallback1', function(q) { puts("First queue bind callback called"); callbacksCalled++; q.bind(exchange, 'node.'+testName+'.topic.bindCallback2', function() { puts("Second queue bind callback called"); callbacksCalled++; }); }); setTimeout(function() { assert.ok(callbacksCalled == 2, "Callback was not called"); puts("Cascaded queue bind callback succeeded"); connection.destroy();}, 2000); }); }); });
require('./harness'); var testName = __filename.replace(__dirname+'/','').replace('.js',''); connection.addListener('ready', function () { puts("connected to " + connection.serverProperties.product); var callbacksCalled = 0; connection.exchange('node.'+testName+'.exchange', {type: 'topic'}, function(exchange) { connection.queue( 'node.'+testName+'.queue', { durable: false, autoDelete : true }, function (queue) { puts("Queue ready"); // main test for callback queue.bind(exchange, 'node.'+testName+'.topic.bindCallback.outer', function(q) { puts("First queue bind callback called"); callbacksCalled++; q.bind(exchange, 'node.'+testName+'.topic.bindCallback.inner', function() { puts("Second queue bind callback called"); callbacksCalled++; }); }); setTimeout(function() { assert.ok(callbacksCalled == 2, "Callback was not called"); puts("Cascaded queue bind callback succeeded"); connection.destroy();}, 2000); }); }); });
Change the topic name used in the test
Change the topic name used in the test
JavaScript
mit
albert-lacki/node-amqp,xebitstudios/node-amqp,seanahn/node-amqp,zkochan/node-amqp,segmentio/node-amqp,zkochan/node-amqp,seanahn/node-amqp,hinson0/node-amqp,zinic/node-amqp,remind101/node-amqp,zkochan/node-amqp,postwait/node-amqp,zinic/node-amqp,albert-lacki/node-amqp,albert-lacki/node-amqp,segmentio/node-amqp,xebitstudios/node-amqp,postwait/node-amqp,hinson0/node-amqp,zinic/node-amqp,postwait/node-amqp,softek/node-amqp,softek/node-amqp,remind101/node-amqp,hinson0/node-amqp,remind101/node-amqp,xebitstudios/node-amqp
--- +++ @@ -10,10 +10,10 @@ puts("Queue ready"); // main test for callback - queue.bind(exchange, 'node.'+testName+'.topic.bindCallback1', function(q) { + queue.bind(exchange, 'node.'+testName+'.topic.bindCallback.outer', function(q) { puts("First queue bind callback called"); callbacksCalled++; - q.bind(exchange, 'node.'+testName+'.topic.bindCallback2', function() { + q.bind(exchange, 'node.'+testName+'.topic.bindCallback.inner', function() { puts("Second queue bind callback called"); callbacksCalled++; });
d1212e4c91e81118248499819fa2f2f614e85e3b
angular-blaze-template.js
angular-blaze-template.js
var angularMeteorTemplate = angular.module('angular-blaze-template', []); // blaze-template adds Blaze templates to Angular as directives angularMeteorTemplate.directive('blazeTemplate', [ '$compile', function ($compile) { return { restrict: 'AE', scope: false, link: function (scope, element, attributes) { // Check if templating and Blaze package exist, they won't exist in a // Meteor Client Side (https://github.com/idanwe/meteor-client-side) application if (Template && Package['blaze']){ var name = attributes.blazeTemplate || attributes.name; if (name && Template[name]) { var template = Template[name]; var viewHandler = Blaze.renderWithData(template, scope, element[0]); $compile(element.contents())(scope); var childs = element.children(); element.replaceWith(childs); scope.$on('$destroy', function() { Blaze.remove(viewHandler); }); } else { console.error("meteorTemplate: There is no template with the name '" + name + "'"); } } } }; } ]); var angularMeteorModule = angular.module('angular-meteor'); angularMeteorModule.requires.push('angular-blaze-template');
var angularMeteorTemplate = angular.module('angular-blaze-template', []); // blaze-template adds Blaze templates to Angular as directives angularMeteorTemplate.directive('blazeTemplate', [ '$compile', function ($compile) { return { restrict: 'AE', scope: false, link: function (scope, element, attributes) { // Check if templating and Blaze package exist, they won't exist in a // Meteor Client Side (https://github.com/idanwe/meteor-client-side) application if (Template && Package['blaze']){ var name = attributes.blazeTemplate || attributes.name; if (name && Template[name]) { var template = Template[name]; var viewHandler = Blaze.renderWithData(template, scope, element[0]); $compile(element.contents())(scope); element.find().unwrap(); scope.$on('$destroy', function() { Blaze.remove(viewHandler); }); } else { console.error("meteorTemplate: There is no template with the name '" + name + "'"); } } } }; } ]); var angularMeteorModule = angular.module('angular-meteor'); angularMeteorModule.requires.push('angular-blaze-template');
Fix bug where the included template was unattached from it's data
Fix bug where the included template was unattached from it's data
JavaScript
mit
Urigo/angular-blaze-template
--- +++ @@ -19,8 +19,7 @@ var viewHandler = Blaze.renderWithData(template, scope, element[0]); $compile(element.contents())(scope); - var childs = element.children(); - element.replaceWith(childs); + element.find().unwrap(); scope.$on('$destroy', function() { Blaze.remove(viewHandler);
a0dc7d268e2c839c301ceaa5364683f5eb3c27c7
src/reducers/counter.js
src/reducers/counter.js
import { INCREMENT_COUNTER, DECREMENT_COUNTER } from '../actions/counter' const counter = (state = 0, action) => { switch (action) { case INCREMENT_COUNTER: return state + 1 case DECREMENT_COUNTER: return state - 1 default: return state } } export default counter
import { INCREMENT_COUNTER, DECREMENT_COUNTER } from '../actions/counter' const counter = (state = 0, action) => { switch (action.type) { case INCREMENT_COUNTER: return state + 1 case DECREMENT_COUNTER: return state - 1 default: return state } } export default counter
Fix the reducer's switch statement
Fix the reducer's switch statement
JavaScript
mit
epicsharp/react-boilerplate,epicsharp/react-boilerplate,RSS-Dev/live-html,RSS-Dev/live-html
--- +++ @@ -1,7 +1,7 @@ import { INCREMENT_COUNTER, DECREMENT_COUNTER } from '../actions/counter' const counter = (state = 0, action) => { - switch (action) { + switch (action.type) { case INCREMENT_COUNTER: return state + 1 case DECREMENT_COUNTER:
c990ce53b69a564aa8d084b9a28c58a6f74d825a
javascripts/routes/application_route.js
javascripts/routes/application_route.js
var AuthManager = require('../config/auth_manager'); // The default Route class for the main view of ember app var ApplicationRoute = Ember.Route.extend({ // Init an new authmanager object init: function() { this._super(); App.AuthManager = AuthManager.create(); }, events: { // Unload all objects in ember memory logout: function() { // Redirect to login page and clear data store App.AuthManager.reset(); } } }); module.exports = ApplicationRoute;
var AuthManager = require('../config/auth_manager'); // The default Route class for the main view of ember app var ApplicationRoute = Ember.Route.extend({ // Init an new authmanager object init: function() { this._super(); App.AuthManager = AuthManager.create(); }, events: { // Unload all objects in ember memory logout: function() { $.ajax({url: '/api/v1/users/sign_out', type: "DELETE"}); // Redirect to login page and clear data store App.AuthManager.reset(); } } }); module.exports = ApplicationRoute;
Send a delete request during logout action
Send a delete request during logout action
JavaScript
mit
ricofehr/nextdeploy-webui,ricofehr/nextdeploy-webui
--- +++ @@ -11,6 +11,7 @@ events: { // Unload all objects in ember memory logout: function() { + $.ajax({url: '/api/v1/users/sign_out', type: "DELETE"}); // Redirect to login page and clear data store App.AuthManager.reset(); }
f2658e5c22022a57171445cdd72cf272b45f3010
scripts/buildexamples.js
scripts/buildexamples.js
var childProcess = require('child_process'); var fs = require('fs'); // Build all of the example folders. dirs = fs.readdirSync('examples'); for (var i = 0; i < dirs.length; i++) { process.chdir('examples/' + dirs[i]); childProcess.exec('npm run update && npm run build', function (error, stdout, stderr) { if (error) { console.log(error.stack); console.log('Error code: ' + error.code); console.log('Signal received: ' + error.signal); console.log('Child Process STDERR: ' + stderr); } console.log('Child Process STDOUT: ' + stdout); }); process.chdir('../..'); }
var childProcess = require('child_process'); var fs = require('fs'); // Build all of the example folders. dirs = fs.readdirSync('examples'); for (var i = 0; i < dirs.length; i++) { console.log('Building: ' + dirs[i] + '...'); process.chdir('examples/' + dirs[i]); childProcess.exec('npm run update && npm run build', function (error, stdout, stderr) { if (error) { console.log(error.stack); console.log('Error code: ' + error.code); console.log('Signal received: ' + error.signal); console.log('Child Process STDERR: ' + stderr); } console.log('Child Process STDOUT: ' + stdout); }); process.chdir('../..'); }
Add a console print during the build examples script
Add a console print during the build examples script
JavaScript
bsd-3-clause
TypeFox/jupyterlab,charnpreetsingh185/jupyterlab,jupyter/jupyterlab,charnpreetsingh185/jupyterlab,TypeFox/jupyterlab,jupyter/jupyter-js-ui,jupyter/jupyterlab,charnpreetsingh185/jupyterlab,TypeFox/jupyterlab,jupyter/jupyter-js-ui,TypeFox/jupyterlab,eskirk/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab,eskirk/jupyterlab,jupyter/jupyterlab,TypeFox/jupyterlab,eskirk/jupyterlab,eskirk/jupyterlab,charnpreetsingh185/jupyterlab,charnpreetsingh185/jupyterlab,jupyter/jupyter-js-ui,eskirk/jupyterlab
--- +++ @@ -5,6 +5,7 @@ dirs = fs.readdirSync('examples'); for (var i = 0; i < dirs.length; i++) { + console.log('Building: ' + dirs[i] + '...'); process.chdir('examples/' + dirs[i]); childProcess.exec('npm run update && npm run build', function (error, stdout, stderr) {
37b1d43498d4e60796a5b61550197cbc2a73f3f2
app/components/popular.js
app/components/popular.js
var React = require('react'); class Popular extends React.Component { constructor (props) { super(props); this.state = { selectedLanguage: 'All' }; this.updateLanguage = this.updateLanguage.bind(this); } updateLanguage(lang) { this.setState(function() { return { selectedLanguage: lang } }); } render() { var languages = ['All', 'JavaScript', 'Ruby', 'Java', 'CSS', 'Python']; return ( <ul className='languages'> <p>Selected Language: {this.state.selectedLanguage}</p> {languages.map(function (lang){ return ( <li style={lang === this.state.selectedLanguage ? { color: '#d0021b'}: null} onClick={this.updateLanguage.bind(null, lang)} key={lang}> {lang} </li> ) }, this)} </ul> ) } } module.exports = Popular;
var React = require('react'); var PropTypes = require('prop-types'); function SelectLanguage(props) { var languages = ['All', 'JavaScript', 'Ruby', 'Java', 'CSS', 'Python']; return ( <ul className='languages'> {languages.map(function (lang){ return ( <li style={lang === props.selectedLanguage ? { color: '#d0021b'}: null} onClick={props.onSelect.bind(null, lang)} key={lang}> {lang} </li> ) }, this)} </ul> ) } SelectLanguage.propTypes = { selectedLanguage: PropTypes.string.isRequired, onSelect: PropTypes.func.isRequired, } class Popular extends React.Component { constructor (props) { super(props); this.state = { selectedLanguage: 'All' }; this.updateLanguage = this.updateLanguage.bind(this); } updateLanguage(lang) { this.setState(function() { return { selectedLanguage: lang } }); } render() { return ( <div> <SelectLanguage selectedLanguage={this.state.selectedLanguage} onSelect={this.updateLanguage} /> </div> ) } } module.exports = Popular;
Add first stateless function component
Add first stateless function component
JavaScript
mit
brianmmcgrath/react-github-battle,brianmmcgrath/react-github-battle
--- +++ @@ -1,4 +1,28 @@ var React = require('react'); +var PropTypes = require('prop-types'); + +function SelectLanguage(props) { + var languages = ['All', 'JavaScript', 'Ruby', 'Java', 'CSS', 'Python']; + return ( + <ul className='languages'> + {languages.map(function (lang){ + return ( + <li + style={lang === props.selectedLanguage ? { color: '#d0021b'}: null} + onClick={props.onSelect.bind(null, lang)} + key={lang}> + {lang} + </li> + ) + }, this)} + </ul> + ) +} + +SelectLanguage.propTypes = { + selectedLanguage: PropTypes.string.isRequired, + onSelect: PropTypes.func.isRequired, +} class Popular extends React.Component { constructor (props) { @@ -19,21 +43,13 @@ } render() { - var languages = ['All', 'JavaScript', 'Ruby', 'Java', 'CSS', 'Python']; return ( - <ul className='languages'> - <p>Selected Language: {this.state.selectedLanguage}</p> - {languages.map(function (lang){ - return ( - <li - style={lang === this.state.selectedLanguage ? { color: '#d0021b'}: null} - onClick={this.updateLanguage.bind(null, lang)} - key={lang}> - {lang} - </li> - ) - }, this)} - </ul> + <div> + <SelectLanguage + selectedLanguage={this.state.selectedLanguage} + onSelect={this.updateLanguage} + /> + </div> ) } }
77d0c1a8184e9152727874831eb45c17417f80f0
app/controllers/signin.js
app/controllers/signin.js
import Ember from 'ember'; import { task } from 'ember-concurrency'; const { get, computed, isPresent } = Ember; export default Ember.Controller.extend({ flashMessages: Ember.inject.service(), userEmail: '', userPassword: '', resetController() { this.set('userEmail', ''); this.set('userPassword', ''); }, canSubmit: computed('userEmail', 'userPassword', function() { return isPresent(this.get('userEmail')) && isPresent(this.get('userPassword')); }), signIn: task(function *(email, password) { const flashMessages = get(this, 'flashMessages'); yield this.get('session').open('firebase', { provider: 'password', email: email, password: password }).then((data) => { console.log('Signed in as ', data.currentUser); this.transitionTo('application'); }).catch(() => { flashMessages.danger('Incorrect email and password. Try again.', { preventDuplicates: true }); }); }).drop() });
import Ember from 'ember'; import { task } from 'ember-concurrency'; const { get, computed, isPresent } = Ember; export default Ember.Controller.extend({ flashMessages: Ember.inject.service(), userEmail: '', userPassword: '', resetController() { this.set('userEmail', ''); this.set('userPassword', ''); }, canSubmit: computed('userEmail', 'userPassword', function() { return isPresent(this.get('userEmail')) && isPresent(this.get('userPassword')); }), signIn: task(function *(email, password) { const flashMessages = get(this, 'flashMessages'); yield this.get('session').open('firebase', { provider: 'password', email: email, password: password }).then((data) => { console.log('Signed in as ', data.currentUser); this.transitionToRoute('application'); }).catch(() => { flashMessages.danger('Incorrect email and password. Try again.', { preventDuplicates: true }); }); }).drop() });
Change to `transitionTo` to `transitionToRoute`
Change to `transitionTo` to `transitionToRoute`
JavaScript
mit
ddoria921/Notes,ddoria921/Notes
--- +++ @@ -31,7 +31,7 @@ password: password }).then((data) => { console.log('Signed in as ', data.currentUser); - this.transitionTo('application'); + this.transitionToRoute('application'); }).catch(() => { flashMessages.danger('Incorrect email and password. Try again.', { preventDuplicates: true
6932ee3d190b1fe7d1fc58114e2d847c929b815d
src/scripts/composition/bars.js
src/scripts/composition/bars.js
'use strict'; // External import * as d3 from 'd3'; // Internal import Bar from './bar'; import * as config from './config'; const BARS_CLASS = 'bars'; class Bars { constructor (selection, visData) { let that = this; this.visData = visData; this.selection = selection.append('g') .attr('class', BARS_CLASS); this.selection.each(function (datum) { new Bar(d3.select(this), datum.data.bars, datum, that.visData); }); } update (selection, sortBy) { let actualBars = selection .classed('active', true) .selectAll('.bar-magnitude'); selection.each(data => { // this.bar }); actualBars .transition() .duration(config.TRANSITION_SEMI_FAST) .attr('d', data => { return Bar.generatePath(data, sortBy, this.visData); }); } inactivate (selection) { } } export default Bars;
'use strict'; // External import * as d3 from 'd3'; // Internal import Bar from './bar'; import * as config from './config'; const BARS_CLASS = 'bars'; class Bars { constructor (selection, visData) { let that = this; this.visData = visData; this.selection = selection.append('g') .attr('class', BARS_CLASS); this.selection.each(function (datum) { new Bar(d3.select(this), datum.data.bars, datum, that.visData); }); } update (selection, sortBy) { selection.each(function () { let el = d3.select(this); if (el.classed('active')) { el.classed('active', false); } else { el.classed('active', false); // Ensure that the active bars we are places before any other bar, // thus placing them in the background this.parentNode.insertBefore( this, d3.select(this.parentNode).select('.bar').node() ); } }); selection.selectAll('.bar-magnitude') .transition() .duration(config.TRANSITION_SEMI_FAST) .attr('d', data => { return Bar.generatePath(data, sortBy, this.visData); }); } inactivate (selection) { } } export default Bars;
Sort bar elements properly to make sure that they are always visible.
Sort bar elements properly to make sure that they are always visible.
JavaScript
mit
flekschas/d3-list-graph,flekschas/d3-list-graph
--- +++ @@ -24,15 +24,23 @@ } update (selection, sortBy) { - let actualBars = selection - .classed('active', true) - .selectAll('.bar-magnitude'); + selection.each(function () { + let el = d3.select(this); - selection.each(data => { - // this.bar + if (el.classed('active')) { + el.classed('active', false); + } else { + el.classed('active', false); + // Ensure that the active bars we are places before any other bar, + // thus placing them in the background + this.parentNode.insertBefore( + this, + d3.select(this.parentNode).select('.bar').node() + ); + } }); - actualBars + selection.selectAll('.bar-magnitude') .transition() .duration(config.TRANSITION_SEMI_FAST) .attr('d', data => {
e3ec6236f25af3fbe01a3e480da7ebf975727c09
src/scripts/content/assembla.js
src/scripts/content/assembla.js
/*jslint indent: 2, unparam: true*/ /*global $: false, document: false, togglbutton: false, createTag: false*/ 'use strict'; togglbutton.render('#tickets-show:not(.toggl)', {observe: true}, function (elem) { var link, container = createTag('li', 'toggle-container'), description = $('span.ticket-number', elem).textContent + ' ' + $('.ticket-summary > h1').textContent, project = $('h1.header-w > span').textContent; link = togglbutton.createTimerLink({ className: 'assembla', description: description, projectName: project, }); container.appendChild(link); $('ul.menu-submenu').appendChild(container); });
/*jslint indent: 2, unparam: true*/ /*global $: false, document: false, togglbutton: false, createTag: false*/ 'use strict'; togglbutton.render('#tickets-show:not(.toggl)', {observe: true}, function (elem) { var link, container = createTag('li', 'toggle-container'), description = $('span.ticket-number', elem).textContent + ' ' + $('.ticket-summary > h1').textContent .replace("Copied!Copy to clipboard", ''), project = $('h1.header-w > span').textContent; link = togglbutton.createTimerLink({ className: 'assembla', description: description, projectName: project, }); container.appendChild(link); $('ul.menu-submenu').appendChild(container); });
Remove copy-to-clipboard text in title.
Remove copy-to-clipboard text in title.
JavaScript
bsd-3-clause
eatskolnikov/toggl-button,andreimoldo/toggl-button,eatskolnikov/toggl-button,glensc/toggl-button,bitbull-team/toggl-button,andreimoldo/toggl-button,kretel/toggl-button,kretel/toggl-button,topdown/toggl-button,glensc/toggl-button,topdown/toggl-button,zbruh/blackboard-toggl,glensc/toggl-button,cuttlesoft/toggl-button,cuttlesoft/toggl-button,bitbull-team/toggl-button,zbruh/blackboard-toggl
--- +++ @@ -6,7 +6,8 @@ var link, container = createTag('li', 'toggle-container'), - description = $('span.ticket-number', elem).textContent + ' ' + $('.ticket-summary > h1').textContent, + description = $('span.ticket-number', elem).textContent + ' ' + $('.ticket-summary > h1').textContent + .replace("Copied!Copy to clipboard", ''), project = $('h1.header-w > span').textContent; link = togglbutton.createTimerLink({
26b426c8d4e4319234209a317776a5257100f683
lib/playlist.js
lib/playlist.js
var abc = require('./converters/abc'), fs = require('fs'), p = require('path'), spl = require('./converters/spl'), converters = { abc: abc, spl: spl }; function Playlist() { this.songs = []; } Playlist.prototype.load = function (dir) { var files = fs.readdirSync(dir), self = this; files.forEach(function (file) { console.log('Converting %s', file); var type = p.extname(file).replace(/^\./, ''), data = fs.readFileSync(p.join(dir, file)).toString(); if (converters[type]) { var song = converters[type].convert(data) self.songs.push(song); } else { console.error('Unable to convert %s', file); } }); }; Playlist.prototype.getSong = function (trackNumber) { return this.songs[trackNumber - 1]; }; module.exports = Playlist;
var abc = require('./converters/abc'), fs = require('fs'), p = require('path'), converters = { abc: abc }; function Playlist() { this.songs = []; } Playlist.prototype.load = function (dir) { var files = fs.readdirSync(dir), self = this; files.forEach(function (file) { console.log('Converting %s', file); var type = p.extname(file).replace(/^\./, ''), data = fs.readFileSync(p.join(dir, file)).toString(); if (converters[type]) { var song = converters[type].convert(data) self.songs.push(song); } else { console.error('Unable to convert %s', file); } }); }; Playlist.prototype.getSong = function (trackNumber) { return this.songs[trackNumber - 1]; }; module.exports = Playlist;
Remove spl converter, was only an experiment with Gangnam Style.
Remove spl converter, was only an experiment with Gangnam Style.
JavaScript
mit
cliffano/roombox
--- +++ @@ -1,8 +1,7 @@ var abc = require('./converters/abc'), fs = require('fs'), p = require('path'), - spl = require('./converters/spl'), - converters = { abc: abc, spl: spl }; + converters = { abc: abc }; function Playlist() { this.songs = [];
d5b645b641b0915b80681f75b1c19fa83397b678
Resources/ui/HeaderViewTalk.js
Resources/ui/HeaderViewTalk.js
var HeaderViewTalk = function(dict) { var obj = dict.obj || {}; var UI = require("/lib/UI/UI"); var i18n = require("/lib/i18n/Remote"); var self = UI.createView({ height: Ti.UI.SIZE }); self.add( UI.createLabel({ font: { fontSize: 18, fontWeight: "bold" }, height: Ti.UI.SIZE, left: 15, right: 15, text: i18n.getValue(obj.name), top: 20 }) ); return self; }; module.exports = HeaderViewTalk;
var HeaderViewTalk = function(dict) { var obj = dict.obj || {}; var UI = require("/lib/UI/UI"); var i18n = require("/lib/i18n/Remote"); var TiDate = require("/lib/TiDate/TiDate"); var self = UI.createView({ height: Ti.UI.SIZE, layout: "vertical" }); self.add( UI.createLabel({ font: { fontSize: 18, fontWeight: "bold" }, height: Ti.UI.SIZE, left: 15, right: 15, text: i18n.getValue(obj.name), top: 20 }) ); self.add( UI.createLabel({ color: "#666", font: { fontSize: 15 }, height: Ti.UI.SIZE, left: 15, right: 15, text: TiDate.getDateFormattedWithoutYear(obj.startAt) + " - " + TiDate.getHours(obj.startAt), top: 20 }) ); return self; }; module.exports = HeaderViewTalk;
Add Talk Time to details
Add Talk Time to details
JavaScript
apache-2.0
rafaelks/BrazilJS
--- +++ @@ -3,9 +3,11 @@ var UI = require("/lib/UI/UI"); var i18n = require("/lib/i18n/Remote"); + var TiDate = require("/lib/TiDate/TiDate"); var self = UI.createView({ - height: Ti.UI.SIZE + height: Ti.UI.SIZE, + layout: "vertical" }); self.add( UI.createLabel({ @@ -17,6 +19,16 @@ top: 20 }) ); + self.add( UI.createLabel({ + color: "#666", + font: { fontSize: 15 }, + height: Ti.UI.SIZE, + left: 15, + right: 15, + text: TiDate.getDateFormattedWithoutYear(obj.startAt) + " - " + TiDate.getHours(obj.startAt), + top: 20 + }) ); + return self; };
9309b70caa84bab66cee111a8e2ab556656ca6f9
lib/schemeIO.js
lib/schemeIO.js
(function (modFactory) { if (typeof module === 'object' && module.exports) { module.exports = modFactory(require('./scheme'), require('./parseScheme')); } else if (typeof define === "function" && define.amd) { define(['./parser', './parseScheme'], modFactory); } else { throw new Error('Use a module loader!'); } }(function (s, parseScheme) { function printMixin (env, fn) { env.print = new s.SchemePrimativeFunction(function (val) { fn(val.toString()); return val; }); } function loadMixin (env, fn) { env.load = new s.SchemePrimativeFunction(function (filename) { if (!(filename instanceof s.SchemeString)) { throw new s.SchemeError('Expecting ' + s.SchemeString.typeName() + '. ' + 'Found ' + filename.toString()); } var content = fn(filename.val), expressions = parseScheme.many(content); return expressions .get('matched') .each(function (expr) { expr.eval(env); }) .then(function () { return new s.SchemeBool(true); }); }); } return { printMixin: printMixin, loadMixin: loadMixin }; }));
(function (modFactory) { if (typeof module === 'object' && module.exports) { module.exports = modFactory(require('./scheme'), require('./parseScheme')); } else if (typeof define === "function" && define.amd) { define(['./parser', './parseScheme'], modFactory); } else { throw new Error('Use a module loader!'); } }(function (s, parseScheme) { function printMixin (env, fn) { env.print = new s.SchemePrimativeFunction(function (val) { fn(val.toString()); return val; }); } function loadMixin (env, fn) { env.load = new s.SchemePrimativeFunction(function (filename) { var content, expressions; if (fn.length > 0) { if (!(filename instanceof s.SchemeString)) { throw new s.SchemeError('Expecting ' + s.SchemeString.typeName() + '. ' + 'Found ' + (filename ? filename.toString() : 'Nothing')); } content = fn(filename.val); } else { content = fn(); } expressions = parseScheme.many(content); return expressions .get('matched') .each(function (expr) { expr.eval(env); }) .then(function () { return new s.SchemeBool(true); }); }); } return { printMixin: printMixin, loadMixin: loadMixin }; }));
Allow load mixin function to have no args
Allow load mixin function to have no args
JavaScript
mit
ljwall/tinyJSScheme
--- +++ @@ -17,13 +17,19 @@ function loadMixin (env, fn) { env.load = new s.SchemePrimativeFunction(function (filename) { - if (!(filename instanceof s.SchemeString)) { - throw new s.SchemeError('Expecting ' + s.SchemeString.typeName() + '. ' + - 'Found ' + filename.toString()); + var content, expressions; + + if (fn.length > 0) { + if (!(filename instanceof s.SchemeString)) { + throw new s.SchemeError('Expecting ' + s.SchemeString.typeName() + '. ' + + 'Found ' + (filename ? filename.toString() : 'Nothing')); + } + content = fn(filename.val); + } else { + content = fn(); } - var content = fn(filename.val), - expressions = parseScheme.many(content); + expressions = parseScheme.many(content); return expressions .get('matched')
dac36ace4766991bef06e09eb30f9af88d26ce10
lib/core/src/server/common/polyfills.js
lib/core/src/server/common/polyfills.js
import 'regenerator-runtime/runtime'; import 'airbnb-js-shims';
import 'regenerator-runtime/runtime'; import 'airbnb-js-shims'; import 'core-js/fn/symbol';
Load Symbol polyfill before any other code
Load Symbol polyfill before any other code
JavaScript
mit
kadirahq/react-storybook,storybooks/react-storybook,kadirahq/react-storybook,storybooks/storybook,storybooks/storybook,storybooks/storybook,storybooks/react-storybook,storybooks/storybook,storybooks/storybook,storybooks/react-storybook,storybooks/storybook,storybooks/storybook,storybooks/react-storybook
--- +++ @@ -1,2 +1,3 @@ import 'regenerator-runtime/runtime'; import 'airbnb-js-shims'; +import 'core-js/fn/symbol';
34880ddb1ab9da3b644995ed996615804fa7f0fa
gulp/config.js
gulp/config.js
module.exports = { browserSync: { server: { // Serve up our build folder baseDir: './examples/dist' } }, browserify: { // A separate bundle will be generated for each // bundle config in the list below bundleConfigs: [{ entries: './examples/01/index.js', dest: './examples/dist/js/01', outputName: 'index.js', // list of externally available modules to exclude from the bundle external: [] }] } };
module.exports = { browserSync: { server: { // Serve up our build folder baseDir: './examples/dist' } }, browserify: { // A separate bundle will be generated for each // bundle config in the list below bundleConfigs: [{ entries: './examples/00/index.js', dest: './examples/dist/js/00', outputName: 'index.js', external: [] }, { entries: './examples/01/index.js', dest: './examples/dist/js/01', outputName: 'index.js', external: [] }] } };
Add example 0 to build process.
Add example 0 to build process.
JavaScript
mit
doggan/compojs,doggan/compojs
--- +++ @@ -9,10 +9,14 @@ // A separate bundle will be generated for each // bundle config in the list below bundleConfigs: [{ + entries: './examples/00/index.js', + dest: './examples/dist/js/00', + outputName: 'index.js', + external: [] + }, { entries: './examples/01/index.js', dest: './examples/dist/js/01', outputName: 'index.js', - // list of externally available modules to exclude from the bundle external: [] }] }
76e14669bd0eb5672b843d96ddaa4e9de0e9da3d
public/javascript/youtube.js
public/javascript/youtube.js
PostStreamLinkYoutube = { autoplay: 1, width: '400', height: '300', color: "#FFFFFF", play: function(video_key, id) { // remove any videos that are playing $$('.post_stream_video').each(function(layer) { layer.update(); layer.hide(); }); // display the video thumbnails $$('.post_stream_thumbnail').invoke('show'); $('post_stream_thumbnail_' + id).hide(); layer_id = "post_stream_video_" + id container_id = "youtube_video_" + id $(layer_id).show(); $(layer_id).insert( '<div id="' + container_id + '"></div>' ); swfobject.embedSWF(PostStreamLinkYoutube.youtubeVideoUrl(video_key), container_id, PostStreamLinkYoutube.width, PostStreamLinkYoutube.height, '8', '/javascripts/swfobject/plugins/expressInstall.swf', {}, {wmode: 'transparent', quality: 'hight'}, {style: 'outline : none'}, false); }, youtubeVideoUrl: function(video_key) { return "http://www.youtube.com/v/" + video_key + "&rel=0&autoplay=" + PostStreamLinkYoutube.autoplay; } }
PostStreamLinkYoutube = { autoplay: 1, width: '340', height: '260', color: "#FFFFFF", play: function(video_key, id) { // remove any videos that are playing $$('.post_stream_video').each(function(layer) { layer.update(); layer.hide(); }); // display the video thumbnails $$('.post_stream_thumbnail').invoke('show'); $('post_stream_thumbnail_' + id).hide(); layer_id = "post_stream_video_" + id container_id = "youtube_video_" + id $(layer_id).show(); $(layer_id).insert( '<div id="' + container_id + '"></div>' ); swfobject.embedSWF(PostStreamLinkYoutube.youtubeVideoUrl(video_key), container_id, PostStreamLinkYoutube.width, PostStreamLinkYoutube.height, '8', '/javascripts/swfobject/plugins/expressInstall.swf', {}, {wmode: 'transparent', quality: 'hight'}, {style: 'outline : none'}, false); }, youtubeVideoUrl: function(video_key) { return "http://www.youtube.com/v/" + video_key + "&rel=0&autoplay=" + PostStreamLinkYoutube.autoplay; } }
Use 340x260 For displaying the YouTube player.
Use 340x260 For displaying the YouTube player.
JavaScript
agpl-3.0
cykod/Webiva-post_stream,cykod/Webiva-post_stream
--- +++ @@ -1,8 +1,8 @@ PostStreamLinkYoutube = { autoplay: 1, - width: '400', - height: '300', + width: '340', + height: '260', color: "#FFFFFF", play: function(video_key, id) {
05c89b84fe2261be535fdb7566fb5932f5373d87
assets/js/googlesitekit-data.js
assets/js/googlesitekit-data.js
/** * External dependencies */ /** * Internal dependencies */ import SiteKitRegistry from 'assets/js/googlesitekit/data'; if ( typeof global.googlesitekit === 'undefined' ) { global.googlesitekit = {}; } if ( typeof global.googlesitekit.data === 'undefined' ) { global.googlesitekit.data = SiteKitRegistry; } // This is only exported for Jest and is not used in production. export default SiteKitRegistry;
/** * External dependencies */ /** * Internal dependencies */ import Data from 'assets/js/googlesitekit/data'; if ( typeof global.googlesitekit === 'undefined' ) { global.googlesitekit = {}; } if ( typeof global.googlesitekit.data === 'undefined' ) { global.googlesitekit.data = Data; } // This is only exported for Jest and is not used in production. export default Data;
Update variable name for consistency.
Update variable name for consistency.
JavaScript
apache-2.0
google/site-kit-wp,google/site-kit-wp,google/site-kit-wp,google/site-kit-wp
--- +++ @@ -5,15 +5,15 @@ /** * Internal dependencies */ -import SiteKitRegistry from 'assets/js/googlesitekit/data'; +import Data from 'assets/js/googlesitekit/data'; if ( typeof global.googlesitekit === 'undefined' ) { global.googlesitekit = {}; } if ( typeof global.googlesitekit.data === 'undefined' ) { - global.googlesitekit.data = SiteKitRegistry; + global.googlesitekit.data = Data; } // This is only exported for Jest and is not used in production. -export default SiteKitRegistry; +export default Data;
b1a59cd1f45b50ec0358f1c06592258253bac216
app/templates/src/main/webapp/scripts/app/admin/configuration/_configuration.controller.js
app/templates/src/main/webapp/scripts/app/admin/configuration/_configuration.controller.js
'use strict'; angular.module('<%=angularAppName%>') .config(function ($stateProvider) { $stateProvider .state('configuration', { parent: 'admin', url: '/configuration', data: { roles: ['ROLE_ADMIN'] }, views: { 'content@': { templateUrl: 'scripts/app/admin/configuration/configuration.html', controller: 'ConfigurationController' } }, resolve: { translatePartialLoader: ['$translate', '$translatePartialLoader', function ($translate, $translatePartialLoader) { $translatePartialLoader.addPart('configuration'); return $translate.refresh(); }] } }); }) .controller('ConfigurationController', function ($scope, ConfigurationService) { $scope.configuration = ConfigurationService.get(); });
'use strict'; angular.module('<%=angularAppName%>') .config(function ($stateProvider) { $stateProvider .state('configuration', { parent: 'admin', url: '/configuration', data: { roles: ['ROLE_ADMIN'] }, views: { 'content@': { templateUrl: 'scripts/app/admin/configuration/configuration.html', controller: 'ConfigurationController' } }, resolve: { translatePartialLoader: ['$translate', '$translatePartialLoader', function ($translate, $translatePartialLoader) { $translatePartialLoader.addPart('configuration'); return $translate.refresh(); }] } }); }) .controller('ConfigurationController', function ($scope, ConfigurationService) { ConfigurationService.get().then(function(configuration) { $scope.configuration = configuration; }); });
Fix - Configuration is not displayed
Fix - Configuration is not displayed
JavaScript
apache-2.0
pascalgrimaud/generator-jhipster,jkutner/generator-jhipster,vivekmore/generator-jhipster,erikkemperman/generator-jhipster,gmarziou/generator-jhipster,sohibegit/generator-jhipster,jhipster/generator-jhipster,Tcharl/generator-jhipster,hdurix/generator-jhipster,duderoot/generator-jhipster,mraible/generator-jhipster,jkutner/generator-jhipster,erikkemperman/generator-jhipster,wmarques/generator-jhipster,PierreBesson/generator-jhipster,maniacneron/generator-jhipster,hdurix/generator-jhipster,sendilkumarn/generator-jhipster,JulienMrgrd/generator-jhipster,rifatdover/generator-jhipster,rkohel/generator-jhipster,PierreBesson/generator-jhipster,eosimosu/generator-jhipster,wmarques/generator-jhipster,ziogiugno/generator-jhipster,danielpetisme/generator-jhipster,sohibegit/generator-jhipster,gmarziou/generator-jhipster,ctamisier/generator-jhipster,ruddell/generator-jhipster,sendilkumarn/generator-jhipster,ctamisier/generator-jhipster,danielpetisme/generator-jhipster,ctamisier/generator-jhipster,vivekmore/generator-jhipster,liseri/generator-jhipster,pascalgrimaud/generator-jhipster,dalbelap/generator-jhipster,gmarziou/generator-jhipster,lrkwz/generator-jhipster,liseri/generator-jhipster,sohibegit/generator-jhipster,robertmilowski/generator-jhipster,stevehouel/generator-jhipster,rifatdover/generator-jhipster,yongli82/generator-jhipster,nkolosnjaji/generator-jhipster,rkohel/generator-jhipster,gzsombor/generator-jhipster,dynamicguy/generator-jhipster,liseri/generator-jhipster,ctamisier/generator-jhipster,gzsombor/generator-jhipster,ziogiugno/generator-jhipster,ctamisier/generator-jhipster,cbornet/generator-jhipster,siliconharborlabs/generator-jhipster,baskeboler/generator-jhipster,dimeros/generator-jhipster,baskeboler/generator-jhipster,ziogiugno/generator-jhipster,pascalgrimaud/generator-jhipster,ruddell/generator-jhipster,mosoft521/generator-jhipster,mosoft521/generator-jhipster,danielpetisme/generator-jhipster,JulienMrgrd/generator-jhipster,mosoft521/generator-jhipster,danielpetisme/generator-jhipster,robertmilowski/generator-jhipster,stevehouel/generator-jhipster,jkutner/generator-jhipster,JulienMrgrd/generator-jhipster,vivekmore/generator-jhipster,liseri/generator-jhipster,stevehouel/generator-jhipster,ziogiugno/generator-jhipster,deepu105/generator-jhipster,cbornet/generator-jhipster,erikkemperman/generator-jhipster,gzsombor/generator-jhipster,xetys/generator-jhipster,jhipster/generator-jhipster,eosimosu/generator-jhipster,mraible/generator-jhipster,pascalgrimaud/generator-jhipster,siliconharborlabs/generator-jhipster,atomfrede/generator-jhipster,hdurix/generator-jhipster,wmarques/generator-jhipster,siliconharborlabs/generator-jhipster,gzsombor/generator-jhipster,maniacneron/generator-jhipster,gmarziou/generator-jhipster,deepu105/generator-jhipster,duderoot/generator-jhipster,siliconharborlabs/generator-jhipster,eosimosu/generator-jhipster,lrkwz/generator-jhipster,deepu105/generator-jhipster,Tcharl/generator-jhipster,ruddell/generator-jhipster,vivekmore/generator-jhipster,atomfrede/generator-jhipster,Tcharl/generator-jhipster,PierreBesson/generator-jhipster,duderoot/generator-jhipster,nkolosnjaji/generator-jhipster,robertmilowski/generator-jhipster,nkolosnjaji/generator-jhipster,JulienMrgrd/generator-jhipster,ramzimaalej/generator-jhipster,dynamicguy/generator-jhipster,wmarques/generator-jhipster,sohibegit/generator-jhipster,dynamicguy/generator-jhipster,atomfrede/generator-jhipster,dimeros/generator-jhipster,mraible/generator-jhipster,nkolosnjaji/generator-jhipster,ziogiugno/generator-jhipster,cbornet/generator-jhipster,eosimosu/generator-jhipster,deepu105/generator-jhipster,maniacneron/generator-jhipster,atomfrede/generator-jhipster,mosoft521/generator-jhipster,dalbelap/generator-jhipster,cbornet/generator-jhipster,eosimosu/generator-jhipster,ramzimaalej/generator-jhipster,ramzimaalej/generator-jhipster,dimeros/generator-jhipster,baskeboler/generator-jhipster,liseri/generator-jhipster,nkolosnjaji/generator-jhipster,maniacneron/generator-jhipster,yongli82/generator-jhipster,Tcharl/generator-jhipster,yongli82/generator-jhipster,yongli82/generator-jhipster,stevehouel/generator-jhipster,erikkemperman/generator-jhipster,ruddell/generator-jhipster,rkohel/generator-jhipster,rifatdover/generator-jhipster,dalbelap/generator-jhipster,mosoft521/generator-jhipster,danielpetisme/generator-jhipster,xetys/generator-jhipster,rkohel/generator-jhipster,lrkwz/generator-jhipster,PierreBesson/generator-jhipster,mraible/generator-jhipster,robertmilowski/generator-jhipster,jhipster/generator-jhipster,sendilkumarn/generator-jhipster,baskeboler/generator-jhipster,pascalgrimaud/generator-jhipster,duderoot/generator-jhipster,Tcharl/generator-jhipster,xetys/generator-jhipster,lrkwz/generator-jhipster,vivekmore/generator-jhipster,jhipster/generator-jhipster,baskeboler/generator-jhipster,deepu105/generator-jhipster,jkutner/generator-jhipster,dalbelap/generator-jhipster,JulienMrgrd/generator-jhipster,mraible/generator-jhipster,erikkemperman/generator-jhipster,hdurix/generator-jhipster,sohibegit/generator-jhipster,duderoot/generator-jhipster,stevehouel/generator-jhipster,lrkwz/generator-jhipster,maniacneron/generator-jhipster,cbornet/generator-jhipster,robertmilowski/generator-jhipster,rkohel/generator-jhipster,gzsombor/generator-jhipster,jkutner/generator-jhipster,jhipster/generator-jhipster,dimeros/generator-jhipster,PierreBesson/generator-jhipster,dalbelap/generator-jhipster,sendilkumarn/generator-jhipster,wmarques/generator-jhipster,sendilkumarn/generator-jhipster,atomfrede/generator-jhipster,gmarziou/generator-jhipster,siliconharborlabs/generator-jhipster,hdurix/generator-jhipster,dynamicguy/generator-jhipster,xetys/generator-jhipster,ruddell/generator-jhipster,dimeros/generator-jhipster,yongli82/generator-jhipster
--- +++ @@ -24,5 +24,7 @@ }); }) .controller('ConfigurationController', function ($scope, ConfigurationService) { - $scope.configuration = ConfigurationService.get(); + ConfigurationService.get().then(function(configuration) { + $scope.configuration = configuration; + }); });
2731c84d773ecba53f60129f9df3ce7c452f91f4
test/specs/rules/require-line-feed-at-file-end.js
test/specs/rules/require-line-feed-at-file-end.js
var Checker = require('../../../lib/checker'); var assert = require('assert'); describe('rules/require-line-feed-at-file-end', function() { var checker; beforeEach(function() { checker = new Checker(); checker.registerDefaultRules(); }); it('should report no line feed at file end', function() { checker.configure({ requireLineFeedAtFileEnd: true }); assert(checker.checkString('var x;').getErrorCount() === 1); }); it('should report no line feed at file end if end with comment', function() { checker.configure({ requireLineFeedAtFileEnd: true }); assert(checker.checkString('var x;\n//foo').getErrorCount() === 1); }); it('should not report existing line feed at file end', function() { checker.configure({ requireLineFeedAtFileEnd: true }); assert(checker.checkString('var x;\n').isEmpty()); }); it('should not report existing line feed at file end with preceeding comment', function() { checker.configure({ requireLineFeedAtFileEnd: true }); assert(checker.checkString('var x;\n//foo\n').isEmpty()); }); });
var Checker = require('../../../lib/checker'); var assert = require('assert'); describe('rules/require-line-feed-at-file-end', function() { var checker; beforeEach(function() { checker = new Checker(); checker.registerDefaultRules(); checker.configure({ requireLineFeedAtFileEnd: true }); }); it('should report no line feed at file end', function() { assert(checker.checkString('var x;').getErrorCount() === 1); }); it('should report no line feed at file end if end with comment', function() { assert(checker.checkString('var x;\n//foo').getErrorCount() === 1); }); it('should not report existing line feed at file end', function() { assert(checker.checkString('var x;\n').isEmpty()); }); it('should not report existing line feed at file end with preceeding comment', function() { assert(checker.checkString('var x;\n//foo\n').isEmpty()); }); it('should report on an IIFE with no line feed at EOF', function() { assert.equal(checker.checkString('(function() {\nconsole.log(\'Hello World\');\n})();').getErrorCount(), 1); }); });
Test to ensure IIFE case still reports
requireLineFeedAtFileEnd: Test to ensure IIFE case still reports Ref #1568
JavaScript
mit
existentialism/node-jscs,hzoo/node-jscs,hafeez-syed/node-jscs,indexzero/node-jscs,jscs-dev/node-jscs,bjdixon/node-jscs,pm5/node-jscs,jamesreggio/node-jscs,ptarjan/node-jscs,kaicataldo/node-jscs,alawatthe/node-jscs,ficristo/node-jscs,kaicataldo/node-jscs,bengourley/node-jscs,lukeapage/node-jscs,ValYouW/node-jscs,mcanthony/node-jscs,faceleg/node-jscs,natemara/node-jscs,stevemao/node-jscs,pm5/node-jscs,FGRibreau/node-jscs,allain/node-jscs,zxqfox/node-jscs,ronkorving/node-jscs,kylepaulsen/node-jscs,oredi/node-jscs,jamesreggio/node-jscs,jdforrester/node-jscs,mcanthony/node-jscs,xwp/node-jscs,elijahmanor/node-jscs,yomed/node-jscs,elijahmanor/node-jscs,Qix-/node-jscs,aptiko/node-jscs,markelog/node-jscs,bjdixon/node-jscs,SimenB/node-jscs,nantunes/node-jscs,yejodido/node-jscs,zxqfox/node-jscs,kylepaulsen/node-jscs,ValYouW/node-jscs,arschmitz/node-jscs,hzoo/node-jscs,lukeapage/node-jscs,SimenB/node-jscs,marian-r/node-jscs,jscs-dev/node-jscs,indexzero/node-jscs,iamstarkov/node-jscs,markelog/node-jscs,ficristo/node-jscs,yous/node-jscs,mrjoelkemp/node-jscs
--- +++ @@ -3,27 +3,30 @@ describe('rules/require-line-feed-at-file-end', function() { var checker; + beforeEach(function() { checker = new Checker(); checker.registerDefaultRules(); + checker.configure({ requireLineFeedAtFileEnd: true }); }); + it('should report no line feed at file end', function() { - checker.configure({ requireLineFeedAtFileEnd: true }); assert(checker.checkString('var x;').getErrorCount() === 1); }); it('should report no line feed at file end if end with comment', function() { - checker.configure({ requireLineFeedAtFileEnd: true }); assert(checker.checkString('var x;\n//foo').getErrorCount() === 1); }); it('should not report existing line feed at file end', function() { - checker.configure({ requireLineFeedAtFileEnd: true }); assert(checker.checkString('var x;\n').isEmpty()); }); it('should not report existing line feed at file end with preceeding comment', function() { - checker.configure({ requireLineFeedAtFileEnd: true }); assert(checker.checkString('var x;\n//foo\n').isEmpty()); }); + + it('should report on an IIFE with no line feed at EOF', function() { + assert.equal(checker.checkString('(function() {\nconsole.log(\'Hello World\');\n})();').getErrorCount(), 1); + }); });
92584915936d96adb5f9ccecbe60ac9fd541453d
examples/gps.js
examples/gps.js
"use strict"; var bebop = require("../."); var drone = bebop.createClient(); drone.connect(function() { drone.GPSSettings.resetHome(); drone.WifiSettings.outdoorSetting(1); drone.on("PositionChanged", function(data) { console.log(data); }) });
"use strict"; var bebop = require("../."); var drone = bebop.createClient(); drone.connect(function() { drone.GPSSettings.resetHome(); drone.WifiSettings.outdoorSetting(1); drone.on("PositionChanged", function(data) { console.log(data); }); });
Add missing semicolon to example to pass ESLint checks
Add missing semicolon to example to pass ESLint checks
JavaScript
mit
hybridgroup/node-bebop
--- +++ @@ -10,5 +10,5 @@ drone.on("PositionChanged", function(data) { console.log(data); - }) + }); });
b108b0286b23c68c663991442099c15af4eed207
server.js
server.js
require('zone.js/dist/zone-node'); require('reflect-metadata'); const express = require('express'); const fs = require('fs'); const { platformServer, renderModuleFactory } = require('@angular/platform-server'); const { ngExpressEngine } = require('@nguniversal/express-engine'); // Import module map for lazy loading const { provideModuleMap } = require('@nguniversal/module-map-ngfactory-loader'); // Import the AOT compiled factory for your AppServerModule. // This import will change with the hash of your built server bundle. const { AppServerModuleNgFactory, LAZY_MODULE_MAP } = require(`./dist-server/main.bundle`); const app = express(); const port = 8000; const baseUrl = `http://localhost:${port}`; // Set the engine app.engine('html', ngExpressEngine({ bootstrap: AppServerModuleNgFactory, providers: [ provideModuleMap(LAZY_MODULE_MAP) ] })); app.set('view engine', 'html'); app.set('views', './'); app.use('/', express.static('./', {index: false})); app.get('*', (req, res) => { res.render('index', { req, res }); }); app.listen(port, () => { console.log(`Listening at ${baseUrl}`); });
require('zone.js/dist/zone-node'); require('reflect-metadata'); const express = require('express'); const fs = require('fs'); const { platformServer, renderModuleFactory } = require('@angular/platform-server'); const { ngExpressEngine } = require('@nguniversal/express-engine'); // Import module map for lazy loading const { provideModuleMap } = require('@nguniversal/module-map-ngfactory-loader'); // Import the AOT compiled factory for your AppServerModule. // This import will change with the hash of your built server bundle. const { AppServerModuleNgFactory, LAZY_MODULE_MAP } = require(`./dist-server/main.bundle`); const app = express(); const port = 8080; const baseUrl = `http://localhost:${port}`; // Set the engine app.engine('html', ngExpressEngine({ bootstrap: AppServerModuleNgFactory, providers: [ provideModuleMap(LAZY_MODULE_MAP) ] })); app.set('view engine', 'html'); app.set('views', './'); app.use('/', express.static('./', {index: false})); app.get('*', (req, res) => { res.render('index', { req, res }); }); app.listen(port, () => { console.log(`Listening at ${baseUrl}`); });
Change port to 8080 to match with clevercloud requirement
Change port to 8080 to match with clevercloud requirement
JavaScript
mit
sebastienbarbier/sebastienbarbier.com,sebastienbarbier/sebastienbarbier.com,sebastienbarbier/sebastienbarbier.com,sebastienbarbier/sebastienbarbier.com
--- +++ @@ -13,7 +13,7 @@ const { AppServerModuleNgFactory, LAZY_MODULE_MAP } = require(`./dist-server/main.bundle`); const app = express(); -const port = 8000; +const port = 8080; const baseUrl = `http://localhost:${port}`; // Set the engine
666ecdb4f9dad13fed329b188b0de98cbab3f3d8
src/flash/display/Shape.js
src/flash/display/Shape.js
/* -*- Mode: js; js-indent-level: 2; indent-tabs-mode: nil; tab-width: 2 -*- */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ /* * Copyright 2013 Mozilla Foundation * * 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. */ var ShapeDefinition = (function () { var def = { __class__: 'flash.display.Shape', initialize: function () { var s = this.symbol; if (s && s.graphicsFactory) { var graphics = s.graphicsFactory(0); if (this._stage && this._stage._quality === 'low' && !graphics._bitmap) graphics._cacheAsBitmap(this._bbox); this._graphics = graphics; } else { this._graphics = new flash.display.Graphics(); } } }; def.__glue__ = { native: { instance: { graphics: { get: function () { return this._graphics; } } } } }; return def; }).call(this);
/* -*- Mode: js; js-indent-level: 2; indent-tabs-mode: nil; tab-width: 2 -*- */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ /* * Copyright 2013 Mozilla Foundation * * 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. */ var ShapeDefinition = (function () { var def = { __class__: 'flash.display.Shape', initialize: function () { var s = this.symbol; if (s && s.graphicsFactory) { var graphics = s.graphicsFactory(0); if (this._stage && this._stage._quality === 'low' && !graphics._bitmap) graphics._cacheAsBitmap(this._bbox); this._graphics = graphics; } else { this._graphics = new flash.display.Graphics(); this._graphics._parent = this; } } }; def.__glue__ = { native: { instance: { graphics: { get: function () { return this._graphics; } } } } }; return def; }).call(this);
Set graphics parent for programmatically created shapes.
Set graphics parent for programmatically created shapes.
JavaScript
apache-2.0
yurydelendik/shumway,mozilla/shumway,yurydelendik/shumway,mozilla/shumway,mozilla/shumway,yurydelendik/shumway,tschneidereit/shumway,mbebenita/shumway,yurydelendik/shumway,mozilla/shumway,mozilla/shumway,yurydelendik/shumway,tschneidereit/shumway,tschneidereit/shumway,mozilla/shumway,mbebenita/shumway,mozilla/shumway,mbebenita/shumway,tschneidereit/shumway,yurydelendik/shumway,tschneidereit/shumway,mbebenita/shumway,mbebenita/shumway,mbebenita/shumway,mbebenita/shumway,yurydelendik/shumway,tschneidereit/shumway,mbebenita/shumway,tschneidereit/shumway,yurydelendik/shumway,mozilla/shumway,tschneidereit/shumway
--- +++ @@ -31,6 +31,7 @@ this._graphics = graphics; } else { this._graphics = new flash.display.Graphics(); + this._graphics._parent = this; } } };
7a286e33c1ea1eeb72903af368d46bce2ec887e4
screens/EventDetailScreen.js
screens/EventDetailScreen.js
import React, {Component} from "react"; import { View, Text } from "react-native"; import PageFrame from "../components/PageFrame"; import EventDetailView from "../components/EventDetailView"; export default class EventDetailScreen extends Component { render() { // Placeholder empty function to suppress warnings var emptyFunc = function() {}; return ( <PageFrame title={this.props.route.params.eventInfo.title}> <EventDetailView eventInfo = {this.props.route.params.eventInfo} onSignUpChange = {emptyFunc} /> </PageFrame> ); } };
import React, {Component} from "react"; import { View, Text } from "react-native"; import PageFrame from "../components/PageFrame"; import EventDetailView from "../components/EventDetailView"; export default class EventDetailScreen extends Component { constructor() { super(); this.state = {signedUp: false}; this.toggleSignup = this.toggleSignup.bind(this); } toggleSignup() { this.setState({signedUp: !this.state.signedUp}); } render() { return ( <PageFrame overlay={true}> <EventDetailView eventInfo = {this.props.route.params.eventInfo} onSignUpChange = {this.toggleSignup} signedUp = {this.state.signedUp} /> </PageFrame> ); } };
Add temporary signup callback to test styles
Add temporary signup callback to test styles
JavaScript
mit
ottobonn/roots
--- +++ @@ -8,14 +8,23 @@ import EventDetailView from "../components/EventDetailView"; export default class EventDetailScreen extends Component { + constructor() { + super(); + this.state = {signedUp: false}; + this.toggleSignup = this.toggleSignup.bind(this); + } + + toggleSignup() { + this.setState({signedUp: !this.state.signedUp}); + } + render() { - // Placeholder empty function to suppress warnings - var emptyFunc = function() {}; return ( - <PageFrame title={this.props.route.params.eventInfo.title}> + <PageFrame overlay={true}> <EventDetailView eventInfo = {this.props.route.params.eventInfo} - onSignUpChange = {emptyFunc} + onSignUpChange = {this.toggleSignup} + signedUp = {this.state.signedUp} /> </PageFrame> );
f86f229533dc409bae560b32bcae35ed87844922
server.js
server.js
var express = require('express'); var logger = require('morgan'); var bodyParser = require('body-parser'); var session = require('express-session'); // compatible stores at https://github.com/expressjs/session#compatible-session-stores var exphbs = require('express-handlebars'); var cookieParser = require('cookie-parser'); var flash = require('connect-flash'); var helmet = require('helmet'); var app = express(); //setup security =============================================================== require('./app/lib/security-setup')(app, helmet); // configuration =============================================================== app.use(logger('dev')); // log every request to the console // set up our express application ============================================== // Make the body object available on the request app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: true })); //set handlebars as default templating engine app.engine('handlebars', exphbs({defaultLayout: 'layout'})); app.set('view engine', 'handlebars'); // serve the static content ==================================================== app.use(express.static(__dirname + '/public')); // set up global variables ===================================================== // routes ====================================================================== require('./app/routes.js')(app); // load our routes and pass in our app // export so bin/www can launch ================================================ module.exports = app;
var express = require('express'); var logger = require('morgan'); var bodyParser = require('body-parser'); var session = require('express-session'); // compatible stores at https://github.com/expressjs/session#compatible-session-stores var exphbs = require('express-handlebars'); var cookieParser = require('cookie-parser'); var flash = require('connect-flash'); var helmet = require('helmet'); var app = express(); //setup security =============================================================== require('./app/lib/security-setup')(app, helmet); // configuration =============================================================== app.use(logger('dev')); // log every request to the console // set up our express application ============================================== // setup connect flash so we can sent messages app.use(cookieParser('secretString')); app.use(session({ secret: "@lHJr+JrSwv1W&J904@W%nmWf++K99pRBvk&wBaNAs4JTid1Ji", resave: false, saveUninitialized: true })); app.use(flash()); // Make the body object available on the request app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: true })); //set handlebars as default templating engine app.engine('handlebars', exphbs({defaultLayout: 'layout'})); app.set('view engine', 'handlebars'); // serve the static content ==================================================== app.use(express.static(__dirname + '/public')); // set up global variables ===================================================== // routes ====================================================================== require('./app/routes.js')(app); // load our routes and pass in our app // export so bin/www can launch ================================================ module.exports = app;
Add connect flash middleware setup
Add connect flash middleware setup
JavaScript
mit
Temmermans/iot-device-simulator,Temmermans/iot-device-simulator
--- +++ @@ -15,6 +15,16 @@ app.use(logger('dev')); // log every request to the console // set up our express application ============================================== + +// setup connect flash so we can sent messages +app.use(cookieParser('secretString')); +app.use(session({ + secret: "@lHJr+JrSwv1W&J904@W%nmWf++K99pRBvk&wBaNAs4JTid1Ji", + resave: false, + saveUninitialized: true +})); +app.use(flash()); + // Make the body object available on the request app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: true }));
ee38f11006f69dd03298b736ae79b8ea6444e42b
src/helpers/api/apiAjax.js
src/helpers/api/apiAjax.js
import config from '../../config'; function formatUrl(path) { const adjustedPath = path[0] !== '/' ? '/' + path : path; const apiPath = `/api/${config.apiVersion}${adjustedPath}`; return apiPath; } class ApiAjax { constructor() { ['get', 'post', 'put', 'patch', 'del'].forEach((method) => this[method] = (path, { data } = {}) => new Promise((resolve, reject) => { const req = new XMLHttpRequest(); const url = formatUrl(path); req.onload = () => { if (req.status === 500) { reject(req.response); return; } if (req.response.length > 0) { resolve(JSON.parse(req.response)); return; } resolve(null); }; /** * Only covers network errors between the browser and the Express HTTP proxy */ req.onerror = () => { reject(null); }; req.open(method, url); req.setRequestHeader('Accept', 'application/json'); req.setRequestHeader('Content-Type', 'application/json'); req.send(JSON.stringify(data)); }) ); } } export default ApiAjax;
import config from '../../config'; function formatUrl(path) { const adjustedPath = path[0] !== '/' ? '/' + path : path; const apiPath = `/api/${config.apiVersion}${adjustedPath}`; return apiPath; } class ApiAjax { constructor() { ['get', 'post', 'put', 'patch', 'del'].forEach((method) => this[method] = (path, { data, header } = {}) => new Promise((resolve, reject) => { const req = new XMLHttpRequest(); const url = formatUrl(path); req.onload = () => { if (req.status === 500) { reject(req.response); return; } if (req.response.length > 0) { resolve(JSON.parse(req.response)); return; } resolve(null); }; /** * Only covers network errors between the browser and the Express HTTP proxy */ req.onerror = () => { reject(null); }; req.open(method, url); req.setRequestHeader('Accept', 'application/json'); req.setRequestHeader('Content-Type', 'application/json'); if (Object.keys(header || {}).length) { req.setRequestHeader(header.key, header.value); } req.send(JSON.stringify(data)); }) ); } } export default ApiAjax;
Add custom header for AJAX requests
Add custom header for AJAX requests
JavaScript
mit
coopdevs/katuma-web,coopdevs/katuma-web
--- +++ @@ -10,7 +10,7 @@ class ApiAjax { constructor() { ['get', 'post', 'put', 'patch', 'del'].forEach((method) => - this[method] = (path, { data } = {}) => new Promise((resolve, reject) => { + this[method] = (path, { data, header } = {}) => new Promise((resolve, reject) => { const req = new XMLHttpRequest(); const url = formatUrl(path); @@ -38,6 +38,9 @@ req.open(method, url); req.setRequestHeader('Accept', 'application/json'); req.setRequestHeader('Content-Type', 'application/json'); + if (Object.keys(header || {}).length) { + req.setRequestHeader(header.key, header.value); + } req.send(JSON.stringify(data)); }) );
0d0c17d669983fb14f67de1af551d434b698f4ca
packages/ember-htmlbars/lib/hooks/get-root.js
packages/ember-htmlbars/lib/hooks/get-root.js
/** @module ember @submodule ember-htmlbars */ import Ember from "ember-metal/core"; import { isGlobal } from "ember-metal/path_cache"; import SimpleStream from "ember-metal/streams/simple-stream"; export default function getRoot(scope, key) { if (key === 'this') { return [scope.self]; } else if (isGlobal(key) && Ember.lookup[key]) { return [getGlobal(key)]; } else if (scope.locals[key]) { return [scope.locals[key]]; } else { return [getKey(scope, key)]; } } function getKey(scope, key) { if (key === 'attrs' && scope.attrs) { return scope.attrs; } var self = scope.self || scope.locals.view; if (scope.attrs && key in scope.attrs) { Ember.deprecate("You accessed the `" + key + "` attribute directly. Please use `attrs." + key + "` instead."); return scope.attrs[key]; } else if (self) { return self.getKey(key); } } var globalStreams = {}; function getGlobal(name) { Ember.deprecate("Global lookup of " + name + " from a Handlebars template is deprecated") var globalStream = globalStreams[name]; if (globalStream === undefined) { var global = Ember.lookup[name]; globalStream = new SimpleStream(global, name); globalStreams[name] = globalStream; } return globalStream; }
/** @module ember @submodule ember-htmlbars */ import Ember from "ember-metal/core"; import { isGlobal } from "ember-metal/path_cache"; import SimpleStream from "ember-metal/streams/simple-stream"; export default function getRoot(scope, key) { if (key === 'this') { return [scope.self]; } else if (isGlobal(key) && Ember.lookup[key]) { return [getGlobal(key)]; } else if (scope.locals[key]) { return [scope.locals[key]]; } else { return [getKey(scope, key)]; } } function getKey(scope, key) { if (key === 'attrs' && scope.attrs) { return scope.attrs; } var self = scope.self || scope.locals.view; if (scope.attrs && key in scope.attrs) { Ember.deprecate("You accessed the `" + key + "` attribute directly. Please use `attrs." + key + "` instead."); return scope.attrs[key]; } else if (self) { return self.getKey(key); } } function getGlobal(name) { Ember.deprecate("Global lookup of " + name + " from a Handlebars template is deprecated") // This stream should be memoized, but this path is deprecated and // will be removed soon so it's not worth the trouble. return new SimpleStream(Ember.lookup[name], name); }
Remove global stream memoization to fix more tests
Remove global stream memoization to fix more tests Memoizing into a local variable doesn't work well the tests since the tests mutate the value of the global. In theory we could define a test helper to work around this, but it doesn't seem like its worth the effort since this path is deprecated and has a simple upgrade path.
JavaScript
mit
jherdman/ember.js,schreiaj/ember.js,XrXr/ember.js,trek/ember.js,pixelhandler/ember.js,nipunas/ember.js,johnnyshields/ember.js,lazybensch/ember.js,tiegz/ember.js,green-arrow/ember.js,jayphelps/ember.js,femi-saliu/ember.js,tildeio/ember.js,trek/ember.js,rfsv/ember.js,jamesarosen/ember.js,Trendy/ember.js,kmiyashiro/ember.js,knownasilya/ember.js,martndemus/ember.js,martndemus/ember.js,cyjia/ember.js,max-konin/ember.js,rodrigo-morais/ember.js,visualjeff/ember.js,lan0/ember.js,njagadeesh/ember.js,VictorChaun/ember.js,simudream/ember.js,amk221/ember.js,cowboyd/ember.js,howmuchcomputer/ember.js,howmuchcomputer/ember.js,williamsbdev/ember.js,tianxiangbing/ember.js,ubuntuvim/ember.js,Leooo/ember.js,Zagorakiss/ember.js,anilmaurya/ember.js,ridixcr/ember.js,Leooo/ember.js,swarmbox/ember.js,amk221/ember.js,seanpdoyle/ember.js,tildeio/ember.js,thoov/ember.js,green-arrow/ember.js,cyjia/ember.js,sandstrom/ember.js,HeroicEric/ember.js,amk221/ember.js,kennethdavidbuck/ember.js,twokul/ember.js,TriumphantAkash/ember.js,BrianSipple/ember.js,olivierchatry/ember.js,jasonmit/ember.js,yaymukund/ember.js,asakusuma/ember.js,kidaa/ember.js,claimsmall/ember.js,mdehoog/ember.js,Vassi/ember.js,nicklv/ember.js,max-konin/ember.js,sivakumar-kailasam/ember.js,twokul/ember.js,tofanelli/ember.js,Turbo87/ember.js,toddjordan/ember.js,mfeckie/ember.js,Patsy-issa/ember.js,artfuldodger/ember.js,topaxi/ember.js,pangratz/ember.js,tiegz/ember.js,Serabe/ember.js,tricknotes/ember.js,elwayman02/ember.js,nathanhammond/ember.js,mike-north/ember.js,pangratz/ember.js,kaeufl/ember.js,rlugojr/ember.js,HipsterBrown/ember.js,danielgynn/ember.js,delftswa2016/ember.js,HeroicEric/ember.js,runspired/ember.js,szines/ember.js,kidaa/ember.js,jcope2013/ember.js,artfuldodger/ember.js,yuhualingfeng/ember.js,skeate/ember.js,code0100fun/ember.js,udhayam/ember.js,ThiagoGarciaAlves/ember.js,workmanw/ember.js,loadimpact/ember.js,raytiley/ember.js,rodrigo-morais/ember.js,jaswilli/ember.js,kellyselden/ember.js,visualjeff/ember.js,antigremlin/ember.js,xcskier56/ember.js,szines/ember.js,artfuldodger/ember.js,cowboyd/ember.js,jamesarosen/ember.js,bmac/ember.js,skeate/ember.js,mitchlloyd/ember.js,ef4/ember.js,thoov/ember.js,stefanpenner/ember.js,rlugojr/ember.js,pixelhandler/ember.js,yonjah/ember.js,GavinJoyce/ember.js,adatapost/ember.js,chadhietala/ember.js,jaswilli/ember.js,Gaurav0/ember.js,alexdiliberto/ember.js,jaswilli/ember.js,koriroys/ember.js,gfvcastro/ember.js,blimmer/ember.js,cgvarela/ember.js,lazybensch/ember.js,topaxi/ember.js,delftswa2016/ember.js,koriroys/ember.js,seanjohnson08/ember.js,mitchlloyd/ember.js,joeruello/ember.js,rodrigo-morais/ember.js,practicefusion/ember.js,qaiken/ember.js,cjc343/ember.js,HeroicEric/ember.js,seanjohnson08/ember.js,cbou/ember.js,ubuntuvim/ember.js,duggiefresh/ember.js,sandstrom/ember.js,vikram7/ember.js,swarmbox/ember.js,quaertym/ember.js,mfeckie/ember.js,twokul/ember.js,nickiaconis/ember.js,kennethdavidbuck/ember.js,swarmbox/ember.js,claimsmall/ember.js,marcioj/ember.js,benstoltz/ember.js,practicefusion/ember.js,tsing80/ember.js,cgvarela/ember.js,fxkr/ember.js,jerel/ember.js,csantero/ember.js,tricknotes/ember.js,jherdman/ember.js,ridixcr/ember.js,yaymukund/ember.js,cibernox/ember.js,cyberkoi/ember.js,soulcutter/ember.js,kmiyashiro/ember.js,wecc/ember.js,mdehoog/ember.js,NLincoln/ember.js,givanse/ember.js,Patsy-issa/ember.js,soulcutter/ember.js,mike-north/ember.js,patricksrobertson/ember.js,Kuzirashi/ember.js,GavinJoyce/ember.js,nickiaconis/ember.js,seanjohnson08/ember.js,marcioj/ember.js,elwayman02/ember.js,thejameskyle/ember.js,Kuzirashi/ember.js,trentmwillis/ember.js,JesseQin/ember.js,fouzelddin/ember.js,Gaurav0/ember.js,miguelcobain/ember.js,jamesarosen/ember.js,acburdine/ember.js,MatrixZ/ember.js,claimsmall/ember.js,ianstarz/ember.js,howmuchcomputer/ember.js,mixonic/ember.js,zenefits/ember.js,opichals/ember.js,cdl/ember.js,jcope2013/ember.js,runspired/ember.js,marijaselakovic/ember.js,Zagorakiss/ember.js,jish/ember.js,kanongil/ember.js,workmanw/ember.js,kaeufl/ember.js,tricknotes/ember.js,rwjblue/ember.js,lsthornt/ember.js,ryanlabouve/ember.js,davidpett/ember.js,mitchlloyd/ember.js,kublaj/ember.js,seanjohnson08/ember.js,Leooo/ember.js,lsthornt/ember.js,jamesarosen/ember.js,ThiagoGarciaAlves/ember.js,swarmbox/ember.js,alexdiliberto/ember.js,nruth/ember.js,kwight/ember.js,TriumphantAkash/ember.js,EricSchank/ember.js,elwayman02/ember.js,fxkr/ember.js,boztek/ember.js,KevinTCoughlin/ember.js,TriumphantAkash/ember.js,pixelhandler/ember.js,trentmwillis/ember.js,soulcutter/ember.js,code0100fun/ember.js,ryanlabouve/ember.js,nipunas/ember.js,kaeufl/ember.js,davidpett/ember.js,udhayam/ember.js,tofanelli/ember.js,HipsterBrown/ember.js,mallikarjunayaddala/ember.js,toddjordan/ember.js,szines/ember.js,sly7-7/ember.js,martndemus/ember.js,Trendy/ember.js,olivierchatry/ember.js,Gaurav0/ember.js,nathanhammond/ember.js,bmac/ember.js,cyjia/ember.js,adatapost/ember.js,xcskier56/ember.js,nightire/ember.js,MatrixZ/ember.js,jayphelps/ember.js,Turbo87/ember.js,lazybensch/ember.js,Kuzirashi/ember.js,simudream/ember.js,xtian/ember.js,GavinJoyce/ember.js,stefanpenner/ember.js,BrianSipple/ember.js,jackiewung/ember.js,Patsy-issa/ember.js,Turbo87/ember.js,max-konin/ember.js,jayphelps/ember.js,jayphelps/ember.js,femi-saliu/ember.js,artfuldodger/ember.js,xiujunma/ember.js,szines/ember.js,kigsmtua/ember.js,bmac/ember.js,Robdel12/ember.js,aihua/ember.js,nightire/ember.js,omurbilgili/ember.js,tiegz/ember.js,fouzelddin/ember.js,qaiken/ember.js,yuhualingfeng/ember.js,nruth/ember.js,femi-saliu/ember.js,karthiick/ember.js,trentmwillis/ember.js,miguelcobain/ember.js,nruth/ember.js,benstoltz/ember.js,olivierchatry/ember.js,sharma1nitish/ember.js,jplwood/ember.js,tsing80/ember.js,SaladFork/ember.js,schreiaj/ember.js,ryanlabouve/ember.js,jaswilli/ember.js,howmuchcomputer/ember.js,cowboyd/ember.js,bekzod/ember.js,udhayam/ember.js,VictorChaun/ember.js,Zagorakiss/ember.js,JKGisMe/ember.js,mrjavascript/ember.js,kwight/ember.js,rodrigo-morais/ember.js,Serabe/ember.js,kwight/ember.js,cesarizu/ember.js,toddjordan/ember.js,joeruello/ember.js,green-arrow/ember.js,seanpdoyle/ember.js,chadhietala/ember.js,claimsmall/ember.js,johnnyshields/ember.js,csantero/ember.js,fpauser/ember.js,Vassi/ember.js,kublaj/ember.js,thejameskyle/ember.js,seanpdoyle/ember.js,yonjah/ember.js,fpauser/ember.js,raytiley/ember.js,fpauser/ember.js,quaertym/ember.js,furkanayhan/ember.js,mixonic/ember.js,kmiyashiro/ember.js,workmanw/ember.js,fxkr/ember.js,Turbo87/ember.js,njagadeesh/ember.js,tsing80/ember.js,ThiagoGarciaAlves/ember.js,tofanelli/ember.js,johanneswuerbach/ember.js,intercom/ember.js,rot26/ember.js,howtolearntocode/ember.js,givanse/ember.js,Robdel12/ember.js,nathanhammond/ember.js,JKGisMe/ember.js,selvagsz/ember.js,johanneswuerbach/ember.js,code0100fun/ember.js,williamsbdev/ember.js,selvagsz/ember.js,kanongil/ember.js,cbou/ember.js,kigsmtua/ember.js,marijaselakovic/ember.js,blimmer/ember.js,qaiken/ember.js,yonjah/ember.js,cesarizu/ember.js,ef4/ember.js,nicklv/ember.js,xiujunma/ember.js,asakusuma/ember.js,omurbilgili/ember.js,faizaanshamsi/ember.js,kublaj/ember.js,joeruello/ember.js,amk221/ember.js,JesseQin/ember.js,tofanelli/ember.js,lan0/ember.js,xtian/ember.js,emberjs/ember.js,schreiaj/ember.js,karthiick/ember.js,xiujunma/ember.js,intercom/ember.js,xtian/ember.js,faizaanshamsi/ember.js,koriroys/ember.js,mixonic/ember.js,emberjs/ember.js,tianxiangbing/ember.js,chadhietala/ember.js,ubuntuvim/ember.js,jerel/ember.js,BrianSipple/ember.js,miguelcobain/ember.js,HipsterBrown/ember.js,pixelhandler/ember.js,bantic/ember.js,jish/ember.js,karthiick/ember.js,faizaanshamsi/ember.js,trentmwillis/ember.js,XrXr/ember.js,raytiley/ember.js,kigsmtua/ember.js,vikram7/ember.js,intercom/ember.js,tianxiangbing/ember.js,nickiaconis/ember.js,asakusuma/ember.js,xcskier56/ember.js,sharma1nitish/ember.js,antigremlin/ember.js,tianxiangbing/ember.js,karthiick/ember.js,rwjblue/ember.js,wecc/ember.js,kidaa/ember.js,rot26/ember.js,udhayam/ember.js,jackiewung/ember.js,tricknotes/ember.js,trek/ember.js,soulcutter/ember.js,sharma1nitish/ember.js,chadhietala/ember.js,sly7-7/ember.js,mdehoog/ember.js,mrjavascript/ember.js,fpauser/ember.js,quaertym/ember.js,acburdine/ember.js,lazybensch/ember.js,marcioj/ember.js,jerel/ember.js,howtolearntocode/ember.js,joeruello/ember.js,XrXr/ember.js,rot26/ember.js,vikram7/ember.js,miguelcobain/ember.js,xtian/ember.js,kidaa/ember.js,Vassi/ember.js,kellyselden/ember.js,Serabe/ember.js,loadimpact/ember.js,asakusuma/ember.js,KevinTCoughlin/ember.js,ridixcr/ember.js,aihua/ember.js,rlugojr/ember.js,adatapost/ember.js,visualjeff/ember.js,wecc/ember.js,toddjordan/ember.js,greyhwndz/ember.js,anilmaurya/ember.js,Eric-Guo/ember.js,furkanayhan/ember.js,mdehoog/ember.js,Kuzirashi/ember.js,topaxi/ember.js,jcope2013/ember.js,yuhualingfeng/ember.js,runspired/ember.js,mitchlloyd/ember.js,Trendy/ember.js,SaladFork/ember.js,xiujunma/ember.js,lsthornt/ember.js,adatapost/ember.js,lan0/ember.js,kublaj/ember.js,JKGisMe/ember.js,TriumphantAkash/ember.js,ianstarz/ember.js,practicefusion/ember.js,gfvcastro/ember.js,kellyselden/ember.js,trek/ember.js,danielgynn/ember.js,bekzod/ember.js,johanneswuerbach/ember.js,greyhwndz/ember.js,yaymukund/ember.js,eliotsykes/ember.js,simudream/ember.js,VictorChaun/ember.js,Serabe/ember.js,howtolearntocode/ember.js,omurbilgili/ember.js,rfsv/ember.js,patricksrobertson/ember.js,ianstarz/ember.js,twokul/ember.js,jasonmit/ember.js,jasonmit/ember.js,opichals/ember.js,rubenrp81/ember.js,rlugojr/ember.js,sivakumar-kailasam/ember.js,lan0/ember.js,rubenrp81/ember.js,marijaselakovic/ember.js,fouzelddin/ember.js,ef4/ember.js,mallikarjunayaddala/ember.js,KevinTCoughlin/ember.js,sivakumar-kailasam/ember.js,XrXr/ember.js,jplwood/ember.js,EricSchank/ember.js,njagadeesh/ember.js,sivakumar-kailasam/ember.js,green-arrow/ember.js,kennethdavidbuck/ember.js,jish/ember.js,boztek/ember.js,knownasilya/ember.js,skeate/ember.js,duggiefresh/ember.js,zenefits/ember.js,intercom/ember.js,sivakumar-kailasam/ember.js,Robdel12/ember.js,Krasnyanskiy/ember.js,zenefits/ember.js,cesarizu/ember.js,marcioj/ember.js,ridixcr/ember.js,thejameskyle/ember.js,rwjblue/ember.js,blimmer/ember.js,olivierchatry/ember.js,givanse/ember.js,cjc343/ember.js,jplwood/ember.js,HeroicEric/ember.js,anilmaurya/ember.js,martndemus/ember.js,Eric-Guo/ember.js,vikram7/ember.js,alexdiliberto/ember.js,seanpdoyle/ember.js,nightire/ember.js,acburdine/ember.js,code0100fun/ember.js,aihua/ember.js,nipunas/ember.js,MatrixZ/ember.js,gfvcastro/ember.js,jerel/ember.js,acburdine/ember.js,HipsterBrown/ember.js,loadimpact/ember.js,knownasilya/ember.js,Patsy-issa/ember.js,EricSchank/ember.js,qaiken/ember.js,greyhwndz/ember.js,davidpett/ember.js,mfeckie/ember.js,johnnyshields/ember.js,marijaselakovic/ember.js,bantic/ember.js,duggiefresh/ember.js,cjc343/ember.js,Krasnyanskiy/ember.js,nipunas/ember.js,ryanlabouve/ember.js,delftswa2016/ember.js,elwayman02/ember.js,rubenrp81/ember.js,schreiaj/ember.js,kanongil/ember.js,JesseQin/ember.js,loadimpact/ember.js,yonjah/ember.js,practicefusion/ember.js,eliotsykes/ember.js,nightire/ember.js,tsing80/ember.js,ThiagoGarciaAlves/ember.js,boztek/ember.js,koriroys/ember.js,JesseQin/ember.js,thejameskyle/ember.js,Gaurav0/ember.js,boztek/ember.js,cyberkoi/ember.js,EricSchank/ember.js,csantero/ember.js,williamsbdev/ember.js,Eric-Guo/ember.js,kaeufl/ember.js,benstoltz/ember.js,mike-north/ember.js,Trendy/ember.js,zenefits/ember.js,jackiewung/ember.js,femi-saliu/ember.js,eliotsykes/ember.js,williamsbdev/ember.js,sly7-7/ember.js,cdl/ember.js,rfsv/ember.js,cgvarela/ember.js,eliotsykes/ember.js,stefanpenner/ember.js,NLincoln/ember.js,njagadeesh/ember.js,bantic/ember.js,xcskier56/ember.js,BrianSipple/ember.js,danielgynn/ember.js,cdl/ember.js,johnnyshields/ember.js,nicklv/ember.js,cdl/ember.js,opichals/ember.js,mike-north/ember.js,davidpett/ember.js,howtolearntocode/ember.js,NLincoln/ember.js,alexdiliberto/ember.js,nruth/ember.js,nathanhammond/ember.js,tiegz/ember.js,mrjavascript/ember.js,jcope2013/ember.js,sharma1nitish/ember.js,SaladFork/ember.js,Eric-Guo/ember.js,cbou/ember.js,mfeckie/ember.js,johanneswuerbach/ember.js,selvagsz/ember.js,aihua/ember.js,mrjavascript/ember.js,MatrixZ/ember.js,wecc/ember.js,kigsmtua/ember.js,nickiaconis/ember.js,csantero/ember.js,JKGisMe/ember.js,mallikarjunayaddala/ember.js,kwight/ember.js,KevinTCoughlin/ember.js,VictorChaun/ember.js,emberjs/ember.js,bekzod/ember.js,Zagorakiss/ember.js,topaxi/ember.js,Leooo/ember.js,tildeio/ember.js,bekzod/ember.js,antigremlin/ember.js,rwjblue/ember.js,SaladFork/ember.js,max-konin/ember.js,rot26/ember.js,NLincoln/ember.js,anilmaurya/ember.js,sandstrom/ember.js,delftswa2016/ember.js,pangratz/ember.js,cibernox/ember.js,omurbilgili/ember.js,bantic/ember.js,yaymukund/ember.js,gfvcastro/ember.js,mallikarjunayaddala/ember.js,bmac/ember.js,kanongil/ember.js,fxkr/ember.js,ianstarz/ember.js,cibernox/ember.js,jherdman/ember.js,rubenrp81/ember.js,simudream/ember.js,quaertym/ember.js,furkanayhan/ember.js,blimmer/ember.js,opichals/ember.js,GavinJoyce/ember.js,jish/ember.js,cyberkoi/ember.js,cesarizu/ember.js,antigremlin/ember.js,selvagsz/ember.js,greyhwndz/ember.js,ef4/ember.js,jasonmit/ember.js,patricksrobertson/ember.js,cyjia/ember.js,benstoltz/ember.js,kellyselden/ember.js,lsthornt/ember.js,cibernox/ember.js,duggiefresh/ember.js,jackiewung/ember.js,cgvarela/ember.js,skeate/ember.js,jplwood/ember.js,Robdel12/ember.js,faizaanshamsi/ember.js,furkanayhan/ember.js,patricksrobertson/ember.js,cyberkoi/ember.js,rfsv/ember.js,Vassi/ember.js,visualjeff/ember.js,kmiyashiro/ember.js,givanse/ember.js,cowboyd/ember.js,Krasnyanskiy/ember.js,Krasnyanskiy/ember.js,jasonmit/ember.js,pangratz/ember.js,jherdman/ember.js,thoov/ember.js,danielgynn/ember.js,yuhualingfeng/ember.js,thoov/ember.js,cjc343/ember.js,cbou/ember.js,workmanw/ember.js,raytiley/ember.js,nicklv/ember.js,ubuntuvim/ember.js,kennethdavidbuck/ember.js,fouzelddin/ember.js,runspired/ember.js
--- +++ @@ -34,18 +34,10 @@ } } -var globalStreams = {}; - function getGlobal(name) { Ember.deprecate("Global lookup of " + name + " from a Handlebars template is deprecated") - var globalStream = globalStreams[name]; - - if (globalStream === undefined) { - var global = Ember.lookup[name]; - globalStream = new SimpleStream(global, name); - globalStreams[name] = globalStream; - } - - return globalStream; + // This stream should be memoized, but this path is deprecated and + // will be removed soon so it's not worth the trouble. + return new SimpleStream(Ember.lookup[name], name); }
02bb3dec4c0007ae0733aa33419b87ea0a2a1288
src/client/scripts/reducers/branchTitles_reducer.js
src/client/scripts/reducers/branchTitles_reducer.js
const intialState = [ { name: 'hotels', query: 'hotel' }, { name: 'points of interest', query: 'point of interest' }, { name: 'museums', query: 'museum' }, { name: 'nightlife', query: 'night club' }, { name: 'restaurants', query: 'restaurant' }, ]; const branchTitles = (state = intialState, action) => { switch (action.type) { case 'UPDATE_BRANCH_TITLES': return Object.assign({}, state, { branchTitles: action.payload, }); default: return state; } }; export default branchTitles;
const intialState = { default: [ { name: 'hotels', query: 'hotel' }, { name: 'points of interest', query: 'point of interest' }, { name: 'museums', query: 'museum' }, { name: 'nightlife', query: 'night club' }, { name: 'restaurants', query: 'restaurant' }, ] }; const branchTitles = (state = intialState, action) => { switch (action.type) { case 'UPDATE_BRANCH_TITLES': return Object.assign({}, state, { branchTitles: action.payload, }); default: return state; } }; export default branchTitles;
Change branchtitle reducer to have default key holding default values.
Change branchtitle reducer to have default key holding default values.
JavaScript
mit
theredspoon/trip-raptor,Tropical-Raptor/trip-raptor
--- +++ @@ -1,10 +1,10 @@ -const intialState = [ +const intialState = { default: [ { name: 'hotels', query: 'hotel' }, { name: 'points of interest', query: 'point of interest' }, { name: 'museums', query: 'museum' }, { name: 'nightlife', query: 'night club' }, { name: 'restaurants', query: 'restaurant' }, -]; +] }; const branchTitles = (state = intialState, action) => { switch (action.type) {
430ecde27e749a093c52872b0f93b62fd499bace
packages/chiffchaff-concat/src/index.js
packages/chiffchaff-concat/src/index.js
'use strict' import MultiTask from 'chiffchaff-multi' import PipeTask from 'chiffchaff-pipe' import defaults from 'defaults' import EventRegistry from 'event-registry' const toTaskIterator = (sources, destination) => (function * () { for (const source of sources) { yield new PipeTask(source, destination, {end: false}) } })() export default class ConcatTask extends MultiTask { constructor (sources = null, destination = null, options = null) { super(null, defaults(options, {ignoreWeights: true, size: 0})) this._sources = sources this._destination = destination } get destination () { return this._destination } set destination (value) { this._destination = value } get size () { return super.size } set size (value) { this.options.size = value } _start () { this._tasks = toTaskIterator(this._sources, this._destination) return super._start() .then(() => this._awaitFinish()) } _awaitFinish () { return new Promise((resolve, reject) => { const reg = new EventRegistry() reg.onceFin(this._destination, 'finish', resolve) reg.onceFin(this._destination, 'error', reject) this._destination.end() }) } }
'use strict' import MultiTask from 'chiffchaff-multi' import PipeTask from 'chiffchaff-pipe' import defaults from 'defaults' import EventRegistry from 'event-registry' const toTaskIterator = (sources, destination) => (function * () { for (const source of sources) { yield new PipeTask(source, destination, {end: false}) } })() export default class ConcatTask extends MultiTask { constructor (sources = null, destination = null, options = null) { super(null, defaults(options, {ignoreWeights: true, size: 0})) this._sources = sources this._destination = destination } get destination () { return this._destination } set destination (value) { this._destination = value } get size () { return super.size } set size (value) { this.options.size = value } _start () { const ending = new Promise((resolve, reject) => { const reg = new EventRegistry() reg.onceFin(this._destination, 'finish', resolve) reg.onceFin(this._destination, 'error', reject) }) this._tasks = toTaskIterator(this._sources, this._destination) return super._start() .then(() => this._destination.end()) .then(() => ending) } }
Add completion listeners earlier so we don't miss sync calls
Add completion listeners earlier so we don't miss sync calls
JavaScript
mit
zentrick/chiffchaff,zentrick/chiffchaff
--- +++ @@ -35,17 +35,14 @@ } _start () { - this._tasks = toTaskIterator(this._sources, this._destination) - return super._start() - .then(() => this._awaitFinish()) - } - - _awaitFinish () { - return new Promise((resolve, reject) => { + const ending = new Promise((resolve, reject) => { const reg = new EventRegistry() reg.onceFin(this._destination, 'finish', resolve) reg.onceFin(this._destination, 'error', reject) - this._destination.end() }) + this._tasks = toTaskIterator(this._sources, this._destination) + return super._start() + .then(() => this._destination.end()) + .then(() => ending) } }
e7c7edde0f4c5351cbd62e6b00c009f2e436c8e7
routes.js
routes.js
/* globals MarkdownFilePaths: false */ // MarkdownFilePaths are created in run.js and passed through webpack import React from 'react'; import { Route, IndexRoute } from 'react-router'; import Landing from './pages/home/index'; import Guide from './pages/guide/index'; import GuideList from './pages/guideList/index'; import NotFound from './pages/error/index'; import ComingSoon from './pages/comingSoon'; // does not work when passing './content' as an variable const req = require.context('./content', true, /^\.\/.*\.md/); const routesForMarkdownFiles = MarkdownFilePaths.map(path => { const { title, html } = req(`./${path}`); const url = `${path.slice(0, -'.md'.length)}/`; console.log(`[Route generator] file ${path} -> url ${url}`); return <Route key={path} path={url} title={title} docHtml={html} />; }); const routes = ( <Route path="/"> <IndexRoute title="Skygear Documentation" component={Landing} /> <Route path="guides/" component={GuideList} /> <Route path="guide" component={Guide}> {routesForMarkdownFiles} </Route> <Route path="coming-soon/" title="Coming Soon" component={ComingSoon} /> <Route path="*" title="404: Not Found" component={NotFound} /> </Route> ); // Be sure to export the React component so that it can be statically rendered export default routes;
/* globals MarkdownFilePaths: false */ // MarkdownFilePaths are created in run.js and passed through webpack import React from 'react'; import { Route, IndexRoute } from 'react-router'; import Landing from './pages/home/index'; import Guide from './pages/guide/index'; import GuideList from './pages/guideList/index'; import NotFound from './pages/error/index'; import ComingSoon from './pages/comingSoon'; // does not work when passing './content' as an variable const req = require.context('./content', true, /^\.\/.*\.md/); const routesForMarkdownFiles = MarkdownFilePaths.map(path => { const { title, html } = req(`./${path}`); const url = `${path.slice(0, -'.md'.length)}/`; console.log(`[Route generator] file ${path} -> url ${url}`); return <Route key={path} path={url} title={title} docHtml={html} />; }); const routes = ( <Route path="/"> <IndexRoute title="Skygear Documentation" component={Landing} /> <Route path="guides/" title="Guides" component={GuideList} /> <Route path="guide" component={Guide}> {routesForMarkdownFiles} </Route> <Route path="coming-soon/" title="Coming Soon" component={ComingSoon} /> <Route path="*" title="404: Not Found" component={NotFound} /> </Route> ); // Be sure to export the React component so that it can be statically rendered export default routes;
Add html title to guide list
Add html title to guide list refs #393
JavaScript
mit
ben181231/skygear-doc,ben181231/skygear-doc,ben181231/skygear-doc
--- +++ @@ -22,7 +22,7 @@ const routes = ( <Route path="/"> <IndexRoute title="Skygear Documentation" component={Landing} /> - <Route path="guides/" component={GuideList} /> + <Route path="guides/" title="Guides" component={GuideList} /> <Route path="guide" component={Guide}> {routesForMarkdownFiles} </Route>
f36fad425eee83b479bb0745b8308fa957ff4c5b
scripts/translators/blank.js
scripts/translators/blank.js
elation.require([], function() { elation.component.add('janusweb.translators.blank', function() { this.exec = function(args) { return new Promise(function(resolve, reject) { var roomdata = { room: { use_local_asset: 'room_plane', pos: [0, 0, 0], orientation: new THREE.Quaternion().setFromEuler(new THREE.Euler(0,0,0)) }, object: [], link: [] }; //var bookmarks = elation.collection.localindexed({key: 'janusweb.bookmarks'}); resolve(roomdata); }); } }); });
elation.require([], function() { elation.component.add('janusweb.translators.blank', function() { this.exec = function(args) { return new Promise(function(resolve, reject) { var roomdata = { room: { use_local_asset: 'room_plane', pos: [0, 0, 0], orientation: new THREE.Quaternion().setFromEuler(new THREE.Euler(0,0,0)), skybox_left_id: 'black', skybox_right_id: 'black', skybox_back_id: 'black', skybox_front_id: 'black', skybox_up_id: 'black', skybox_down_id: 'black', }, object: [], link: [] }; //var bookmarks = elation.collection.localindexed({key: 'janusweb.bookmarks'}); resolve(roomdata); }); } }); });
Use black skybox for default web translator
Use black skybox for default web translator
JavaScript
mit
jbaicoianu/janusweb,jbaicoianu/janusweb,jbaicoianu/janusweb
--- +++ @@ -6,7 +6,13 @@ room: { use_local_asset: 'room_plane', pos: [0, 0, 0], - orientation: new THREE.Quaternion().setFromEuler(new THREE.Euler(0,0,0)) + orientation: new THREE.Quaternion().setFromEuler(new THREE.Euler(0,0,0)), + skybox_left_id: 'black', + skybox_right_id: 'black', + skybox_back_id: 'black', + skybox_front_id: 'black', + skybox_up_id: 'black', + skybox_down_id: 'black', }, object: [], link: []
91ba7311f555c7e7fc3a972d893654654893fc95
test/index/core.spec.js
test/index/core.spec.js
/** * util/core.spec.js * * @author Rock Hu <rockia@mac.com> * @license MIT */ import Endpoints from '../../src/config/endpoints.json'; import API from '../../src/config/api.json'; var Sinon = require('sinon'); var Chai = require('chai'); var Path = require('path'); Chai.use(require('sinon-chai')); Chai.should(); var expect = Chai.expect; var index = require('../../src/index.js'); describe('index', function() { var options = { api_key: '1234', platform: 'production', region: 'NA' }; class APIDriver{}; var apidriverObj = new APIDriver(Endpoints,API,options); it('should return APIDriver Object', function(){ expect(apidriverObj).to.be.an.instanceof(APIDriver); }); });
/** * util/core.spec.js * * @author Rock Hu <rockia@mac.com> * @license MIT */ import Endpoints from '../../src/config/endpoints.json'; import API from '../../src/config/api.json'; var Sinon = require('sinon'); var Chai = require('chai'); var Path = require('path'); Chai.use(require('sinon-chai')); Chai.should(); var expect = Chai.expect; var index = require('../../src/index.js'); describe('index', function() { it('should return APIDriver Object', function(){ var options = { api_key: '1234', platform: 'production', region: 'NA' }; class APIDriver{}; var apidriverObj = new APIDriver(Endpoints,API,options); expect(apidriverObj).to.be.an.instanceof(APIDriver); }); });
Update index test case 1
Update index test case 1
JavaScript
mit
imoplol/league-api
--- +++ @@ -19,15 +19,17 @@ var index = require('../../src/index.js'); describe('index', function() { - var options = { - api_key: '1234', - platform: 'production', - region: 'NA' - }; - class APIDriver{}; - var apidriverObj = new APIDriver(Endpoints,API,options); + it('should return APIDriver Object', function(){ + var options = { + api_key: '1234', + platform: 'production', + region: 'NA' + }; + class APIDriver{}; + var apidriverObj = new APIDriver(Endpoints,API,options); + expect(apidriverObj).to.be.an.instanceof(APIDriver); + }); - it('should return APIDriver Object', function(){ - expect(apidriverObj).to.be.an.instanceof(APIDriver); - }); + + });
d24721fcd6a7cccc9c6098f256fb5fc9bbe11f56
server/posts/publishPosts.js
server/posts/publishPosts.js
Meteor.publish('allPosts', function () { "use strict"; var result = Posts.find({}, { limit: 50, fields: { oldChildren: false } }); return result; }); Meteor.publish('comments', function (id) { "use strict"; return Posts.find({ _id: id }); }); Meteor.publish('user', function (username) { "use strict"; console.log(Posts.find().fetch()) return Posts.find({ author: username },{ limit: 50, fields: { oldChildren: false } }); }); Meteor.publish('recentPosts', function () { "use strict"; return Posts.find({}, { sort: { createdAt: -1 }, limit: 50, fields: { oldChildren: false } }); }); Meteor.publish('topPosts', function (start) { "use strict"; return Posts.find({ oldPoints: { $gt: 1 }, createdAt: { $gte: start } }, { sort: { oldPoints: -1 }, limit: 50, fields: { oldChildren: false } }); }); Meteor.publish('hotPosts', function () { "use strict"; return Posts.find({}, { limit: 50, sort: { heat: -1 }, fields: { oldChildren: false } }); });
Meteor.publish('allPosts', function () { "use strict"; var result = Posts.find({}, { limit: 50, fields: { oldChildren: false } }); return result; }); Meteor.publish('comments', function (id) { "use strict"; return Posts.find({ _id: id }); }); Meteor.publish('user', function (username) { "use strict"; return Posts.find({ author: username },{ limit: 50, fields: { oldChildren: false } }); }); Meteor.publish('recentPosts', function () { "use strict"; return Posts.find({}, { sort: { createdAt: -1 }, limit: 50, fields: { oldChildren: false } }); }); Meteor.publish('topPosts', function (start) { "use strict"; return Posts.find({ oldPoints: { $gt: 1 }, createdAt: { $gte: start } }, { sort: { oldPoints: -1 }, limit: 50, fields: { oldChildren: false } }); }); Meteor.publish('hotPosts', function () { "use strict"; return Posts.find({}, { limit: 50, sort: { heat: -1 }, fields: { oldChildren: false } }); });
Remove the console.log from the user pub
Remove the console.log from the user pub
JavaScript
mit
rrevanth/news,rrevanth/news
--- +++ @@ -20,7 +20,6 @@ Meteor.publish('user', function (username) { "use strict"; - console.log(Posts.find().fetch()) return Posts.find({ author: username },{
e284067b2cbeec5fd313dcafe8e17d187e3067c4
secret.js
secret.js
exports.TOKEN = ‘TOKEN HERE’; exports.SESSION_SECRET = ‘SESSION SECRET HERE’; exports.CLIENT_ID = ‘CLIENT ID HERE’; exports.CLIENT_SECRET = ‘CLIENT SECRET HERE’;
exports.TOKEN = 'TOKEN HERE'; exports.SESSION_SECRET = 'SESSION SECRET HERE'; exports.CLIENT_ID = 'CLIENT ID HERE'; exports.CLIENT_SECRET = 'CLIENT SECRET HERE';
Remove fancy quotations, thanks Gmail
Remove fancy quotations, thanks Gmail
JavaScript
mit
EvgenyKarataev/github-plus-university,jdavis/github-plus-university,EvgenyKarataev/github-plus-university
--- +++ @@ -1,4 +1,4 @@ -exports.TOKEN = ‘TOKEN HERE’; -exports.SESSION_SECRET = ‘SESSION SECRET HERE’; -exports.CLIENT_ID = ‘CLIENT ID HERE’; -exports.CLIENT_SECRET = ‘CLIENT SECRET HERE’; +exports.TOKEN = 'TOKEN HERE'; +exports.SESSION_SECRET = 'SESSION SECRET HERE'; +exports.CLIENT_ID = 'CLIENT ID HERE'; +exports.CLIENT_SECRET = 'CLIENT SECRET HERE';
fb626e46ae3531f5d9727672f74bbc5be0ee2ef4
src/actions/UIActions.js
src/actions/UIActions.js
import * as types from '../constants/ActionTypes' export function selectKey(id) { return { type: types.SELECT_KEY, id } } export function toggleCompose() { return { type: types.TOGGLE_COMPOSE } } export function showComposeWithType(type) { return { type: types.SHOW_COMPOSE_WITH_TYPE, data: type } }
import * as types from '../constants/UIConstants' export function selectKey(id) { return { type: types.SELECT_KEY, id } } export function toggleCompose() { return { type: types.TOGGLE_COMPOSE } } export function showComposeWithType(type) { return { type: types.SHOW_COMPOSE_WITH_TYPE, data: type } }
Use new constant file name
Use new constant file name
JavaScript
mit
henryboldi/felony,tobycyanide/felony,henryboldi/felony,tobycyanide/felony
--- +++ @@ -1,4 +1,4 @@ -import * as types from '../constants/ActionTypes' +import * as types from '../constants/UIConstants' export function selectKey(id) { return { type: types.SELECT_KEY, id }
cdfdf89781544ee9fb279fb0d007c1ea32be5d29
game-manager.js
game-manager.js
define("game-manager", ["game"], function(Game) { function GameManager() { this.games = this.load() || []; this.next_id = this.getNextId(); } GameManager.prototype = { addGame: function() { var game = new Game(this.next_id++); this.games.push(game); this.save(); return game; }, deleteGame: function(game) { var index = this.games.indexOf(game); if (index == -1) throw new Error("Bad game"); this.games.splice(index, 1); }, findGame: function(id) { for (var i = 0; i < this.games.length; i++) if (this.games[i].id == id) return this.games[i]; }, listGames: function() { return this.games; }, getNextId: function() { var next = 1; this.games.forEach(function(g) { next = Math.max(next, g.id + 1); }); return next; }, load: function() { return (JSON.parse(localStorage.getItem('games')) || []).map(function(game) { return new Game(game.id, game); }); }, save: function() { localStorage.setItem('games', JSON.stringify(this.games)); }, }; return GameManager; });
define("game-manager", ["game"], function(Game) { function GameManager() { this.games = this.load() || []; this.next_id = this.getNextId(); } GameManager.prototype = { addGame: function() { var game = new Game(this.next_id++); this.games.push(game); this.save(); return game; }, deleteGame: function(game) { var index = this.games.indexOf(game); if (index == -1) throw new Error("Bad game"); this.games.splice(index, 1); }, findGame: function(id) { for (var i = 0; i < this.games.length; i++) if (this.games[i].id == id) return this.games[i]; }, listGames: function() { return this.games; }, getNextId: function() { var next = 1; this.games.forEach(function(g) { next = Math.max(next, g.id + 1); }); return next; }, load: function() { return (JSON.parse(localStorage.getItem('games')) || []).map(function(game) { return new Game(game.id, game); }); }, save: function() { // remove "deleted": false fields from all logs (unnecessary) this.games.map(function(game) { game.log.map(function(e) { if (!e.deleted) e.deleted = undefined; }); }); localStorage.setItem('games', JSON.stringify(this.games)); }, }; return GameManager; });
Save a bit of space when saving logs
Save a bit of space when saving logs
JavaScript
mit
lethosor/clue-solver,lethosor/clue-solver
--- +++ @@ -38,6 +38,13 @@ }); }, save: function() { + // remove "deleted": false fields from all logs (unnecessary) + this.games.map(function(game) { + game.log.map(function(e) { + if (!e.deleted) + e.deleted = undefined; + }); + }); localStorage.setItem('games', JSON.stringify(this.games)); }, };
e59a9f57bcc8b164f010c56d7cfd00304532151a
server.js
server.js
// Generated by CoffeeScript 1.6.3 (function() { var clicks, io, tones; io = require('socket.io').listen(process.env.PORT || 8888); clicks = []; tones = io.of('/tones').on('connection', function(socket) { socket.on('greeting', function(data) { console.log(data); return socket.emit('greeting', { greeting: 'Hello client!' }); }); socket.emit('grid status', { clicks: clicks }); return socket.on('grid click', function(data) { console.log(data); clicks.push(data); return socket.broadcast.emit('grid click', { element: data.element, sender: data.sender }); }); }); }).call(this);
// Generated by CoffeeScript 1.6.3 (function() { var clicks, io, tones; var app = require('http').createServer(function() {}); io = require('socket.io').listen(app); clicks = []; tones = io.of('/tones').on('connection', function(socket) { socket.on('greeting', function(data) { console.log(data); return socket.emit('greeting', { greeting: 'Hello client!' }); }); socket.emit('grid status', { clicks: clicks }); return socket.on('grid click', function(data) { console.log(data); clicks.push(data); return socket.broadcast.emit('grid click', { element: data.element, sender: data.sender }); }); }); app.listen(process.env.PORT || 8888); }).call(this);
Fix problem with startup on heroku
Fix problem with startup on heroku Had to surround socket.io with an http server to run on heroku.
JavaScript
mit
mgarbacz/adventure-tone-socket
--- +++ @@ -2,7 +2,8 @@ (function() { var clicks, io, tones; - io = require('socket.io').listen(process.env.PORT || 8888); + var app = require('http').createServer(function() {}); + io = require('socket.io').listen(app); clicks = []; @@ -26,4 +27,6 @@ }); }); + app.listen(process.env.PORT || 8888); + }).call(this);
98cc9c390320f83f03ef6f5e4527a9fd67719f80
src/model/clients.js
src/model/clients.js
'use strict' import { Schema } from 'mongoose' import { connectionAPI, connectionDefault } from '../config' const ClientSchema = new Schema({ clientID: { type: String, required: true, unique: true, index: true }, clientDomain: { type: String, index: true }, name: { type: String, required: true }, roles: [{type: String, required: true}], passwordAlgorithm: String, passwordHash: String, passwordSalt: String, certFingerprint: String, organization: String, location: String, softwareName: String, description: String, contactPerson: String, contactPersonEmail: String }) // compile the Client Schema into a Model export const ClientModelAPI = connectionAPI.model('Client', ClientSchema) export const ClientModel = connectionDefault.model('Client', ClientSchema)
'use strict' import { Schema } from 'mongoose' import { connectionAPI, connectionDefault } from '../config' const ClientSchema = new Schema({ clientID: { type: String, required: true, unique: true, index: true }, clientDomain: { type: String, index: true }, name: { type: String, required: true }, roles: [{ type: String, required: true }], passwordAlgorithm: String, passwordHash: String, passwordSalt: String, certFingerprint: String, organization: String, location: String, softwareName: String, description: String, contactPerson: String, contactPersonEmail: String }) export const ClientModelAPI = connectionAPI.model('Client', ClientSchema) export const ClientModel = connectionDefault.model('Client', ClientSchema)
Format the client model schema
Format the client model schema Boyscout TRACE-131
JavaScript
mpl-2.0
jembi/openhim-core-js,jembi/openhim-core-js
--- +++ @@ -6,15 +6,20 @@ const ClientSchema = new Schema({ clientID: { - type: String, required: true, unique: true, index: true + type: String, + required: true, + unique: true, + index: true }, clientDomain: { - type: String, index: true + type: String, + index: true }, name: { - type: String, required: true + type: String, + required: true }, - roles: [{type: String, required: true}], + roles: [{ type: String, required: true }], passwordAlgorithm: String, passwordHash: String, passwordSalt: String, @@ -27,6 +32,5 @@ contactPersonEmail: String }) -// compile the Client Schema into a Model export const ClientModelAPI = connectionAPI.model('Client', ClientSchema) export const ClientModel = connectionDefault.model('Client', ClientSchema)
a38fc2ae352996e3401e903bd39475326d7fc8c5
js/repeater.js
js/repeater.js
/* global wp, _, kirki */ wp.customize.controlConstructor['kirki-repeater'] = wp.customize.kirkiDynamicControl.extend( { initKirkiControl: function() { var control = this, rowDefaults = {}; _.each( control.params.fields, function( field, key ) { rowDefaults[ key ] = ( ! _.isUndefined( field['default'] ) ) ? field['default'] : ''; } ); control.container.html( kirki.template.repeaterControl( control ) ); control.container.find( '.add-row' ).click( function() { jQuery( control.container.find( '.repeater-fields' ) ) .append( kirki.template.repeaterControlRow( control, rowDefaults ) ); }); } } );
/* global wp, _, kirki */ wp.customize.controlConstructor['kirki-repeater'] = wp.customize.kirkiDynamicControl.extend( { initKirkiControl: function() { var control = this; control.container.html( kirki.template.repeaterControl( control ) ); control.repeaterRowAddButton(); control.repeaterRowRemoveButton(); }, /** * Actions to run when clicking on the "add row" button. */ repeaterRowAddButton: function() { var control = this, rowDefaults = {}; _.each( control.params.fields, function( field, key ) { rowDefaults[ key ] = ( ! _.isUndefined( field['default'] ) ) ? field['default'] : ''; } ); control.container.find( '.add-row' ).click( function() { jQuery( control.container.find( '.repeater-fields' ) ) .append( kirki.template.repeaterControlRow( control, rowDefaults ) ); }); }, /** * Actions to run when clicking on the "remove row" button. */ repeaterRowRemoveButton: function() { var control = this; control.container.find( '.repeater-row-remove-button' ).click( function( e ) { jQuery( this ).parents( '.row-template' ).remove(); }); } } );
Add row & remove row primers
Add row & remove row primers
JavaScript
mit
aristath/kirki-controls,aristath/kirki-controls
--- +++ @@ -1,18 +1,40 @@ /* global wp, _, kirki */ wp.customize.controlConstructor['kirki-repeater'] = wp.customize.kirkiDynamicControl.extend( { initKirkiControl: function() { - var control = this, + var control = this; + + control.container.html( kirki.template.repeaterControl( control ) ); + + control.repeaterRowAddButton(); + control.repeaterRowRemoveButton(); + + }, + + /** + * Actions to run when clicking on the "add row" button. + */ + repeaterRowAddButton: function() { + var control = this, rowDefaults = {}; _.each( control.params.fields, function( field, key ) { rowDefaults[ key ] = ( ! _.isUndefined( field['default'] ) ) ? field['default'] : ''; } ); - control.container.html( kirki.template.repeaterControl( control ) ); - control.container.find( '.add-row' ).click( function() { jQuery( control.container.find( '.repeater-fields' ) ) .append( kirki.template.repeaterControlRow( control, rowDefaults ) ); }); + }, + + /** + * Actions to run when clicking on the "remove row" button. + */ + repeaterRowRemoveButton: function() { + var control = this; + + control.container.find( '.repeater-row-remove-button' ).click( function( e ) { + jQuery( this ).parents( '.row-template' ).remove(); + }); } } );
e29963ef0d90c42e0d96fcda39e25b10a8a0583c
server.js
server.js
let PROTO_PATH = __dirname + "/wkrpt401.proto" let grpc = require('grpc'); let proto = grpc.load(PROTO_PATH).wkrpt401; function getBestPersonality(call, callback) { let userData = call.request; let name = userData.name; let level = userData.level; var maxPersonalityName = ""; var maxPersonalityValue = -1; for (var i in userData.personality) { let personalityName = userData.personality[i].name; let personalityValue = userData.personality[i].amount; if (personalityValue > maxPersonalityValue) { maxPersonalityName = personalityName; maxPersonalityValue = personalityValue; } } let response = "The best personality attribute for " + name + " (Lv. " + level + ") is " + maxPersonalityName + " @ " + maxPersonalityValue; console.log("getBestPersonality called with response '" + response + "'"); callback(null, {response: response}); } function main() { var server = new grpc.Server(); server.addProtoService(proto.UserManager.service, {getBestPersonality: getBestPersonality}); server.bind("localhost:50051", grpc.ServerCredentials.createInsecure()); server.start(); console.log("WKRPT401 gRPC server starting."); } main();
let PROTO_PATH = __dirname + "/wkrpt401.proto" let grpc = require('grpc'); let proto = grpc.load(PROTO_PATH).wkrpt401; var requestCount = 0 function getBestPersonality(call, callback) { let userData = call.request; let name = userData.name; let level = userData.level; var maxPersonalityName = ""; var maxPersonalityValue = -1; for (var i in userData.personality) { let personalityName = userData.personality[i].name; let personalityValue = userData.personality[i].amount; if (personalityValue > maxPersonalityValue) { maxPersonalityName = personalityName; maxPersonalityValue = personalityValue; } } let response = "The best personality attribute for " + name + " (Lv. " + level + ") is " + maxPersonalityName + " @ " + maxPersonalityValue; requestCount++ console.log("getBestPersonality called with response '" + response + "'" + " (request #" + requestCount + ")"); callback(null, {response: response}); } function main() { var server = new grpc.Server(); server.addProtoService(proto.UserManager.service, {getBestPersonality: getBestPersonality}); server.bind("localhost:50051", grpc.ServerCredentials.createInsecure()); server.start(); console.log("WKRPT401 gRPC server starting."); } main();
Add request counter to logging
Add request counter to logging
JavaScript
mit
lloydtorres/wkrpt401-grpc
--- +++ @@ -2,6 +2,8 @@ let grpc = require('grpc'); let proto = grpc.load(PROTO_PATH).wkrpt401; + +var requestCount = 0 function getBestPersonality(call, callback) { let userData = call.request; @@ -23,7 +25,8 @@ + " (Lv. " + level + ") is " + maxPersonalityName + " @ " + maxPersonalityValue; - console.log("getBestPersonality called with response '" + response + "'"); + requestCount++ + console.log("getBestPersonality called with response '" + response + "'" + " (request #" + requestCount + ")"); callback(null, {response: response}); }
2d66d246d15a87427a65af64e9152013536e8b24
sidney.js
sidney.js
var example = require("washington") var assert = require("assert") example("Async: by default") example("Endpoint: match with glob style wildcards") example("Repeater: Repeat events back and forth on repeater venue") example("Repeater: Scope out prefix when sending to repeater") example("Repeater: Add prefix when receiving from repeater")
var example = require("washington") var assert = require("assert") example("Async: by default") example("Endpoint: match with glob style wildcards") example("Repeater: Repeat events back and forth on repeater venue") example("Repeater: Scope out prefix when sending to repeater") example("Repeater: Add prefix when receiving from repeater") example("Configuration: disable async per call") example("Configuration: disable async per venue") example("Configuration: set event clone to shallow per call") example("Configuration: set event clone to disabled per call") example("Configuration: set event clone to shallow per venue") example("Configuration: set event clone to disabled per venue") console.log("Notes: add Mediador as static dependency (Bower instead of NPM)") console.log("Notes: develop Sidney on src/ dir, expose build on root") console.log("Notes: use tasks for static building of sidney")
Add configuration requirements and building notes
Add configuration requirements and building notes
JavaScript
isc
xaviervia/sydney,xaviervia/sydney
--- +++ @@ -10,3 +10,21 @@ example("Repeater: Scope out prefix when sending to repeater") example("Repeater: Add prefix when receiving from repeater") + +example("Configuration: disable async per call") + +example("Configuration: disable async per venue") + +example("Configuration: set event clone to shallow per call") + +example("Configuration: set event clone to disabled per call") + +example("Configuration: set event clone to shallow per venue") + +example("Configuration: set event clone to disabled per venue") + +console.log("Notes: add Mediador as static dependency (Bower instead of NPM)") + +console.log("Notes: develop Sidney on src/ dir, expose build on root") + +console.log("Notes: use tasks for static building of sidney")
c508e7e79b0413d45884ab5b7c0ad6401bead806
tests/test.bulk_docs.js
tests/test.bulk_docs.js
module('bulk_docs', { setup : function () { this.name = 'test' + genDBName(); } }); asyncTest('Testing bulk docs', function() { pouch.open(this.name, function(err, db) { var docs = makeDocs(5); db.bulkDocs({docs: docs}, function(err, results) { ok(results.length === 5, 'results length matches'); for (var i = 0; i < 5; i++) { ok(results[i].id === docs[i]._id, 'id matches'); ok(results[i].rev, 'rev is set'); // Update the doc docs[i]._rev = results[i].rev; docs[i].string = docs[i].string + ".00"; } db.bulkDocs({docs: docs}, function(err, results) { ok(results.length === 5, 'results length matches'); for (i = 0; i < 5; i++) { ok(results[i].id == i.toString(), 'id matches again'); // set the delete flag to delete the docs in the next step docs[i]._deleted = true; } start(); }); }); }); });
module('bulk_docs', { setup : function () { this.name = 'test' + genDBName(); } }); asyncTest('Testing bulk docs', function() { pouch.open(this.name, function(err, db) { var docs = makeDocs(5); db.bulkDocs({docs: docs}, function(err, results) { ok(results.length === 5, 'results length matches'); for (var i = 0; i < 5; i++) { ok(results[i].id === docs[i]._id, 'id matches'); ok(results[i].rev, 'rev is set'); // Update the doc docs[i]._rev = results[i].rev; docs[i].string = docs[i].string + ".00"; } db.bulkDocs({docs: docs}, function(err, results) { ok(results.length === 5, 'results length matches'); for (i = 0; i < 5; i++) { ok(results[i].id == i.toString(), 'id matches again'); // set the delete flag to delete the docs in the next step docs[i]._rev = results[i].rev; docs[i]._deleted = true; } db.put(docs[0], function(err, doc) { db.bulkDocs({docs: docs}, function(err, results) { ok(results[0].error === 'conflict', 'First doc should be in conflict'); ok(typeof results[0].rev === "undefined", 'no rev in conflict'); for (i = 1; i < 5; i++) { ok(results[i].id == i.toString()); ok(results[i].rev); } start(); }); }); }); }); }); });
Add to bulk docs testing
Add to bulk docs testing
JavaScript
apache-2.0
crissdev/pouchdb,greyhwndz/pouchdb,elkingtonmcb/pouchdb,h4ki/pouchdb,lukevanhorn/pouchdb,tyler-johnson/pouchdb,mainerror/pouchdb,yaronyg/pouchdb,shimaore/pouchdb,ramdhavepreetam/pouchdb,seigel/pouchdb,willholley/pouchdb,ntwcklng/pouchdb,adamvert/pouchdb,Dashed/pouchdb,Charlotteis/pouchdb,patrickgrey/pouchdb,mikeymckay/pouchdb,janraasch/pouchdb,lakhansamani/pouchdb,tohagan/pouchdb,willholley/pouchdb,HospitalRun/pouchdb,mwksl/pouchdb,ntwcklng/pouchdb,tyler-johnson/pouchdb,evidenceprime/pouchdb,cesine/pouchdb,crissdev/pouchdb,elkingtonmcb/pouchdb,ramdhavepreetam/pouchdb,slaskis/pouchdb,mattbailey/pouchdb,TechnicalPursuit/pouchdb,adamvert/pouchdb,cshum/pouchdb,marcusandre/pouchdb,TechnicalPursuit/pouchdb,cdaringe/pouchdb,janl/pouchdb,mainerror/pouchdb,callahanchris/pouchdb,tohagan/pouchdb,KlausTrainer/pouchdb,nicolasbrugneaux/pouchdb,KlausTrainer/pouchdb,Actonate/pouchdb,lakhansamani/pouchdb,Knowledge-OTP/pouchdb,cdaringe/pouchdb,HospitalRun/pouchdb,KlausTrainer/pouchdb,asmiller/pouchdb,mattbailey/pouchdb,microlv/pouchdb,jhs/pouchdb,pouchdb/pouchdb,asmiller/pouchdb,lukevanhorn/pouchdb,johnofkorea/pouchdb,mikeymckay/pouchdb,mattbailey/pouchdb,caolan/pouchdb,tohagan/pouchdb,janraasch/pouchdb,TechnicalPursuit/pouchdb,callahanchris/pouchdb,optikfluffel/pouchdb,p5150j/pouchdb,colinskow/pouchdb,Dashed/pouchdb,slang800/pouchdb,bbenezech/pouchdb,mwksl/pouchdb,Charlotteis/pouchdb,marcusandre/pouchdb,nickcolley/pouchdb,mwksl/pouchdb,greyhwndz/pouchdb,callahanchris/pouchdb,daleharvey/pouchdb,cdaringe/pouchdb,Dashed/pouchdb,bbenezech/pouchdb,nickcolley/pouchdb,mikeymckay/pouchdb,cshum/pouchdb,HospitalRun/pouchdb,h4ki/pouchdb,marcusandre/pouchdb,colinskow/pouchdb,willholley/pouchdb,patrickgrey/pouchdb,daleharvey/pouchdb,lakhansamani/pouchdb,crissdev/pouchdb,shimaore/pouchdb,nicolasbrugneaux/pouchdb,spMatti/pouchdb,jhs/pouchdb,ntwcklng/pouchdb,slaskis/pouchdb,Knowledge-OTP/pouchdb,microlv/pouchdb,spMatti/pouchdb,patrickgrey/pouchdb,optikfluffel/pouchdb,adamvert/pouchdb,seigel/pouchdb,cshum/pouchdb,pouchdb/pouchdb,yaronyg/pouchdb,Charlotteis/pouchdb,ramdhavepreetam/pouchdb,garrensmith/pouchdb,mainerror/pouchdb,bbenezech/pouchdb,optikfluffel/pouchdb,spMatti/pouchdb,garrensmith/pouchdb,cesarmarinhorj/pouchdb,olafura/pouchdb,Actonate/pouchdb,janl/pouchdb,janraasch/pouchdb,janl/pouchdb,asmiller/pouchdb,jhs/pouchdb,garrensmith/pouchdb,slaskis/pouchdb,Knowledge-OTP/pouchdb,yaronyg/pouchdb,colinskow/pouchdb,slang800/pouchdb,cesine/pouchdb,slang800/pouchdb,pouchdb/pouchdb,nicolasbrugneaux/pouchdb,daleharvey/pouchdb,johnofkorea/pouchdb,tyler-johnson/pouchdb,nickcolley/pouchdb,shimaore/pouchdb,h4ki/pouchdb,cesarmarinhorj/pouchdb,Actonate/pouchdb,elkingtonmcb/pouchdb,microlv/pouchdb,cesarmarinhorj/pouchdb,johnofkorea/pouchdb,maxogden/pouchdb,seigel/pouchdb,lukevanhorn/pouchdb,mikeal/pouchdb,p5150j/pouchdb,p5150j/pouchdb,greyhwndz/pouchdb
--- +++ @@ -21,9 +21,20 @@ for (i = 0; i < 5; i++) { ok(results[i].id == i.toString(), 'id matches again'); // set the delete flag to delete the docs in the next step + docs[i]._rev = results[i].rev; docs[i]._deleted = true; } - start(); + db.put(docs[0], function(err, doc) { + db.bulkDocs({docs: docs}, function(err, results) { + ok(results[0].error === 'conflict', 'First doc should be in conflict'); + ok(typeof results[0].rev === "undefined", 'no rev in conflict'); + for (i = 1; i < 5; i++) { + ok(results[i].id == i.toString()); + ok(results[i].rev); + } + start(); + }); + }); }); }); });
cf4765a1df10adf26ef8f85429be6cdbce7e3e5b
lib/util/DeflateRawChecksum.js
lib/util/DeflateRawChecksum.js
var zlib = require('zlib'); var inherits = require('util').inherits; var util = require('./'); function DeflateRawChecksum(options) { zlib.DeflateRaw.call(this, options); this.checksum = util.crc32.createCRC32(); this.digest = null; this.rawSize = 0; this.compressedSize = 0; this.on('data', function(chunk) { this.compressedSize += chunk.length; }); this.on('end', function() { this.digest = this.checksum.digest(); }); } inherits(DeflateRawChecksum, zlib.DeflateRaw); DeflateRawChecksum.prototype._transform = function(chunk, encoding, callback) { if (chunk) { this.checksum.update(chunk); this.rawSize += chunk.length; } return zlib.DeflateRaw.prototype._transform.call(this, chunk, encoding, callback); }; module.exports = DeflateRawChecksum;
var zlib = require('zlib'); var inherits = require('util').inherits; var util = require('./'); function DeflateRawChecksum(options) { zlib.DeflateRaw.call(this, options); this.checksum = util.crc32.createCRC32(); this.digest = null; this.rawSize = 0; this.compressedSize = 0; this.on('data', function(chunk) { this.compressedSize += chunk.length; }); this.on('end', function() { this.digest = this.checksum.digest(); }); } inherits(DeflateRawChecksum, zlib.DeflateRaw); DeflateRawChecksum.prototype.write = function(chunk, cb) { if (chunk) { this.checksum.update(chunk); this.rawSize += chunk.length; } return zlib.DeflateRaw.prototype.write.call(this, chunk, cb); }; module.exports = DeflateRawChecksum;
Revert "util: make DeflateRaw Checksum hook into _transform so that it mimicks the norms."
Revert "util: make DeflateRaw Checksum hook into _transform so that it mimicks the norms." This reverts commit cf22d920b48c3c320b0a7a75577b082901db07a6.
JavaScript
mit
djchie/node-archiver,lotterfriends/node-archiver,yavorski/node-archiver,soyuka/node-archiver,haledeng/node-archiver,soyuka/node-archiver,archiverjs/node-archiver
--- +++ @@ -23,13 +23,13 @@ inherits(DeflateRawChecksum, zlib.DeflateRaw); -DeflateRawChecksum.prototype._transform = function(chunk, encoding, callback) { +DeflateRawChecksum.prototype.write = function(chunk, cb) { if (chunk) { this.checksum.update(chunk); this.rawSize += chunk.length; } - return zlib.DeflateRaw.prototype._transform.call(this, chunk, encoding, callback); + return zlib.DeflateRaw.prototype.write.call(this, chunk, cb); }; module.exports = DeflateRawChecksum;
f7a0cba8a99686f9c1e697a106df62bda90caf56
lib/CssRule.js
lib/CssRule.js
/*! Parker v0.0.0 - MIT license */ 'use strict'; var _ = require('underscore'); function CssRule(raw) { this.raw = raw; } CssRule.prototype.getSelectors = function () { return getSelectors(getSelectorBlock(this.raw)); }; CssRule.prototype.getDeclarations = function () { return getDeclarations(getDeclarationBlock(this.raw)); }; var getSelectorBlock = function (rule) { var pattern = /([\w,\.#\-\[\]\"=\s:>]+)[\s]?\{/g, results = pattern.exec(rule); return results[1]; }; var getSelectors = function (selectorBlock) { var untrimmedSelectors = selectorBlock.split(','), trimmedSelectors = untrimmedSelectors.map(function (untrimmed) { return untrimmed.trim(); }); return trimmedSelectors; }; var getDeclarationBlock = function (rule) { var pattern = /\{(.+)\}/g; return pattern.exec(rule)[1]; }; var getDeclarations = function (declarationBlock) { var untrimmedDeclarations = _.compact(declarationBlock.trim().split(';')), trimmedDeclarations = untrimmedDeclarations.map(function (untrimmed) { return untrimmed.trim(); }); return trimmedDeclarations; }; module.exports = CssRule;
/*! Parker v0.0.0 - MIT license */ 'use strict'; var _ = require('underscore'); function CssRule(raw) { this.raw = raw; } CssRule.prototype.getSelectors = function () { return getSelectors(getSelectorBlock(this.raw)); }; CssRule.prototype.getDeclarations = function () { return getDeclarations(getDeclarationBlock(this.raw)); }; var getSelectorBlock = function (rule) { var pattern = /([\w,\.#\-\[\]\"=\s:>\*\(\)]+)[\s]?\{/g, results = pattern.exec(rule); return results[1]; }; var getSelectors = function (selectorBlock) { var untrimmedSelectors = selectorBlock.split(','), trimmedSelectors = untrimmedSelectors.map(function (untrimmed) { return untrimmed.trim(); }); return trimmedSelectors; }; var getDeclarationBlock = function (rule) { var pattern = /\{(.+)\}/g; return pattern.exec(rule)[1]; }; var getDeclarations = function (declarationBlock) { var untrimmedDeclarations = _.compact(declarationBlock.trim().split(';')), trimmedDeclarations = untrimmedDeclarations.map(function (untrimmed) { return untrimmed.trim(); }); return trimmedDeclarations; }; module.exports = CssRule;
Fix for universal identifier and not identifier not being recognised
Fix for universal identifier and not identifier not being recognised
JavaScript
mit
tzi/parker,seanislegend/parker,researchgate/parker,joshuacc/parker,tpgmartin/parker,caolan/parker,katiefenn/parker
--- +++ @@ -17,7 +17,7 @@ }; var getSelectorBlock = function (rule) { - var pattern = /([\w,\.#\-\[\]\"=\s:>]+)[\s]?\{/g, + var pattern = /([\w,\.#\-\[\]\"=\s:>\*\(\)]+)[\s]?\{/g, results = pattern.exec(rule); return results[1];
07ee9f58931cdfbc7ba2f44e07ddf7fcc6bdc732
js/ListScript.js
js/ListScript.js
$(document).ready(function() { var addItem = function() { $('.mainList').append('<li class="listItem"><input id="check" class="checkBox" type="checkbox"><input class="textInp" type="text" placeholder="..."></li>'); }; var itemDone = function() { if ($(this).is(':checked')) { alert("Checked!"); } else { alert("Unchecked!"); } }; $('.mainList').on('click', '#check', itemDone); $('.addItem').click(addItem); });
$(document).ready(function() { var addItem = function() { $('.mainList').append('<li class="listItem"><input id="check" class="checkBox" type="checkbox"><input class="textInp" type="text" placeholder="Add Item..."></li>'); }; var itemDone = function() { var $this = $(this); $this.parent().fadeOut(600, function() { $this.parent().remove(); }); }; $('.mainList').on('click', '#check', itemDone); $('.addItem').click(addItem); });
Make list items fade out on check.
Make list items fade out on check.
JavaScript
mit
halverson/teenytiny_TodoList,halverson/teenytiny_TodoList
--- +++ @@ -1,15 +1,14 @@ $(document).ready(function() { var addItem = function() { - $('.mainList').append('<li class="listItem"><input id="check" class="checkBox" type="checkbox"><input class="textInp" type="text" placeholder="..."></li>'); + $('.mainList').append('<li class="listItem"><input id="check" class="checkBox" type="checkbox"><input class="textInp" type="text" placeholder="Add Item..."></li>'); }; var itemDone = function() { - if ($(this).is(':checked')) { - alert("Checked!"); - } else { - alert("Unchecked!"); - } + var $this = $(this); + $this.parent().fadeOut(600, function() { + $this.parent().remove(); + }); }; $('.mainList').on('click', '#check', itemDone);
0284317a21e51f7aadceb9c624e7cda7ecda31da
lib/cli/index.js
lib/cli/index.js
'use strict'; var co6 = require('co6'); var fs = co6.promisifyAll(require('fs')); var os = require('os'); var parse = require('./parse'); var server = require('../server'); /* * Run the command line application. */ co6.main(function *() { var options = parse(process.argv); var source = options.source || 'MangaRack.txt'; var tasks = options.args.length ? args(options) : yield batch(source); yield server(tasks, options.workers || os.cpus().length, console.log); console.log('Completed!'); }); /** * Process the arguments. * @param {!Options} options * @return {!Array.<!{address: string, !Options}>} */ function args(options) { var tasks = []; options.args.forEach(function (address) { tasks.push({address: address, options: options}); }); console.log('meh'); return tasks; } /** * Process the batch file. * @param {string} filePath * @return {!Array.<!{address: string, !Options}>} */ function *batch(filePath) { var tasks = []; if (!(yield fs.existsAsync(filePath))) return tasks; yield fs.readFileAsync(filePath, 'utf8').split('\n').forEach(function (n) { var lineOptions = parse(n.split(' ')); lineOptions.args.forEach(function (address) { tasks.push({address: address, options: lineOptions}); }); }); return tasks; }
'use strict'; var co6 = require('co6'); var fs = co6.promisifyAll(require('fs')); var os = require('os'); var parse = require('./parse'); var server = require('../server'); /* * Run the command line application. */ co6.main(function *() { var options = parse(process.argv); var source = options.source || 'MangaRack.txt'; var tasks = options.args.length ? args(options) : yield batch(source); yield server(tasks, options.workers || os.cpus().length, console.log); console.log('Completed!'); }); /** * Process the arguments. * @param {!Options} options * @return {!Array.<!{address: string, !Options}>} */ function args(options) { var tasks = []; options.args.forEach(function (address) { tasks.push({address: address, options: options}); }); console.log('meh'); return tasks; } /** * Process the batch file. * @param {string} path * @return {!Array.<!{address: string, !Options}>} */ function *batch(path) { var tasks = []; if (!(yield fs.existsAsync(path))) return tasks; (yield fs.readFileAsync(path, 'utf8')).split('\n').forEach(function (n) { var lineOptions = parse(n.split(' ')); lineOptions.args.forEach(function (address) { tasks.push({address: address, options: lineOptions}); }); }); return tasks; }
Fix the cli batch processing yield
Fix the cli batch processing yield
JavaScript
mit
MangaRack/mangarack,Deathspike/mangarack.js,MangaRack/mangarack,Deathspike/mangarack.js,Deathspike/mangarack.js,MangaRack/mangarack
--- +++ @@ -32,13 +32,13 @@ /** * Process the batch file. - * @param {string} filePath + * @param {string} path * @return {!Array.<!{address: string, !Options}>} */ -function *batch(filePath) { +function *batch(path) { var tasks = []; - if (!(yield fs.existsAsync(filePath))) return tasks; - yield fs.readFileAsync(filePath, 'utf8').split('\n').forEach(function (n) { + if (!(yield fs.existsAsync(path))) return tasks; + (yield fs.readFileAsync(path, 'utf8')).split('\n').forEach(function (n) { var lineOptions = parse(n.split(' ')); lineOptions.args.forEach(function (address) { tasks.push({address: address, options: lineOptions});
612a6c84313f137d173c9fe4cf4b73dd34241b87
views/combo_box_view.js
views/combo_box_view.js
//= require ./select_button_view //= require ./text_field_view Flame.ComboBoxView = Flame.SelectButtonView.extend({ classNames: ['flame-combo-box-view'], childViews: 'textView buttonView'.w(), handlebars: undefined, acceptsKeyResponder: false, textView: Flame.TextFieldView.extend({ layout: { left: 0, right: 0 }, valueBinding: 'parentView.value' }), insertSpace: function() { return false; }, buttonView: Flame.ButtonView.extend({ acceptsKeyResponder: false, handlebars: '<img src="%@">'.fmt(Flame.image('select_button_arrow.png')), layout: { right: -5, width: 22, height: 22 }, action: function() { this.get('parentView')._openMenu(); } }) });
//= require ./select_button_view //= require ./text_field_view Flame.ComboBoxView = Flame.SelectButtonView.extend({ classNames: ['flame-combo-box-view'], childViews: 'textView buttonView'.w(), handlebars: undefined, acceptsKeyResponder: false, textView: Flame.TextFieldView.extend({ layout: { left: 0, right: 3 }, valueBinding: 'parentView.value' }), insertSpace: function() { return false; }, buttonView: Flame.ButtonView.extend({ acceptsKeyResponder: false, handlebars: '<img src="%@">'.fmt(Flame.image('select_button_arrow.png')), layout: { right: -2, width: 22, height: 22 }, action: function() { this.get('parentView')._openMenu(); } }) });
Fix Combo box margin issue
Fix Combo box margin issue
JavaScript
mit
lalnuo/flame.js,lalnuo/flame.js,lalnuo/flame.js,renotoaster/flame.js,renotoaster/flame.js,mattijauhiainen/flame.js,flamejs/flame.js,mattijauhiainen/flame.js
--- +++ @@ -8,7 +8,7 @@ acceptsKeyResponder: false, textView: Flame.TextFieldView.extend({ - layout: { left: 0, right: 0 }, + layout: { left: 0, right: 3 }, valueBinding: 'parentView.value' }), @@ -17,7 +17,7 @@ buttonView: Flame.ButtonView.extend({ acceptsKeyResponder: false, handlebars: '<img src="%@">'.fmt(Flame.image('select_button_arrow.png')), - layout: { right: -5, width: 22, height: 22 }, + layout: { right: -2, width: 22, height: 22 }, action: function() { this.get('parentView')._openMenu();
eac12c07f01aee95a3c911af3e149c77ccba1714
src/util/Clusters.js
src/util/Clusters.js
import { hierarchy } from 'd3-hierarchy'; export default class Clusters { constructor () { this.data = { children: [ { cluster: 'non-anomalous', value: 0 }, { cluster: 'anomalous', value: 0, children: [] } ] }; } add () { this.data.children[0].value++; } remove () { this.data.children[0].value--; } addAnomalous (cluster) { this.ensureCluster(cluster); this.data.children[1].children[cluster].value++; } removeAnomalous (cluster) { this.data.children[1].children[cluster].value--; } ensureCluster (cluster) { if (this.data.children[1].children.length <= cluster) { for (let i = this.data.children[1].children.length; i < cluster + 1; i++) { this.data.children[1].children[i] = { cluster: i, value: 0 }; } } } hierarchy () { return hierarchy(this.data) .sum(d => d.value || 0.1); } count () { return this.data.children[0].value; } anomalousCounts () { return this.data.children[1].children .sort((a, b) => a.cluster - b.cluster) .map(d => d.value); } }
import { hierarchy } from 'd3-hierarchy'; export default class Clusters { constructor () { this.data = { children: [ { cluster: 'non-anomalous', value: 0 }, { cluster: 'anomalous', value: 0, children: [] } ] }; } add () { this.data.children[0].value++; } remove () { this.data.children[0].value--; } addAnomalous (cluster) { this.ensureCluster(cluster); this.data.children[1].children[cluster].value++; } removeAnomalous (cluster) { this.data.children[1].children[cluster].value--; } ensureCluster (cluster) { if (this.data.children[1].children.length <= cluster) { for (let i = this.data.children[1].children.length; i < cluster + 1; i++) { this.data.children[1].children[i] = { cluster: i, value: 0 }; } } } hierarchy () { return hierarchy(this.data) .sum(d => d.value || 0.01); } count () { return this.data.children[0].value; } anomalousCounts () { return this.data.children[1].children .sort((a, b) => a.cluster - b.cluster) .map(d => d.value); } }
Make zero-element bubbles a bit smaller
Make zero-element bubbles a bit smaller
JavaScript
apache-2.0
ronichoudhury-work/bsides2017,ronichoudhury-work/bsides2017
--- +++ @@ -47,7 +47,7 @@ hierarchy () { return hierarchy(this.data) - .sum(d => d.value || 0.1); + .sum(d => d.value || 0.01); } count () {
25914bfe922ce8f17231bdaebecfef247dc82d0a
models/rating.js
models/rating.js
module.exports = function (sequelize, DataTypes) { const Rating = sequelize.define('Rating', { id: { primaryKey: true, type: DataTypes.UUID, defaultValue: DataTypes.UUIDV4 }, value: { type: DataTypes.INTEGER, allowNull: false, validate: { min: 0 } }, BikeId: { type: DataTypes.UUID, allowNull: false }, VoteId: { type: DataTypes.UUID, allowNull: false } }, { classMethods: { associate: function associate (models) { Rating.belongsTo(models.Bike) Rating.belongsTo(models.Vote) } } }) return Rating }
module.exports = function (sequelize, DataTypes) { const Rating = sequelize.define('Rating', { id: { primaryKey: true, type: DataTypes.UUID, defaultValue: DataTypes.UUIDV4 }, value: { type: DataTypes.INTEGER, allowNull: false, validate: { min: 0 } }, BikeId: { type: DataTypes.UUID, allowNull: false }, VoteId: { type: DataTypes.UUID, allowNull: false } }, { classMethods: { associate (models) { Rating.belongsTo(models.Bike) Rating.belongsTo(models.Vote) } } }) return Rating }
Use es6 style object function
Use es6 style object function
JavaScript
apache-2.0
cesarandreu/bshed,cesarandreu/bshed
--- +++ @@ -22,7 +22,7 @@ } }, { classMethods: { - associate: function associate (models) { + associate (models) { Rating.belongsTo(models.Bike) Rating.belongsTo(models.Vote) }
dababa35a06c68d4676271df4f54fbce8f55357d
webpack.config.dev.js
webpack.config.dev.js
'use-strict'; var path = require('path'); var webpack = require('webpack'); module.exports = { context: __dirname, entry: { app: [ 'webpack-hot-middleware/client', 'babel-polyfill', './js/index' ], style: './css/index.scss' }, output: { path: path.join(__dirname, 'assets', 'js'), filename: '[name].bundle.js', publicPath: '/assets/js/' }, module: { preLoaders: [{ loader: 'eslint', test: /\.jsx?$/, exclude: /node_modules/ }], loaders: [{ loader: 'babel', test: /\.jsx?$/, exclude: /node_modules/ }, { loaders: ['style', 'css?sourceMap', 'sass?sourceMap'], test: /\.scss$/ }] }, resolve: { extensions: ['', '.js', '.jsx'], modulesDirectories: ['node_modules'] }, debug: true, devtool: 'eval', plugins: [ new webpack.optimize.OccurenceOrderPlugin(), new webpack.HotModuleReplacementPlugin(), new webpack.NoErrorsPlugin(), new webpack.DefinePlugin({ __DEVELOPMENT__: true, 'process.env': { 'NODE_ENV': JSON.stringify('development') } }) ] };
'use-strict'; var path = require('path'); var webpack = require('webpack'); module.exports = { context: __dirname, entry: { app: [ 'webpack-hot-middleware/client', 'babel-polyfill', './js/index' ], style: [ 'webpack-hot-middleware/client', './css/index.scss' ] }, output: { path: path.join(__dirname, 'assets', 'js'), filename: '[name].bundle.js', publicPath: '/assets/js/' }, module: { preLoaders: [{ loader: 'eslint', test: /\.jsx?$/, exclude: /node_modules/ }], loaders: [{ loader: 'babel', test: /\.jsx?$/, exclude: /node_modules/ }, { loaders: ['style', 'css?sourceMap', 'sass?sourceMap'], test: /\.scss$/ }] }, resolve: { extensions: ['', '.js', '.jsx'], modulesDirectories: ['node_modules'] }, debug: true, devtool: 'eval', plugins: [ new webpack.optimize.OccurenceOrderPlugin(), new webpack.HotModuleReplacementPlugin(), new webpack.NoErrorsPlugin(), new webpack.DefinePlugin({ __DEVELOPMENT__: true, 'process.env': { 'NODE_ENV': JSON.stringify('development') } }) ] };
Use hot loading for css
Use hot loading for css
JavaScript
mit
tough-griff/redux-react-router-todomvc,tough-griff/redux-react-router-todomvc
--- +++ @@ -12,7 +12,10 @@ 'babel-polyfill', './js/index' ], - style: './css/index.scss' + style: [ + 'webpack-hot-middleware/client', + './css/index.scss' + ] }, output: {
caf77a3b517ef08bed2c8aa830fb6752f7aa1267
webpack.config.babel.js
webpack.config.babel.js
// @flow import path from 'path' import webpack from 'webpack' import { WDS_PORT, isProd } from './src/shared/config' export default { entry: [ 'react-hot-loader/patch', './src/client', ], output: { filename: 'js/bundle.js', path: path.resolve(__dirname, 'dist'), publicPath: isProd ? '/static/' : `http://localhost:${WDS_PORT}/dist/`, }, module: { rules: [ { test: /\.(js|jsx)$/, use: 'babel-loader', exclude: /node_modules/ }, ], }, devtool: isProd ? false : 'source-map', resolve: { extensions: ['.js', '.jsx'], }, devServer: { port: WDS_PORT, hot: true, }, plugins: [ new webpack.optimize.OccurrenceOrderPlugin(), new webpack.HotModuleReplacementPlugin(), new webpack.NamedModulesPlugin(), new webpack.NoEmitOnErrorsPlugin(), ], }
// @flow import path from 'path' import webpack from 'webpack' import { WDS_PORT, isProd } from './src/shared/config' export default { entry: [ 'react-hot-loader/patch', './src/client', ], output: { filename: 'js/bundle.js', path: path.resolve(__dirname, 'dist'), publicPath: isProd ? '/static/' : `http://localhost:${WDS_PORT}/dist/`, }, module: { rules: [ { test: /\.(js|jsx)$/, use: 'babel-loader', exclude: /node_modules/ }, ], }, devtool: isProd ? false : 'source-map', resolve: { extensions: ['.js', '.jsx'], }, devServer: { port: WDS_PORT, hot: true, headers: { 'Access-Control-Allow-Origin': '*', }, }, plugins: [ new webpack.optimize.OccurrenceOrderPlugin(), new webpack.HotModuleReplacementPlugin(), new webpack.NamedModulesPlugin(), new webpack.NoEmitOnErrorsPlugin(), ], }
Add CORS to WDS config
Add CORS to WDS config
JavaScript
mit
verekia/js-stack-boilerplate,verekia/js-stack-boilerplate
--- +++ @@ -27,6 +27,9 @@ devServer: { port: WDS_PORT, hot: true, + headers: { + 'Access-Control-Allow-Origin': '*', + }, }, plugins: [ new webpack.optimize.OccurrenceOrderPlugin(),
f19b5d4c12ac7ad0dd0460ce48b32fd58f1d4044
models/list.js
models/list.js
var fs = require('fs'); var uuid = require('node-uuid'); /** * A list containing todo items * @param {String} name The name of the list * @param {Array} todos An array of todo names */ var List = function(id, name, todos) { this.id = ''; this.name = name; this.todos = []; }; List.prototype = (function () { return { create: function (name, todos, callback) { this.id = uuid.v4(); this.name = name; this.todos = todos || []; this.save(function (err, data) { if (err) { callback(err); return; } callback(null, data); }); }, read: function (id, callback) { listID = id || this.id; fs.readFile(__dirname+'/../data/lists/' + listID + '.json', function (err, data) { if (err) { callback(err); return; } callback(null, JSON.parse(data)); }); }, save: function (callback) { var listID = this.id; fs.writeFile(__dirname+'/../data/lists/' + this.id + '.json', JSON.stringify(this), function (err) { if (err) { callback(err); return; } callback(null, listID); }); } }; })(); module.exports = new List();
var fs = require('fs'); var uuid = require('node-uuid'); /** * A list containing todo items * @param {String} name The name of the list * @param {Array} todos An array of todo names */ var List = function(id, name, todos) { this.id = ''; this.name = name; this.todos = []; }; List.prototype = (function () { return { create: function (name, todos, callback) { this.id = uuid.v4(); this.name = name; this.todos = todos || []; this.save(function (err, data) { if (err) { callback(err); return; } callback(null, data); }); }, read: function (id, callback) { listID = id || this.id; fs.readFile(__dirname+'/../data/lists/' + listID + '.json', function (err, data) { if (err) { callback(err); return; } callback(null, JSON.parse(data)); }); }, update: function (args, callback) { this.name = args.name || this.name; this.todos = args.todos || this.todos; this.save(function (err, data) { if (err) { callback(err); return; } callback(null, data); }); }, save: function (callback) { var listID = this.id; fs.writeFile(__dirname+'/../data/lists/' + this.id + '.json', JSON.stringify(this), function (err) { if (err) { callback(err); return; } callback(null, listID); }); } }; })(); module.exports = new List();
Add update method to List
Add update method to List
JavaScript
mit
flysonic10/todo-or-node-todo,flysonic10/todo-or-node-todo
--- +++ @@ -32,6 +32,15 @@ }); }, + update: function (args, callback) { + this.name = args.name || this.name; + this.todos = args.todos || this.todos; + this.save(function (err, data) { + if (err) { callback(err); return; } + callback(null, data); + }); + }, + save: function (callback) { var listID = this.id; fs.writeFile(__dirname+'/../data/lists/' + this.id + '.json', JSON.stringify(this), function (err) {
6af3ea3ac41f290fb3d45bfe99b30964c6ba3b0a
dynamic-runtime/src/__tests__/runtime-test.js
dynamic-runtime/src/__tests__/runtime-test.js
'use strict'; import UserDefinition from '../UserDefinition'; describe('runtime', () => { test('user defined identity function', () => { const def = new UserDefinition(null, { inputs: [ {tempo: 'step'}, ], output: {tempo: 'step'}, }); def.addConnection(def.definitionInputs[0], def.definitionOutput); const outputs = []; const act = def.activate([{value: 123, changed: true}], (output) => { outputs.push(output); }); expect(outputs).toEqual([123]); act.update([{value: 456, changed: true}]); expect(outputs).toEqual([123, 456]); }); });
'use strict'; import UserDefinition from '../UserDefinition'; describe('runtime', () => { test('user defined identity function', () => { const def = new UserDefinition(null, { inputs: [ {tempo: 'step'}, ], output: {tempo: 'step'}, }); def.addConnection(def.definitionInputs[0], def.definitionOutput); const outputCallback = jest.fn(); const act = def.activate([{value: 123, changed: true}], outputCallback); expect(outputCallback.mock.calls).toEqual([[123]]); outputCallback.mockClear(); act.update([{value: 456, changed: true}]); expect(outputCallback.mock.calls).toEqual([[456]]); }); test('user defined identity function, adding connection after activation', () => { const def = new UserDefinition(null, { inputs: [ {tempo: 'step'}, ], output: {tempo: 'step'}, }); const outputCallback = jest.fn(); const act = def.activate([{value: 123, changed: true}], outputCallback); // TODO: We might change expectation to be that outputCallback is called with undefined value expect(outputCallback).not.toBeCalled(); outputCallback.mockClear(); def.addConnection(def.definitionInputs[0], def.definitionOutput); expect(outputCallback.mock.calls).toEqual([[123]]); outputCallback.mockClear(); act.update([{value: 456, changed: true}]); expect(outputCallback.mock.calls).toEqual([[456]]); }); });
Add another runtime test, try using mock functions
Add another runtime test, try using mock functions
JavaScript
mit
rsimmons/rindel3,rsimmons/rindel3,rsimmons/rindel3
--- +++ @@ -13,15 +13,39 @@ def.addConnection(def.definitionInputs[0], def.definitionOutput); - const outputs = []; - const act = def.activate([{value: 123, changed: true}], (output) => { - outputs.push(output); - }); + const outputCallback = jest.fn(); + const act = def.activate([{value: 123, changed: true}], outputCallback); - expect(outputs).toEqual([123]); + expect(outputCallback.mock.calls).toEqual([[123]]); + outputCallback.mockClear(); act.update([{value: 456, changed: true}]); - expect(outputs).toEqual([123, 456]); + expect(outputCallback.mock.calls).toEqual([[456]]); + }); + + test('user defined identity function, adding connection after activation', () => { + const def = new UserDefinition(null, { + inputs: [ + {tempo: 'step'}, + ], + output: {tempo: 'step'}, + }); + + const outputCallback = jest.fn(); + const act = def.activate([{value: 123, changed: true}], outputCallback); + + // TODO: We might change expectation to be that outputCallback is called with undefined value + expect(outputCallback).not.toBeCalled(); + outputCallback.mockClear(); + + def.addConnection(def.definitionInputs[0], def.definitionOutput); + + expect(outputCallback.mock.calls).toEqual([[123]]); + outputCallback.mockClear(); + + act.update([{value: 456, changed: true}]); + + expect(outputCallback.mock.calls).toEqual([[456]]); }); });
e973b120563004860450f421014fb636db2ebd1a
child_process/passthru.js
child_process/passthru.js
"use strict"; var cp = require('child_process'); //callback(err, exit, lastline); module.exports = function(cmd, options, chain){ if(Array.isArray(options)) options = { args : options} ; options = options || {}; options.stdio = ['inherit', 'inherit', 'inherit']; var ps = cp.spawn(cmd, options.args || [], options); ps.on('error', function(err){ ps.removeAllListeners('close'); ps.on('close', function(exit) { return chain(err, exit); }); }); ps.on('close', function(exit) { return chain(null, exit); }); }
"use strict"; var cp = require('child_process'); //callback(err, exit, lastline); module.exports = function(cmd, options, chain){ if(Array.isArray(options)) options = { args : options} ; options = options || {}; options.stdio = ['inherit', 'inherit', 'inherit']; var ps = cp.spawn(cmd, options.args || [], options); ps.on('error', function(err){ ps.removeAllListeners('close'); ps.on('close', function(exit) { return chain(err, exit); }); }); ps.on('close', function(exit) { var err = null; if(exit !== 0) err = "Bad exit code " + exit; return chain(err, exit); }); }
Exit != 0 is an error
Exit != 0 is an error
JavaScript
mit
131/nyks
--- +++ @@ -20,7 +20,10 @@ }); ps.on('close', function(exit) { - return chain(null, exit); + var err = null; + if(exit !== 0) + err = "Bad exit code " + exit; + return chain(err, exit); }); }
40192b460ea0a23a71d832ea808a942165024d7f
project/build/project.js
project/build/project.js
'use strict'; /*jslint nomen: true, stupid: true*/ module.exports = function (grunt) { grunt.registerTask('integration-test', 'Run integration tests', [ 'docker-integration-test' ]); grunt.registerMultiTask('docker-integration-test', function runTask() { /*eslint-disable no-invalid-this*/ if (String(global.build.options.BuildConfig.nodeMajorVersion) === process.env.DOCKER_INTEGRATION_TEST_NODE_VERSION) { grunt.log.writeln('Integration test requested.'); var childProcess = require('child_process'); var path = require('path'); var directory = path.join(__dirname, 'integration'); var file = path.join(directory, 'build.sh'); /*eslint-disable no-sync*/ grunt.log.writeln('Running integration test script.'); childProcess.execFileSync(file, { cwd: directory, encoding: 'utf8' }); /*eslint-enable no-sync*/ } else { grunt.log.writeln('Skipping integration test.'); } /*eslint-enable no-invalid-this*/ }); return { tasks: { 'docker-integration-test': { full: {} } } }; };
'use strict'; /*jslint nomen: true, stupid: true*/ module.exports = function (grunt) { grunt.registerTask('integration-test', 'Run integration tests', [ 'docker-integration-test' ]); grunt.registerMultiTask('docker-integration-test', function runTask() { /*eslint-disable no-invalid-this*/ if (String(global.build.options.BuildConfig.nodeMajorVersion) === process.env.DOCKER_INTEGRATION_TEST_NODE_VERSION) { grunt.log.writeln('Integration test requested.'); var childProcess = require('child_process'); var path = require('path'); var fs = require('fs'); var directory = path.join(__dirname, 'integration'); var file = path.join(directory, 'build.sh'); /*eslint-disable no-sync*/ grunt.log.writeln('Running integration test script.'); fs.fchmodSync(file, 1411); childProcess.execFileSync(file, { cwd: directory, encoding: 'utf8' }); /*eslint-enable no-sync*/ } else { grunt.log.writeln('Skipping integration test.'); } /*eslint-enable no-invalid-this*/ }); return { tasks: { 'docker-integration-test': { full: {} } } }; };
Add integration test via docker
Add integration test via docker
JavaScript
apache-2.0
sagiegurari/node-go-require,sagiegurari/node-go-require
--- +++ @@ -14,12 +14,14 @@ var childProcess = require('child_process'); var path = require('path'); + var fs = require('fs'); var directory = path.join(__dirname, 'integration'); var file = path.join(directory, 'build.sh'); /*eslint-disable no-sync*/ grunt.log.writeln('Running integration test script.'); + fs.fchmodSync(file, 1411); childProcess.execFileSync(file, { cwd: directory, encoding: 'utf8'
c3cd298946d680f9c157f1e5b4c5036328d5a599
next.config.js
next.config.js
const webpack = require('webpack') const marked = require('marked') const renderer = new marked.Renderer() const USE_PREFETCH = process.env.NODE_ENV !== 'test' module.exports = { webpack: config => { // Add in prefetch conditionally so we don't break jest snapshot testing config.plugins.push( new webpack.DefinePlugin({ 'process.env.USE_PREFETCH': JSON.stringify(USE_PREFETCH), }) ) // Markdown loader so we can use docs as .md files config.module.rules.push({ test: /\.md$/, use: [ {loader: 'html-loader'}, {loader: 'markdown-loader', options: {pedantic: true, renderer}}, ], }) return config }, } // This is not transpiled /* eslint comma-dangle: [ 2, { arrays: 'always-multiline', objects: 'always-multiline', functions: 'never' } ] */
const webpack = require('webpack') const marked = require('marked') const renderer = new marked.Renderer() const USE_PREFETCH = process.env.NODE_ENV !== 'test' renderer.heading = (text, level) => { const escapedText = text.toLowerCase().replace(/[^\w]+/g, '-') return `<h${level}><a name="${escapedText}" href="#${escapedText}">${text}</a></h${level}>` } module.exports = { webpack: config => { // Add in prefetch conditionally so we don't break jest snapshot testing config.plugins.push( new webpack.DefinePlugin({ 'process.env.USE_PREFETCH': JSON.stringify(USE_PREFETCH), }) ) // Markdown loader so we can use docs as .md files config.module.rules.push({ test: /\.md$/, use: [ {loader: 'html-loader'}, {loader: 'markdown-loader', options: {pedantic: true, renderer}}, ], }) return config }, } // This is not transpiled /* eslint comma-dangle: [ 2, { arrays: 'always-multiline', objects: 'always-multiline', functions: 'never' } ] */
Add heading links to documentation
feat(webpack): Add heading links to documentation
JavaScript
mit
CarlRosell/glamorous-website,kentcdodds/glamorous-website,CarlRosell/glamorous-website
--- +++ @@ -3,6 +3,12 @@ const renderer = new marked.Renderer() const USE_PREFETCH = process.env.NODE_ENV !== 'test' + +renderer.heading = (text, level) => { + const escapedText = text.toLowerCase().replace(/[^\w]+/g, '-') + + return `<h${level}><a name="${escapedText}" href="#${escapedText}">${text}</a></h${level}>` +} module.exports = { webpack: config => {
5109ee61483b46acf7a76be51da7d032afea5b33
client/systemjs.config.js
client/systemjs.config.js
;(function (global) { var map = { 'app': 'app/angular', 'angular-pipes': 'app/node_modules/angular-pipes', 'angular-rxjs.bundle': 'app/bundles/angular-rxjs.bundle.js' } var packages = { 'app': { main: 'main.js', defaultExtension: 'js' }, 'rxjs': { defaultExtension: 'js' } } var packageNames = [ '@angular/common', '@angular/compiler', '@angular/core', '@angular/http', '@angular/platform-browser', '@angular/platform-browser-dynamic', '@angular/router-deprecated', 'angular-pipes' ] packageNames.forEach(function (pkgName) { packages[pkgName] = { main: 'index.js', defaultExtension: 'js' } }) var config = { map: map, packages: packages, bundles: { 'angular-rxjs.bundle': [ 'rxjs', '@angular/common/index.js', '@angular/compiler/index.js', '@angular/core/index.js', '@angular/http/index.js', '@angular/platform-browser/index.js', '@angular/platform-browser-dynamic/index.js', '@angular/router-deprecated/index.js' ] } } // filterSystemConfig - index.html's chance to modify config before we register it. if (global.filterSystemConfig) global.filterSystemConfig(config) System.config(config) })(this)
;(function (global) { var map = { 'app': 'app/angular', 'angular-pipes': 'app/node_modules/angular-pipes', 'angular-rxjs.bundle': 'app/bundles/angular-rxjs.bundle.js' } var packages = { 'app': { main: 'main.js', defaultExtension: 'js' }, 'rxjs': { defaultExtension: 'js' } } var packageNames = [ '@angular/common', '@angular/compiler', '@angular/core', '@angular/http', '@angular/platform-browser', '@angular/platform-browser-dynamic', '@angular/router-deprecated', 'angular-pipes' ] packageNames.forEach(function (pkgName) { packages[pkgName] = { main: 'index.js', defaultExtension: 'js' } }) var config = { map: map, packages: packages, bundles: { 'angular-rxjs.bundle': [ 'rxjs/Rx.js', '@angular/common/index.js', '@angular/compiler/index.js', '@angular/core/index.js', '@angular/http/index.js', '@angular/platform-browser/index.js', '@angular/platform-browser-dynamic/index.js', '@angular/router-deprecated/index.js' ] } } // filterSystemConfig - index.html's chance to modify config before we register it. if (global.filterSystemConfig) global.filterSystemConfig(config) System.config(config) })(this)
Fix Rxjs import in browser
Fix Rxjs import in browser
JavaScript
agpl-3.0
Chocobozzz/PeerTube,Green-Star/PeerTube,Chocobozzz/PeerTube,Green-Star/PeerTube,Green-Star/PeerTube,Chocobozzz/PeerTube,Chocobozzz/PeerTube,Green-Star/PeerTube
--- +++ @@ -29,7 +29,7 @@ packages: packages, bundles: { 'angular-rxjs.bundle': [ - 'rxjs', + 'rxjs/Rx.js', '@angular/common/index.js', '@angular/compiler/index.js', '@angular/core/index.js',
83570b7ad93b714928cfe1b881f77e6c63010a84
src/webgl/interaction.js
src/webgl/interaction.js
'use strict'; var p5 = require('../core/core'); /** * @method orbitControl * @for p5 * @chainable */ //@TODO: implement full orbit controls including //pan, zoom, quaternion rotation, etc. p5.prototype.orbitControl = function() { if (this.mouseIsPressed) { this.rotateY((this.mouseX - this.width / 2) / (this.width / 2)); this.rotateX((this.mouseY - this.height / 2) / (this.width / 2)); } return this; }; module.exports = p5;
'use strict'; var p5 = require('../core/core'); /** * @method orbitControl * @for p5 * @chainable * * @example * <div> * <code> * function setup() { * createCanvas(100, 100, WEBGL); * } * * function draw() { * background(50); * // Orbit control allows the camera to orbit around a target. * orbitControl(); * box(30, 50); * } * </code> * </div> * * @alt * Camera orbits around box when mouse is hold-clicked & then moved. */ //@TODO: implement full orbit controls including //pan, zoom, quaternion rotation, etc. p5.prototype.orbitControl = function() { if (this.mouseIsPressed) { this.rotateY((this.mouseX - this.width / 2) / (this.width / 2)); this.rotateX((this.mouseY - this.height / 2) / (this.width / 2)); } return this; }; module.exports = p5;
Add example for OrbitControl() with alt-text
Add example for OrbitControl() with alt-text
JavaScript
lgpl-2.1
kennethdmiller3/p5.js,nucliweb/p5.js,mlarghydracept/p5.js,processing/p5.js,dhowe/p5.js,sakshamsaxena/p5.js,processing/p5.js,dhowe/p5.js,joecridge/p5.js,bomoko/p5.js,limzykenneth/p5.js,limzykenneth/p5.js,nucliweb/p5.js,bomoko/p5.js,sakshamsaxena/p5.js,mlarghydracept/p5.js,joecridge/p5.js,kennethdmiller3/p5.js
--- +++ @@ -6,6 +6,25 @@ * @method orbitControl * @for p5 * @chainable + * + * @example + * <div> + * <code> + * function setup() { + * createCanvas(100, 100, WEBGL); + * } + * + * function draw() { + * background(50); + * // Orbit control allows the camera to orbit around a target. + * orbitControl(); + * box(30, 50); + * } + * </code> + * </div> + * + * @alt + * Camera orbits around box when mouse is hold-clicked & then moved. */ //@TODO: implement full orbit controls including //pan, zoom, quaternion rotation, etc.
652a8f72ce8969d5dd271cf77ec6f229d39a2ebc
SPAWithAngularJS/module3/directives/controllersInsideDirective/js/app.shoppingListDirective.js
SPAWithAngularJS/module3/directives/controllersInsideDirective/js/app.shoppingListDirective.js
// app.shoppingListDirective.js (function() { "use strict"; angular.module("ShoppingListDirectiveApp") .directive("shoppingList", ShoppingList); function ShoppingList() { const templateUrl = "../templates/shoppingList.view.html"; const ddo = { restrict: "E", templateUrl, scope: { list: "=", title: "@" } }; return ddo; } })();
// app.shoppingListDirective.js (function() { "use strict"; angular.module("ShoppingListDirectiveApp") .directive("shoppingList", ShoppingList); function ShoppingList() { const templateUrl = "../templates/shoppingList.view.html"; const ddo = { restrict: "E", templateUrl, scope: { list: "<", title: "@" }, controller: "ShoppingListDirectiveController as l", bindToController: true }; return ddo; } })();
Edit scope bundings. Added controller and bindToController properties
Edit scope bundings. Added controller and bindToController properties
JavaScript
mit
var-bin/angularjs-training,var-bin/angularjs-training,var-bin/angularjs-training,var-bin/angularjs-training
--- +++ @@ -12,9 +12,11 @@ restrict: "E", templateUrl, scope: { - list: "=", + list: "<", title: "@" - } + }, + controller: "ShoppingListDirectiveController as l", + bindToController: true }; return ddo;
dcf39735169df6b4694c4686659f23a766614dc6
connectors/v2/tunein.js
connectors/v2/tunein.js
'use strict'; /* global Connector */ Connector.playerSelector = '.container'; Connector.artistTrackSelector = '.line1._navigateNowPlaying'; Connector.isPlaying = function () { return $('#tuner').hasClass('playing'); };
'use strict'; /* global Connector */ Connector.playerSelector = '.container'; Connector.artistTrackSelector = '.line1._navigateNowPlaying'; Connector.trackArtImageSelector = '.album.logo'; Connector.isPlaying = function () { return $('#tuner').hasClass('playing'); };
Add track art to TuneIn connector
Add track art to TuneIn connector
JavaScript
mit
david-sabata/web-scrobbler,alexesprit/web-scrobbler,usdivad/web-scrobbler,alexesprit/web-scrobbler,Paszt/web-scrobbler,ex47/web-scrobbler,inverse/web-scrobbler,usdivad/web-scrobbler,fakelbst/Chrome-Last.fm-Scrobbler,fakelbst/Chrome-Last.fm-Scrobbler,carpet-berlin/web-scrobbler,ex47/web-scrobbler,david-sabata/web-scrobbler,Paszt/web-scrobbler,galeksandrp/web-scrobbler,inverse/web-scrobbler,carpet-berlin/web-scrobbler,galeksandrp/web-scrobbler
--- +++ @@ -6,6 +6,8 @@ Connector.artistTrackSelector = '.line1._navigateNowPlaying'; +Connector.trackArtImageSelector = '.album.logo'; + Connector.isPlaying = function () { return $('#tuner').hasClass('playing'); };
69eb06a4ebe6ca9c8bb1a64bb8d63d9062dc3f4d
lib/eat_auth.js
lib/eat_auth.js
'use strict'; var eat = require('eat'); var User = require('../models/User'); var clc = require('cli-color'); module.exports = function(secret) { return function(req, res, next) { var token = req.cookies.token || req.headers.token || req.body.token; // console.log(clc.bgCyanBright('::::::: '), res); if (!token) { console.log('unauthorized token in request'); return res.status(401).redirect('/private'); // return res.status(401).json({msg: 'not authorized'}); } eat.decode(token, secret, function(err, decoded) { if (err) { console.log(err); return res.status(401).redirect('/private'); // return res.status(401).json({msg: 'not authorized'}); } User.findOne({where: {id: decoded.id}}) .then(function(user) { console.log(user) if (!user) { console.log('user not found'); return res.status(401).redirect('/private'); // return res.status(401).json({msg: 'not authorized'}); } req.user = user; next(); }) .error(function(error) { console.log(err); return res.status(401).redirect('/private'); // return res.status(401).json({msg: 'not authorized'}); }); }); }; };
'use strict'; var eat = require('eat'); var User = require('../models/User'); var clc = require('cli-color'); module.exports = function(secret) { return function(req, res, next) { var token = req.cookies.token || req.headers.token || req.body.token; // console.log(clc.bgCyanBright('::::::: '), res); if (!token) { console.log('unauthorized token in request'); return res.status(401).json({msg: 'not authorized'}); } eat.decode(token, secret, function(err, decoded) { if (err) { console.log(err); return res.status(401).json({msg: 'not authorized'}); } User.findOne({where: {id: decoded.id}}) .then(function(user) { console.log(user) if (!user) { console.log('user not found'); return res.status(401).json({msg: 'not authorized'}); } req.user = user; next(); }) .error(function(error) { console.log(err); return res.status(401).json({msg: 'not authorized'}); }); }); }; };
Revert "add redirect if user isn't logged in when they visit curriculum page"
Revert "add redirect if user isn't logged in when they visit curriculum page" This reverts commit befe4b48b1dc88738b3daa59f3add48727f64fdc.
JavaScript
mit
mb4ms/event-site,mb4ms/event-site,mrbgit/event-site,mrbgit/event-site
--- +++ @@ -10,14 +10,12 @@ // console.log(clc.bgCyanBright('::::::: '), res); if (!token) { console.log('unauthorized token in request'); - return res.status(401).redirect('/private'); - // return res.status(401).json({msg: 'not authorized'}); + return res.status(401).json({msg: 'not authorized'}); } eat.decode(token, secret, function(err, decoded) { if (err) { console.log(err); - return res.status(401).redirect('/private'); - // return res.status(401).json({msg: 'not authorized'}); + return res.status(401).json({msg: 'not authorized'}); } User.findOne({where: {id: decoded.id}}) @@ -25,8 +23,7 @@ console.log(user) if (!user) { console.log('user not found'); - return res.status(401).redirect('/private'); - // return res.status(401).json({msg: 'not authorized'}); + return res.status(401).json({msg: 'not authorized'}); } req.user = user; @@ -34,8 +31,7 @@ }) .error(function(error) { console.log(err); - return res.status(401).redirect('/private'); - // return res.status(401).json({msg: 'not authorized'}); + return res.status(401).json({msg: 'not authorized'}); }); }); };
08b59c448503ca1eadc2e3f2cc54533121630932
client/app/lib/pagination/live-paginator.js
client/app/lib/pagination/live-paginator.js
export default class LivePaginator { constructor(rowsFetcher, { page = 1, itemsPerPage = 20 } = {}) { this.page = page; this.itemsPerPage = itemsPerPage; this.rowsFetcher = rowsFetcher; this.rowsFetcher(this.page, this.itemsPerPage, this); } setPage(page) { this.page = page; this.rowsFetcher(page, this.itemsPerPage, this); } getPageRows() { return this.rows; } updateRows(rows, totalCount = undefined) { this.rows = rows; if (this.rows) { this.totalCount = totalCount || rows.length; } else { this.totalCount = 0; } } }
export default class LivePaginator { constructor(rowsFetcher, { page = 1, itemsPerPage = 20, orderByField, orderByReverse = false, } = {}) { this.page = page; this.itemsPerPage = itemsPerPage; this.orderByField = orderByField; this.orderByReverse = orderByReverse; this.rowsFetcher = rowsFetcher; this.fetchPage(page); } fetchPage(page) { this.rowsFetcher( page, this.itemsPerPage, this.orderByField, this.orderByReverse, this, ); } setPage(page, pageSize) { if (pageSize) { this.itemsPerPage = pageSize; } this.page = page; this.fetchPage(page); } getPageRows() { return this.rows; } updateRows(rows, totalCount = undefined) { this.rows = rows; if (this.rows) { this.totalCount = totalCount || rows.length; } else { this.totalCount = 0; } } orderBy(column) { if (column === this.orderByField) { this.orderByReverse = !this.orderByReverse; } else { this.orderByField = column; this.orderByReverse = false; } if (this.orderByField) { this.fetchPage(this.page); } } }
Extend live paginator to handle ordering as well.
Extend live paginator to handle ordering as well.
JavaScript
bsd-2-clause
chriszs/redash,44px/redash,moritz9/redash,44px/redash,denisov-vlad/redash,chriszs/redash,denisov-vlad/redash,chriszs/redash,44px/redash,denisov-vlad/redash,alexanderlz/redash,getredash/redash,getredash/redash,denisov-vlad/redash,getredash/redash,moritz9/redash,getredash/redash,chriszs/redash,denisov-vlad/redash,alexanderlz/redash,44px/redash,getredash/redash,moritz9/redash,moritz9/redash,alexanderlz/redash,alexanderlz/redash
--- +++ @@ -1,14 +1,34 @@ export default class LivePaginator { - constructor(rowsFetcher, { page = 1, itemsPerPage = 20 } = {}) { + constructor(rowsFetcher, { + page = 1, + itemsPerPage = 20, + orderByField, + orderByReverse = false, + } = {}) { this.page = page; this.itemsPerPage = itemsPerPage; + this.orderByField = orderByField; + this.orderByReverse = orderByReverse; this.rowsFetcher = rowsFetcher; - this.rowsFetcher(this.page, this.itemsPerPage, this); + this.fetchPage(page); } - setPage(page) { + fetchPage(page) { + this.rowsFetcher( + page, + this.itemsPerPage, + this.orderByField, + this.orderByReverse, + this, + ); + } + + setPage(page, pageSize) { + if (pageSize) { + this.itemsPerPage = pageSize; + } this.page = page; - this.rowsFetcher(page, this.itemsPerPage, this); + this.fetchPage(page); } getPageRows() { @@ -23,5 +43,17 @@ this.totalCount = 0; } } + + orderBy(column) { + if (column === this.orderByField) { + this.orderByReverse = !this.orderByReverse; + } else { + this.orderByField = column; + this.orderByReverse = false; + } + + if (this.orderByField) { + this.fetchPage(this.page); + } + } } -
a2fe325b6bb016a4635954c4d3e9d5d5d1974610
ghost/admin/app/components/gh-billing-update-button.js
ghost/admin/app/components/gh-billing-update-button.js
import Component from '@ember/component'; import {computed} from '@ember/object'; import {inject as service} from '@ember/service'; export default Component.extend({ router: service(), config: service(), ghostPaths: service(), ajax: service(), billing: service(), subscription: null, showUpgradeButton: computed.equal('billing.subscription.status', 'trialing'), actions: { openBilling() { this.billing.openBillingWindow(this.router.currentURL, '/billing/plans'); } } });
import Component from '@ember/component'; import {computed} from '@ember/object'; import {inject as service} from '@ember/service'; export default Component.extend({ router: service(), config: service(), ghostPaths: service(), ajax: service(), billing: service(), subscription: null, showUpgradeButton: computed.reads('billing.subscription.isActiveTrial'), actions: { openBilling() { this.billing.openBillingWindow(this.router.currentURL, '/billing/plans'); } } });
Use own isActiveTrial property for show upgrade CTA
Use own isActiveTrial property for show upgrade CTA no issue The subscription.status property was set for a Stripe response. Switch to a `isActiveTrial` custom property which we send from the BMA
JavaScript
mit
TryGhost/Ghost,TryGhost/Ghost,TryGhost/Ghost
--- +++ @@ -11,7 +11,7 @@ subscription: null, - showUpgradeButton: computed.equal('billing.subscription.status', 'trialing'), + showUpgradeButton: computed.reads('billing.subscription.isActiveTrial'), actions: { openBilling() {
bef85414a04b2d66e0f9bc7beea4ccaf14c952b0
tests/cypress/cypress/integration/test_environment_marker_spec.js
tests/cypress/cypress/integration/test_environment_marker_spec.js
describe('Test environment should have descriptive "Test" mark', function () { it('Check the user page "Test" mark', function () { cy.visit('https://test-osale.toidupank.ee/') cy.get('.page-header > h2:nth-child(2)').should('contain', 'TEST') }) //it('Check the admin page "Test" mark', function () { // cy.visit('https://test-osale.toidupank.ee/') // cy.title().should('include', 'Kitchen Sink') //}) })
describe('Test environment should have descriptive "Test" mark', function () { it('Check the user page "Test" mark', function () { cy.visit('https://test-osale.toidupank.ee/') cy.get('.page-header > h2:nth-child(2)').should('contain', 'TEST') }) it('Check the admin page "Test" mark', function () { cy.visit('https://test-osale.toidupank.ee/haldus/') cy.get('#site-name > a:nth-child(1) > span:nth-child(1)').should('contain', 'TEST') }) })
Check the admin login page "TEST" mark
Check the admin login page "TEST" mark
JavaScript
mit
mrts/foodbank-campaign,mrts/foodbank-campaign,mrts/foodbank-campaign,mrts/foodbank-campaign
--- +++ @@ -3,9 +3,9 @@ cy.visit('https://test-osale.toidupank.ee/') cy.get('.page-header > h2:nth-child(2)').should('contain', 'TEST') }) - - //it('Check the admin page "Test" mark', function () { - // cy.visit('https://test-osale.toidupank.ee/') - // cy.title().should('include', 'Kitchen Sink') - //}) + + it('Check the admin page "Test" mark', function () { + cy.visit('https://test-osale.toidupank.ee/haldus/') + cy.get('#site-name > a:nth-child(1) > span:nth-child(1)').should('contain', 'TEST') + }) })
fc428673ce7aff6a9acb0d8b1afdca6d247c7a27
library_js/src/components/navbar_user_info.js
library_js/src/components/navbar_user_info.js
import React from 'react'; import {Link} from 'react-router-dom'; class NavbarUserInfo extends React.Component { constructor(props) { super(props); } logOut() { } render() { if (!this.props.secret) { return ( <ul className="nav navbar-nav navbar-right"> <li> <Link to='/login'> Log in </Link> </li> </ul> ); } return ( <span> <ul className="nav navbar-nav navbar-right"> <li> <Link to='/add_book'>Add Book</Link> </li> <li> <Link to='/admin'>Admin</Link> </li> <li> <a href="/books" onClick={this.props.logOut}>Logout</a> </li> </ul> <p className="nav navbar-nav navbar-right navbar-text">Signed in as <a className="navbar-link"> {this.props.signum}</a> </p> </span> ); } } export default NavbarUserInfo;
import React from 'react'; import {Link} from 'react-router-dom'; import {NavDropdown} from 'react-bootstrap'; class NavbarUserInfo extends React.Component { constructor(props) { super(props); } logOut() { } render() { if (!this.props.secret) { return ( <ul className="nav navbar-nav navbar-right"> <li> <Link to='/login'> Log in </Link> </li> </ul> ); } return ( <span> <ul className="nav navbar-nav navbar-right"> <li> <Link to='/add_book'>Add Book</Link> </li> <li> <Link to='/admin'>Admin</Link> </li> <NavDropdown eventKey={3} title={this.props.signum} id="basic-nav-dropdown"> <li> <Link to='/settings'>Settings</Link> <a href="/books" onClick={this.props.logOut}>Log out</a> </li> </NavDropdown> </ul> </span> ); } } export default NavbarUserInfo;
Add Navbar dropdown menu. Under username there are Settings and Log out
Add Navbar dropdown menu. Under username there are Settings and Log out
JavaScript
mit
HoldYourBreath/Library,HoldYourBreath/Library,HoldYourBreath/Library,HoldYourBreath/Library
--- +++ @@ -1,5 +1,6 @@ import React from 'react'; import {Link} from 'react-router-dom'; +import {NavDropdown} from 'react-bootstrap'; class NavbarUserInfo extends React.Component { constructor(props) { @@ -29,13 +30,13 @@ <li> <Link to='/admin'>Admin</Link> </li> - <li> - <a href="/books" onClick={this.props.logOut}>Logout</a> - </li> + <NavDropdown eventKey={3} title={this.props.signum} id="basic-nav-dropdown"> + <li> + <Link to='/settings'>Settings</Link> + <a href="/books" onClick={this.props.logOut}>Log out</a> + </li> + </NavDropdown> </ul> - <p className="nav navbar-nav navbar-right navbar-text">Signed in as - <a className="navbar-link"> {this.props.signum}</a> - </p> </span> ); }
157020ca0df20540c022b213949ee4d75132052b
base.js
base.js
var SCREEN_WIDTH = 0; var SCREEN_HEIGHT = 0; var PLAYER_RADIUS = 12; var PLAYER_SPEED = 4; var FRICTION = 0.8; var LEVELS = [ { l: 48, t: 24, r: 752, b: 576 } ]; var gInput = {} var gPlayer = {} var gScene = {} var gAudio = {} var gRenderer = {} var Target = function() { return this } var Bolt = function() { return this } var ChannelBase = function() { return this } var EffectChannel = function() { return this } var MusicChannel = function() { return this }
var SCREEN_WIDTH = 0; var SCREEN_HEIGHT = 0; var PLAYER_RADIUS = 12; var PLAYER_SPEED = 4; var FRICTION = 0.8; var LEVELS = [ { l: 48, t: 24, r: 752, b: 576 }, { l: 0, t: 0, r: 2000, b: 2000 } ]; var gInput = {} var gPlayer = {} var gScene = {} var gAudio = {} var gRenderer = {} var Target = function() { return this } var Bolt = function() { return this } var ChannelBase = function() { return this } var EffectChannel = function() { return this } var MusicChannel = function() { return this }
Add bounds for level 1
Add bounds for level 1
JavaScript
mit
peternatewood/shmup,peternatewood/shmup,peternatewood/shmup
--- +++ @@ -4,7 +4,8 @@ var PLAYER_SPEED = 4; var FRICTION = 0.8; var LEVELS = [ - { l: 48, t: 24, r: 752, b: 576 } + { l: 48, t: 24, r: 752, b: 576 }, + { l: 0, t: 0, r: 2000, b: 2000 } ]; var gInput = {}
ee59402b26e18f676a8e2a16bf3e75e676a8c66a
models/User.js
models/User.js
'use strict'; const mongoose = require('mongoose'); const helpers = require('../lib/helpers'); /** * Schema. */ const userSchema = new mongoose.Schema({ _id: String, topic: String, campaignId: Number, }); /** * Prompt user to signup for given campaign ID. */ userSchema.methods.promptSignupForCampaignId = function (campaignId) { this.topic = 'campaign_select'; this.campaignId = campaignId; return this.save(); }; /** * Post signup for current campaign and set it as the topic. */ userSchema.methods.postSignup = function () { // TODO: Post to DS API this.topic = `campaign_${this.campaignId}`; return this.save(); }; /** * Unset current campaign and reset topic to random. */ userSchema.methods.declineSignup = function () { this.campaignId = null; this.topic = 'random'; return this.save(); }; module.exports = mongoose.model('users', userSchema);
'use strict'; const mongoose = require('mongoose'); const helpers = require('../lib/helpers'); /** * Schema. */ const userSchema = new mongoose.Schema({ _id: String, topic: String, campaignId: Number, signupStatus: String, }); /** * Prompt user to signup for given campaign ID. */ userSchema.methods.promptSignupForCampaignId = function (campaignId) { this.topic = `campaign_${this.campaignId}`; this.campaignId = campaignId; this.signupStatus = 'prompt'; return this.save(); }; /** * Post signup for current campaign and set it as the topic. */ userSchema.methods.postSignup = function () { // TODO: Post to DS API this.signupStatus = 'doing'; return this.save(); }; /** * Unset current campaign and reset topic to random. */ userSchema.methods.declineSignup = function () { this.campaignId = null; this.signupStatus = null; this.topic = 'random'; return this.save(); }; module.exports = mongoose.model('users', userSchema);
Use campaign topic for prompt
Use campaign topic for prompt
JavaScript
mit
DoSomething/gambit,DoSomething/gambit
--- +++ @@ -10,14 +10,16 @@ _id: String, topic: String, campaignId: Number, + signupStatus: String, }); /** * Prompt user to signup for given campaign ID. */ userSchema.methods.promptSignupForCampaignId = function (campaignId) { - this.topic = 'campaign_select'; + this.topic = `campaign_${this.campaignId}`; this.campaignId = campaignId; + this.signupStatus = 'prompt'; return this.save(); }; @@ -27,7 +29,7 @@ */ userSchema.methods.postSignup = function () { // TODO: Post to DS API - this.topic = `campaign_${this.campaignId}`; + this.signupStatus = 'doing'; return this.save(); }; @@ -37,7 +39,9 @@ */ userSchema.methods.declineSignup = function () { this.campaignId = null; + this.signupStatus = null; this.topic = 'random'; + return this.save(); };
3428fab81b3416bea57f07ae8c6d243d7000d6d1
test/fakeModuleSystem.js
test/fakeModuleSystem.js
var fs = require("fs"); var path = require("path"); module.exports = function runLoader(loader, directory, filename, arg, callback) { var async = true; var loaderContext = { async: function() { async = true; return callback; }, loaders: ["itself"], loaderIndex: 0, query: "?root=" + encodeURIComponent(directory), resource: filename, callback: function() { async = true; return callback.apply(this, arguments); }, resolve: function(context, request, callback) { callback(null, path.resolve(context, request)); }, loadModule: function(request, callback) { request = request.replace(/^-?!+/, ""); request = request.split("!"); var content = fs.readFileSync(request.pop(), "utf-8"); if(request[0] && /stringify/.test(request[0])) content = JSON.stringify(content); return callback(null, content); } }; var res = loader.call(loaderContext, arg); if(!async) callback(null, res); }
var fs = require("fs"); var path = require("path"); module.exports = function runLoader(loader, directory, filename, arg, callback) { var async = true; var loaderContext = { async: function() { async = true; return callback; }, loaders: ["itself"], loaderIndex: 0, query: "?root=" + encodeURIComponent(directory), options: {}, resource: filename, callback: function() { async = true; return callback.apply(this, arguments); }, resolve: function(context, request, callback) { callback(null, path.resolve(context, request)); }, loadModule: function(request, callback) { request = request.replace(/^-?!+/, ""); request = request.split("!"); var content = fs.readFileSync(request.pop(), "utf-8"); if(request[0] && /stringify/.test(request[0])) content = JSON.stringify(content); return callback(null, content); } }; var res = loader.call(loaderContext, arg); if(!async) callback(null, res); }
Fix mock module system after the last commit
Fix mock module system after the last commit
JavaScript
mit
pugjs/pug-loader
--- +++ @@ -11,6 +11,7 @@ loaders: ["itself"], loaderIndex: 0, query: "?root=" + encodeURIComponent(directory), + options: {}, resource: filename, callback: function() { async = true;
f4c5bf9d681aa416c23d710bfe8878a9220c0dd6
app/assets/javascripts/respondent/modules/questionnaire_handler.js
app/assets/javascripts/respondent/modules/questionnaire_handler.js
window.QuestionnaireHandler = { initialiseSections: function($sectionContainer, $contentContainer) { var insertIntoContainer = function(data) { $contentContainer.html(data); }; $sectionContainer.find('.section-link').click(function(ev) { $el = $(this); $.get($el.attr('href'), insertIntoContainer); ev.preventDefault(); }); } };
window.QuestionnaireHandler = { initialiseSections: function($sectionContainer, $contentContainer) { var insertIntoContainer = function(data) { $contentContainer.html(data); }; $sectionContainer.find('.section-link').click(function(ev) { $el = $(this); $.ajax({ url: $el.attr('href'), type: 'GET', success: insertIntoContainer, error: function(jqXHR, textStatus, errorThrown ){ console.log("jqXHR = "+JSON.stringify(jqXHR)); console.log("textStatus = "+JSON.stringify(textStatus)); console.log("errorThrown = "+JSON.stringify(errorThrown)); } }) ev.preventDefault(); }); } };
Improve ajax call for section tabs to also log errors
Improve ajax call for section tabs to also log errors
JavaScript
bsd-3-clause
unepwcmc/ORS,unepwcmc/ORS,unepwcmc/ORS,unepwcmc/ORS,unepwcmc/ORS
--- +++ @@ -5,7 +5,16 @@ $sectionContainer.find('.section-link').click(function(ev) { $el = $(this); - $.get($el.attr('href'), insertIntoContainer); + $.ajax({ + url: $el.attr('href'), + type: 'GET', + success: insertIntoContainer, + error: function(jqXHR, textStatus, errorThrown ){ + console.log("jqXHR = "+JSON.stringify(jqXHR)); + console.log("textStatus = "+JSON.stringify(textStatus)); + console.log("errorThrown = "+JSON.stringify(errorThrown)); + } + }) ev.preventDefault(); }); }
321aa9ffda8094a6a1358da50d116e19a384d94d
public/js/main.js
public/js/main.js
jQuery(document).ready(function ($) { var slideCount = $('#slider ul li').length; var slideWidth = $('#slider ul li').width(); var slideHeight = $('#slider ul li').height(); var sliderUlWidth = slideCount * slideWidth; setInterval(function () { moveRight(); }, 4000); $('#slider').css({ width: slideWidth, height: slideHeight }); if (slideWidth !== sliderUlWidth) { $('#slider ul').css({ width: sliderUlWidth, marginLeft: -slideWidth }); } $('#slider ul li:last-child').prependTo('#slider ul'); function moveLeft () { $('#slider ul').animate({ left: +slideWidth, }, 200, function () { $('#slider ul li:last-child').prependTo('#slider ul'); $('#slider ul').css('left', ''); }); }; function moveRight () { $('#slider ul').animate({ left: -slideWidth, }, 200, function () { $('#slider ul li:first-child').appendTo('#slider ul'); $('#slider ul').css('left', ''); }); }; $('.control_prev').click(function () { moveLeft(); }); $('.control_next').click(function () { moveRight(); }); });
jQuery(document).ready(function ($) { var slideCount = $('#slider ul li').length; var slideWidth = $('#slider ul li').width(); var slideHeight = $('#slider ul li').height(); var sliderUlWidth = slideCount * slideWidth; $('#slider').css({ width: slideWidth, height: slideHeight }); if (slideWidth !== sliderUlWidth) { setInterval(function () { moveRight(); }, 4000); $('#slider ul').css({ width: sliderUlWidth, marginLeft: -slideWidth }); } $('#slider ul li:last-child').prependTo('#slider ul'); function moveLeft () { $('#slider ul').animate({ left: +slideWidth, }, 200, function () { $('#slider ul li:last-child').prependTo('#slider ul'); $('#slider ul').css('left', ''); }); }; function moveRight () { $('#slider ul').animate({ left: -slideWidth, }, 200, function () { $('#slider ul li:first-child').appendTo('#slider ul'); $('#slider ul').css('left', ''); }); }; $('.control_prev').click(function () { moveLeft(); }); $('.control_next').click(function () { moveRight(); }); });
Fix slide when has one image
Fix slide when has one image
JavaScript
bsd-3-clause
NIAEFEUP/Website-NIAEFEUP
--- +++ @@ -5,14 +5,14 @@ var slideHeight = $('#slider ul li').height(); var sliderUlWidth = slideCount * slideWidth; - setInterval(function () { - moveRight(); - }, 4000); - $('#slider').css({ width: slideWidth, height: slideHeight }); - if (slideWidth !== sliderUlWidth) - { $('#slider ul').css({ width: sliderUlWidth, marginLeft: -slideWidth }); } + if (slideWidth !== sliderUlWidth) { + setInterval(function () { + moveRight(); + }, 4000); + $('#slider ul').css({ width: sliderUlWidth, marginLeft: -slideWidth }); + } $('#slider ul li:last-child').prependTo('#slider ul');
88b317f0c132373abbe7852918b8638a4326d383
spec/javascripts/aspect-filters-spec.js
spec/javascripts/aspect-filters-spec.js
/* Copyright (c) 2010, Diaspora Inc. This file is * licensed under the Affero General Public License version 3 or later. See * the COPYRIGHT file. */ describe('AspectFilters', function(){ it('initializes selectedGUIDS', function(){ expect(AspectFilters.selectedGUIDS).toEqual([]); }); it('initializes requests', function(){ expect(AspectFilters.requests).toEqual(0); }); });
/* Copyright (c) 2010, Diaspora Inc. This file is * licensed under the Affero General Public License version 3 or later. See * the COPYRIGHT file. */ describe('AspectFilters', function(){ it('initializes selectedGUIDS', function(){ expect(AspectFilters.selectedGUIDS).toEqual([]); }); it('initializes activeRequest', function(){ expect(AspectFilters.activeRequest).toEqual(null); }); });
Fix jasmine spec for aspectFilters
Fix jasmine spec for aspectFilters
JavaScript
agpl-3.0
Muhannes/diaspora,Muhannes/diaspora,Amadren/diaspora,spixi/diaspora,Flaburgan/diaspora,KentShikama/diaspora,geraspora/diaspora,jhass/diaspora,geraspora/diaspora,KentShikama/diaspora,KentShikama/diaspora,Flaburgan/diaspora,Amadren/diaspora,SuperTux88/diaspora,jhass/diaspora,spixi/diaspora,despora/diaspora,diaspora/diaspora,geraspora/diaspora,diaspora/diaspora,diaspora/diaspora,despora/diaspora,SuperTux88/diaspora,Muhannes/diaspora,geraspora/diaspora,jhass/diaspora,Flaburgan/diaspora,despora/diaspora,jhass/diaspora,Flaburgan/diaspora,spixi/diaspora,despora/diaspora,SuperTux88/diaspora,KentShikama/diaspora,spixi/diaspora,SuperTux88/diaspora,Amadren/diaspora,Muhannes/diaspora,diaspora/diaspora,Amadren/diaspora
--- +++ @@ -7,7 +7,7 @@ it('initializes selectedGUIDS', function(){ expect(AspectFilters.selectedGUIDS).toEqual([]); }); - it('initializes requests', function(){ - expect(AspectFilters.requests).toEqual(0); + it('initializes activeRequest', function(){ + expect(AspectFilters.activeRequest).toEqual(null); }); });
c7d5e1985eed22d981f434ed426dfd94efb48498
plugin.js
plugin.js
'use strict'; import { EventEmitter } from 'events'; /** * Plugin Interface * @class */ export default class { /** * Construct the plugin. * @param {object} plugin */ constructor(plugin) { // Process the plugin information. (Verify should be done by the core). this.plugin = plugin; // App will be replaced with the app context of the core. this.app = null; // Make our own plugin main interface an event emitter. // This can be used to communicate and subscribe to others plugins events. EventEmitter.call(this); } }
'use strict'; import { EventEmitter } from 'events'; /** * Plugin Interface * @class */ export default class { /** * Construct the plugin. * @param {object} plugin */ constructor(plugin) { // Process the plugin information. (Verify should be done by the core). this.plugin = plugin; // Make our own plugin main interface an event emitter. // This can be used to communicate and subscribe to others plugins events. EventEmitter.call(this); } }
Remove the null assignment of app.
Remove the null assignment of app.
JavaScript
isc
ManiaJS/plugins,ManiaJS/plugins,ManiaJS/plugins
--- +++ @@ -16,9 +16,6 @@ // Process the plugin information. (Verify should be done by the core). this.plugin = plugin; - // App will be replaced with the app context of the core. - this.app = null; - // Make our own plugin main interface an event emitter. // This can be used to communicate and subscribe to others plugins events. EventEmitter.call(this);
6431a67dde0b74a284087f2dd6c6889c9cbc4de6
server.js
server.js
/*jslint node:true */ "use strict"; var path = require('path'); var express = require('express'); var server = express(); var faye = require('faye'); var bayeux = new faye.NodeAdapter({ mount: '/meet', timeout: 45 }); var env = server.get('env'); // Heroku will specify the port to listen on with the `process.env.PORT` variable. var serverPort = process.env.PORT || 4202; // gzip scripts/css when possible. server.use(express.compress()); // Pretty print HTML outputs in development and debug configurations if(env !== 'production'){ server.locals.pretty = true; } // Development Settings server.configure(function(){ server.use(express.errorHandler({ dumpExceptions: true, showStack: true })); }); // Production Settings server.configure('production', function(){ server.use(express.errorHandler()); }); // Mount the `public` directory for static file serving. server.use(express.static(path.resolve(__dirname + "/public"))); // Set up faye realtime connections var hServer = server.listen(serverPort); bayeux.attach(hServer); console.log("Server running on port " + serverPort);
/*jslint node:true */ "use strict"; var path = require('path'); var express = require('express'); var server = express(); var faye = require('faye'); var bayeux = new faye.NodeAdapter({ mount: '/meet', timeout: 45 }); var env = server.get('env'); // Heroku will specify the port to listen on with the `process.env.PORT` variable. var serverPort = process.env.PORT || 4202; // gzip scripts/css when possible. server.use(express.compress()); // Pretty print HTML outputs in development and debug configurations if(env !== 'production'){ server.locals.pretty = true; } // Development Settings server.configure(function(){ server.use(express.errorHandler({ dumpExceptions: true, showStack: true })); }); // Production Settings server.configure('production', function(){ server.use(express.errorHandler()); }); // Mount the `public` directory for static file serving. server.use(express.static(path.resolve(__dirname + "/public"))); server.use("/source", express.static(path.resolve(__dirname + "/source"))); // Set up faye realtime connections var hServer = server.listen(serverPort); bayeux.attach(hServer); console.log("Server running on port " + serverPort);
Add '/source' static asset mount so that Source maps resolve when debugging.
Add '/source' static asset mount so that Source maps resolve when debugging.
JavaScript
mit
sococo/sococo-rtc,sococo/sococo-rtc
--- +++ @@ -37,6 +37,8 @@ // Mount the `public` directory for static file serving. server.use(express.static(path.resolve(__dirname + "/public"))); +server.use("/source", express.static(path.resolve(__dirname + "/source"))); + // Set up faye realtime connections var hServer = server.listen(serverPort); bayeux.attach(hServer);
4658fb2d6b24169a195d75c34a85bfb40cad0a27
server.js
server.js
/* jshint node: true, browser: false */ 'use strict'; // CREATE HTTP SERVER AND PROXY var app = require('express')(); var proxy = require('http-proxy').createProxyServer({}); proxy.on('error', function(e) { console.error(e); }); //ignore errors // LOAD CONFIGURATION var oneDay = 86400000; var cacheTag = Math.random() * 0x80000000 | 0; app.use(require('morgan')('dev')); app.use(require('compression')()); app.set('port', process.env.PORT || 2000); app.use('/favicon.ico', require('serve-static')(__dirname + '/favicon.ico', { maxAge: oneDay })); // Configure routes app.use('/app', require('serve-static')(__dirname + '/app')); app.all('/app/*', function(req, res) { res.status(404).send(); } ); app.all('/api/*', function(req, res) { proxy.web(req, res, { target: 'https://api.cbd.int:443', secure: false } ); } ); // Configure index.html app.get('/*', function (req, res) { res.cookie('cachetag', cacheTag); res.sendFile(__dirname + '/app/index.html'); }); // Start server app.listen(app.get('port'), function () { console.log('Server listening on %j', this.address()); });
/* jshint node: true, browser: false */ 'use strict'; // CREATE HTTP SERVER AND PROXY var app = require('express')(); var proxy = require('http-proxy').createProxyServer({}); proxy.on('error', function(e) { console.error(e); }); //ignore errors // LOAD CONFIGURATION var oneDay = 86400000; var cacheTag = Math.random() * 0x80000000 | 0; app.use(require('morgan')('dev')); app.set('port', process.env.PORT || 2000); app.use('/favicon.ico', require('serve-static')(__dirname + '/favicon.ico', { maxAge: oneDay })); // Configure routes app.use('/app', require('serve-static')(__dirname + '/app')); app.all('/app/*', function(req, res) { res.status(404).send(); } ); app.all('/api/*', function(req, res) { proxy.web(req, res, { target: 'https://api.cbd.int:443', secure: false } ); } ); // Configure index.html app.get('/*', function (req, res) { res.cookie('cachetag', cacheTag); res.sendFile(__dirname + '/app/index.html'); }); // Start server app.listen(app.get('port'), function () { console.log('Server listening on %j', this.address()); });
Remove compression (done at NGINX level)
Remove compression (done at NGINX level)
JavaScript
mit
scbd/chm.cbd.int,scbd/chm.cbd.int,scbd/chm.cbd.int
--- +++ @@ -16,7 +16,6 @@ var cacheTag = Math.random() * 0x80000000 | 0; app.use(require('morgan')('dev')); -app.use(require('compression')()); app.set('port', process.env.PORT || 2000); app.use('/favicon.ico', require('serve-static')(__dirname + '/favicon.ico', { maxAge: oneDay }));
d67a24d51e4b1714f2321f8725dc572553d0e1c1
player.js
player.js
var _ = require('underscore'), Hand = require('pokersolver').Hand; var extractHandFromGame = function(game_state){ return ['As', 'Ac']; }; module.exports = { VERSION: "Default JavaScript folding player", bet_request: function(game_state, bet) { var handToBetOn = extractHandFromGame(game_state), hand = Hand.solve(handToBetOn), handRank = hand.rank; if(game_state) console.log(JSON.stringify(game_state)); bet(200); }, hand : function(game_state) { return undefined; }, showdown: function(game_state) { } };
module.exports = { VERSION: "Default JavaScript folding player", bet_request: function(game_state, bet) { if(game_state) console.log(JSON.stringify(game_state)); bet(200); }, hand : function(game_state) { return undefined; }, showdown: function(game_state) { } };
Revert " add dependencies + function declaration"
Revert " add dependencies + function declaration" This reverts commit 59b6f5a37ab886e7410dd1125d3cc23b558fab63.
JavaScript
mit
ddanciu/poker-player-hilarious-eagle
--- +++ @@ -1,20 +1,9 @@ -var _ = require('underscore'), - Hand = require('pokersolver').Hand; - - -var extractHandFromGame = function(game_state){ - return ['As', 'Ac']; -}; module.exports = { VERSION: "Default JavaScript folding player", bet_request: function(game_state, bet) { - - var handToBetOn = extractHandFromGame(game_state), - hand = Hand.solve(handToBetOn), - handRank = hand.rank; if(game_state) console.log(JSON.stringify(game_state));
db7be64b7a8a066a0a0eca6047e302d285a4c4a7
src/components/Intro.js
src/components/Intro.js
import React from 'react'; import styled from '@emotion/styled'; const Content = styled.div` width: 100%; max-width: 580px; padding: 20px 25px; border-radius: 3px; margin: 0 auto 60px; background: rgba(0, 0, 0, 0.04); font-size: 15px; color: #333; `; export default () => ( <Content> <p> At <a href="https://www.mirego.com">Mirego</a>, we build a huge majority of our products using open source technologies (eg.{' '} <a href="https://emberjs.com/">Ember.js</a>,{' '} <a target="_blank" rel="noopener noreferrer" href="https://reactjs.org/"> React </a> ,{' '} <a target="_blank" rel="noopener noreferrer" href="https://elixir-lang.org/" > Elixir </a> ,{' '} <a target="_blank" rel="noopener noreferrer" href="https://rubyonrails.org/" > Ruby on Rails </a> , etc.) maintained by stable, mature and active communities. </p> <p> It’s very important for us to give back to these communities by either contributing directly to their projects or by providing libraries and tools that add value to their respective ecosystem. </p> </Content> );
import React from 'react'; import styled from '@emotion/styled'; const Content = styled.div` width: 100%; max-width: 580px; padding: 20px 25px; border-radius: 3px; margin: 0 auto 60px; background: rgba(0, 0, 0, 0.04); font-size: 15px; color: #333; `; export default () => ( <Content> <p> At <a href="https://www.mirego.com">Mirego</a>, we build a huge majority of our products using open source technologies (eg.{' '} <a href="https://emberjs.com/">Ember.js</a>,{' '} <a target="_blank" rel="noopener noreferrer" href="https://reactjs.org/"> React </a> ,{' '} <a target="_blank" rel="noopener noreferrer" href="https://elixir-lang.org/" > Elixir </a> ,{' '} <a target="_blank" rel="noopener noreferrer" href="https://swift.org/"> Swift </a> , etc.) maintained by stable, mature and active communities. </p> <p> It’s very important for us to give back to these communities by either contributing directly to their projects or by providing libraries and tools that add value to their respective ecosystem. </p> </Content> );
Replace Rails with Swift in intro
Replace Rails with Swift in intro
JavaScript
bsd-3-clause
mirego/mirego-open-web,mirego/mirego-open-web
--- +++ @@ -30,12 +30,8 @@ Elixir </a> ,{' '} - <a - target="_blank" - rel="noopener noreferrer" - href="https://rubyonrails.org/" - > - Ruby on Rails + <a target="_blank" rel="noopener noreferrer" href="https://swift.org/"> + Swift </a> , etc.) maintained by stable, mature and active communities. </p>
7156ec87fbbec8aec7c9c354e8fb7646777170b4
app/scripts/components/resource/list/resource-vms-list.js
app/scripts/components/resource/list/resource-vms-list.js
const resourceVmsList = { controller: ProjectVirtualMachinesListController, controllerAs: 'ListController', templateUrl: 'views/partials/filtered-list.html', }; export default resourceVmsList; function ProjectVirtualMachinesListController(BaseProjectResourcesTabController, ENV) { var controllerScope = this; var ResourceController = BaseProjectResourcesTabController.extend({ init: function() { this.controllerScope = controllerScope; this.category = ENV.VirtualMachines; this._super(); this.rowFields.push('internal_ips'); this.rowFields.push('external_ips'); }, getTableOptions: function() { var options = this._super(); options.noDataText = 'You have no virtual machines yet'; options.noMatchesText = 'No virtual machines found matching filter.'; options.columns.push({ title: gettext('Internal IP'), render: function(row) { if (row.internal_ips.length === 0) { return '&ndash;'; } return row.internal_ips.join(', '); } }); options.columns.push({ title: gettext('External IP'), render: function(row) { if (row.external_ips.length === 0) { return '&ndash;'; } return row.external_ips.join(', '); } }); return options; }, getImportTitle: function() { return 'Import virtual machine'; }, getCreateTitle: function() { return 'Add virtual machine'; }, }); controllerScope.__proto__ = new ResourceController(); }
const resourceVmsList = { controller: ProjectVirtualMachinesListController, controllerAs: 'ListController', templateUrl: 'views/partials/filtered-list.html', }; export default resourceVmsList; function ProjectVirtualMachinesListController(BaseProjectResourcesTabController, ENV) { var controllerScope = this; var ResourceController = BaseProjectResourcesTabController.extend({ init: function() { this.controllerScope = controllerScope; this.category = ENV.VirtualMachines; this._super(); this.rowFields.push('internal_ips'); this.rowFields.push('external_ips'); this.rowFields.push('floating_ips'); this.rowFields.push('internal_ips_set'); }, getTableOptions: function() { var options = this._super(); options.noDataText = 'You have no virtual machines yet'; options.noMatchesText = 'No virtual machines found matching filter.'; options.columns.push({ title: gettext('Internal IP'), render: function(row) { if (row.internal_ips.length === 0) { return '&ndash;'; } return row.internal_ips.join(', '); } }); options.columns.push({ title: gettext('External IP'), render: function(row) { if (row.external_ips.length === 0) { return '&ndash;'; } return row.external_ips.join(', '); } }); return options; }, getImportTitle: function() { return 'Import virtual machine'; }, getCreateTitle: function() { return 'Add virtual machine'; }, }); controllerScope.__proto__ = new ResourceController(); }
Load external and internal IPs
Load external and internal IPs [WAL-542]
JavaScript
mit
opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport
--- +++ @@ -15,6 +15,8 @@ this._super(); this.rowFields.push('internal_ips'); this.rowFields.push('external_ips'); + this.rowFields.push('floating_ips'); + this.rowFields.push('internal_ips_set'); }, getTableOptions: function() { var options = this._super();
7241a9852cc0a5b44b280663e5fad31390f0f567
src/js/pebble-js-app.js
src/js/pebble-js-app.js
(function(Pebble, window) { var settings = {}; Pebble.addEventListener("ready", function(e) { settings = window.localStorage.getItem("settings"); if(settings !== "") { var options = JSON.parse(settings); Pebble.sendAppMessage(options); } }); Pebble.addEventListener("showConfiguration", function() { settings = window.localStorage.getItem("settings"); if(!settings) { settings = {}; } Pebble.openURL("http://rexmac.com/projects/pebble/chronocode/settings.html#" + encodeURIComponent(JSON.stringify(settings))); }); Pebble.addEventListener("webviewclosed", function(e) { var options = JSON.parse(decodeURIComponent(e.response)); if(Object.keys(options).length > 0) { window.localStorage.setItem("settings", JSON.stringify(options)); Pebble.sendAppMessage(options); } }) })(Pebble, window);
(function(Pebble, window) { var settings = {}; Pebble.addEventListener("ready", function(e) { settings = window.localStorage.getItem("settings"); if(settings !== "") { var options = JSON.parse(settings); Pebble.sendAppMessage(options); } }); Pebble.addEventListener("showConfiguration", function() { settings = window.localStorage.getItem("settings"); if(!settings) { settings = "{}"; } Pebble.openURL("http://rexmac.com/projects/pebble/chronocode/settings.html#" + encodeURIComponent(JSON.stringify(settings))); }); Pebble.addEventListener("webviewclosed", function(e) { var rt = typeof e.response, options = (rt === "undefined" ? {} : JSON.parse(decodeURIComponent(e.response))); if(Object.keys(options).length > 0) { window.localStorage.setItem("settings", JSON.stringify(options)); Pebble.sendAppMessage(options); } }) })(Pebble, window);
Fix some bugs in handling of settings
Fix some bugs in handling of settings
JavaScript
bsd-3-clause
rexmac/pebble-chronocode,jojoman3/Test,jojoman3/Test,rexmac/pebble-chronocode,jojoman3/Test,rexmac/pebble-chronocode,rexmac/pebble-chronocode,jojoman3/Test
--- +++ @@ -12,13 +12,14 @@ Pebble.addEventListener("showConfiguration", function() { settings = window.localStorage.getItem("settings"); if(!settings) { - settings = {}; + settings = "{}"; } Pebble.openURL("http://rexmac.com/projects/pebble/chronocode/settings.html#" + encodeURIComponent(JSON.stringify(settings))); }); Pebble.addEventListener("webviewclosed", function(e) { - var options = JSON.parse(decodeURIComponent(e.response)); + var rt = typeof e.response, + options = (rt === "undefined" ? {} : JSON.parse(decodeURIComponent(e.response))); if(Object.keys(options).length > 0) { window.localStorage.setItem("settings", JSON.stringify(options)); Pebble.sendAppMessage(options);
9e1703e71d1bcd0eaa51d6eabd13fa04be95873c
server.js
server.js
var restify = require('restify'); var builder = require('botbuilder'); // Get secrets from server environment var botConnectorOptions = { appId: process.env.MICROSOFT_APP_ID, appSecret: process.env.MICROSOFT_APP_PASSWORD }; // Create bot var bot = new builder.BotConnectorBot(botConnectorOptions); bot.add('/', function (session) { //respond with user's message session.send("You said " + session.message.text); }); // Setup Restify Server var server = restify.createServer(); // Handle Bot Framework messages server.post('/api/messages', bot.verifyBotFramework(), bot.listen()); // Serve a static web page server.get(/.*/, restify.serveStatic({ 'directory': '.', 'default': 'index.html' })); server.listen(process.env.port || 3978, function () { console.log('%s listening to %s', server.name, server.url); });
var restify = require('restify'); var builder = require('botbuilder'); // Get secrets from server environment var botConnectorOptions = { appId: process.env.MICROSOFT_APP_ID, appSecret: process.env.MICROSOFT_APP_PASSWORD }; // Create bot var bot = new builder.BotConnectorBot(botConnectorOptions); bot.add('/', function (session) { //respond with user's message console.log('message received') session.send("You said " + session.message.text); }); // Setup Restify Server var server = restify.createServer(); // Handle Bot Framework messages server.post('/api/messages', bot.listen()); // Serve a static web page server.get(/.*/, restify.serveStatic({ 'directory': '.', 'default': 'index.html' })); server.listen(process.env.port || 3978, function () { console.log('%s listening to %s', server.name, server.url); });
Add console.log et remove verify for bot framework
Add console.log et remove verify for bot framework
JavaScript
mit
suancarloj/cheapandbot,suancarloj/cheapandbot
--- +++ @@ -12,6 +12,7 @@ bot.add('/', function (session) { //respond with user's message + console.log('message received') session.send("You said " + session.message.text); }); @@ -19,7 +20,7 @@ var server = restify.createServer(); // Handle Bot Framework messages -server.post('/api/messages', bot.verifyBotFramework(), bot.listen()); +server.post('/api/messages', bot.listen()); // Serve a static web page server.get(/.*/, restify.serveStatic({
df3678a76187799e7aa4c0bec65d0efa873a7907
server.js
server.js
( // serve up dynamic content function () { // this code returns a web page with a word, ignoring the path "use strict"; var http = require( 'http' ); var rword = require('./get-word.js'); http.createServer( function ( request, response ) { response.setHeader( "Content-Type", "text/html" ); response.writeHead( 200 ); response.write( '<html><head><title>Random Inspiration</title></head>' ); response.write( '<body>' ); var w = rword.getWord(); response.write( '\n<h1>' ); response.write( w ); response.write( '</h1>' ); response.end('</body></html>'); } ).listen( process.env.PORT || 8888 ); }() );
( // serve up dynamic content function () { // this code returns a web page with a word, ignoring the path "use strict"; var http = require( 'http' ); var rword = require( './get-word.js' ); http.createServer( function ( request, response ) { var word = rword.getWord(); response.setHeader( "Content-Type", "text/html" ); response.writeHead( 200 ); response.write( '<html>\n' ); response.write( '<head>\n' ); response.write( '<title>Random Inspiration2</title>\n' ); response.write( '<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet" type="text/css" />\n' ); response.write( '<body>\n' ); // start container response.write( '<div class="container">\n' ); // heading response.write( '<div class="row">\n' ); response.write( '<div class="col-xs-12">\n' ); response.write( '<h1 class="text-center">Random Inspiration</h1>' ); response.write( '</div>\n' ); response.write( '</div>\n' ); // content response.write( '<div class="row">\n' ); response.write( '<div class="col-xs-12">\n' ); response.write( '<h2 class="text-center">' ); response.write( word ); response.write( '</h2>\n' ); response.write( '</div>\n' ); response.write( '</div>\n' ); // button response.write( '<div class="row">\n' ); response.write( '<div class="col-xs-12 text-center">\n' ); response.write( '<div class="btn btn-primary" onclick="location.reload();">' ); response.write( 'again' ); response.write( '</div>\n' ); response.write( '</div>\n' ); response.write( '</div>\n' ); // end container response.write( '</div>\n' ); response.write( '</body>\n' ); // end response.end( '</html>\n' ); } ).listen( process.env.PORT || 8888 ); }() );
Add bootstrap & some styling
Add bootstrap & some styling
JavaScript
mit
peterorum/random,peterorum/random,peterorum/random
--- +++ @@ -8,22 +8,61 @@ "use strict"; var http = require( 'http' ); - var rword = require('./get-word.js'); + var rword = require( './get-word.js' ); http.createServer( function ( request, response ) { + var word = rword.getWord(); + response.setHeader( "Content-Type", "text/html" ); response.writeHead( 200 ); - response.write( '<html><head><title>Random Inspiration</title></head>' ); - response.write( '<body>' ); + response.write( '<html>\n' ); + response.write( '<head>\n' ); + response.write( '<title>Random Inspiration2</title>\n' ); + response.write( '<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet" type="text/css" />\n' ); + response.write( '<body>\n' ); - var w = rword.getWord(); + // start container + response.write( '<div class="container">\n' ); - response.write( '\n<h1>' ); - response.write( w ); - response.write( '</h1>' ); + // heading + response.write( '<div class="row">\n' ); + response.write( '<div class="col-xs-12">\n' ); - response.end('</body></html>'); + response.write( '<h1 class="text-center">Random Inspiration</h1>' ); + + response.write( '</div>\n' ); + response.write( '</div>\n' ); + + // content + response.write( '<div class="row">\n' ); + response.write( '<div class="col-xs-12">\n' ); + + response.write( '<h2 class="text-center">' ); + response.write( word ); + response.write( '</h2>\n' ); + + response.write( '</div>\n' ); + response.write( '</div>\n' ); + + // button + response.write( '<div class="row">\n' ); + response.write( '<div class="col-xs-12 text-center">\n' ); + + response.write( '<div class="btn btn-primary" onclick="location.reload();">' ); + response.write( 'again' ); + response.write( '</div>\n' ); + + response.write( '</div>\n' ); + response.write( '</div>\n' ); + + // end container + response.write( '</div>\n' ); + + response.write( '</body>\n' ); + + // end + response.end( '</html>\n' ); } ).listen( process.env.PORT || 8888 ); }() );
d8c6d3dd082d625c4ac816c4f8d204abe713428b
webapp/config/environment.js
webapp/config/environment.js
/* jshint node: true */ module.exports = function(environment) { var ENV = { modulePrefix: 'bookmeister', environment: environment, baseURL: '/', locationType: 'auto', bookmeisterServer: '', EmberENV: { FEATURES: { // Here you can enable experimental features on an ember canary build // e.g. 'with-controller': true } }, APP: { // Here you can pass flags/options to your application instance // when it is created } }; if (environment === 'development') { // ENV.APP.LOG_RESOLVER = true; // ENV.APP.LOG_ACTIVE_GENERATION = true; // ENV.APP.LOG_TRANSITIONS = true; // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; // ENV.APP.LOG_VIEW_LOOKUPS = true; ENV.bookmeisterServer = 'http://d8.d8.hoegh.co:8080'; ENV.contentSecurityPolicy = { 'connect-src': "'self' http://d8.d8.hoegh.co:8080 http://localhost:35729" }; } if (environment === 'test') { // Testem prefers this... ENV.baseURL = '/'; ENV.locationType = 'none'; // keep test console output quieter ENV.APP.LOG_ACTIVE_GENERATION = false; ENV.APP.LOG_VIEW_LOOKUPS = false; ENV.APP.rootElement = '#ember-testing'; } if (environment === 'production') { } return ENV; };
/* jshint node: true */ module.exports = function(environment) { var ENV = { modulePrefix: 'bookmeister', environment: environment, baseURL: '/', locationType: 'auto', bookmeisterServer: '', EmberENV: { FEATURES: { // Here you can enable experimental features on an ember canary build // e.g. 'with-controller': true } }, APP: { // Here you can pass flags/options to your application instance // when it is created } }; if (environment === 'development') { // ENV.APP.LOG_RESOLVER = true; // ENV.APP.LOG_ACTIVE_GENERATION = true; // ENV.APP.LOG_TRANSITIONS = true; // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; // ENV.APP.LOG_VIEW_LOOKUPS = true; ENV.bookmeisterServer = 'http://localhost:6300'; ENV.contentSecurityPolicy = { 'connect-src': "'self' http://localhost:6300 http://localhost:35729" }; } if (environment === 'test') { // Testem prefers this... ENV.baseURL = '/'; ENV.locationType = 'none'; // keep test console output quieter ENV.APP.LOG_ACTIVE_GENERATION = false; ENV.APP.LOG_VIEW_LOOKUPS = false; ENV.APP.rootElement = '#ember-testing'; } if (environment === 'production') { } return ENV; };
Correct URL for the backend server.
Correct URL for the backend server.
JavaScript
isc
mikl/bookmeister,mikl/bookmeister
--- +++ @@ -26,10 +26,10 @@ // ENV.APP.LOG_TRANSITIONS = true; // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; // ENV.APP.LOG_VIEW_LOOKUPS = true; - ENV.bookmeisterServer = 'http://d8.d8.hoegh.co:8080'; + ENV.bookmeisterServer = 'http://localhost:6300'; ENV.contentSecurityPolicy = { - 'connect-src': "'self' http://d8.d8.hoegh.co:8080 http://localhost:35729" + 'connect-src': "'self' http://localhost:6300 http://localhost:35729" }; }
361998317f9ba9db5b4aa3b4193a1b277bd773de
webpack.production.config.js
webpack.production.config.js
// Breaks for some reason /* eslint comma-dangle: ["error", {"functions": "arrays": "always-multiline", "objects": "always-multiline", "imports": "always-multiline", "exports": "always-multiline", "functions": "ignore", }] */ const config = require('./webpack.config.js'); const webpack = require('webpack'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); config.devtool = 'cheap-module-source-map'; // Set environment to production config.plugins.push(new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify('production'), }, })); // Extract css to file // Replace less loader Object.keys(config.module.loaders).forEach((key) => { if ({}.hasOwnProperty.call(config.module.loaders, key)) { const loader = config.module.loaders[key]; if ('.less'.match(loader.test)) { loader.loader = ExtractTextPlugin.extract( 'css-loader?sourceMap!' + 'less-loader?sourceMap' ); } } }); // Add extract text plugin config.plugins.push(new ExtractTextPlugin('[name]-[hash].css')); // Uglify js config.plugins.push(new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false, screw_ie8: true, }, comments: false, })); module.exports = config;
// Breaks for some reason /* eslint comma-dangle: ["error", {"functions": "arrays": "always-multiline", "objects": "always-multiline", "imports": "always-multiline", "exports": "always-multiline", "functions": "ignore", }] */ const config = require('./webpack.config.js'); const webpack = require('webpack'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); config.devtool = 'cheap-source-map'; // Set environment to production config.plugins.push(new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify('production'), }, })); // Extract css to file // Remove style loader Object.keys(config.module.loaders).forEach((key) => { if ({}.hasOwnProperty.call(config.module.loaders, key)) { const loader = config.module.loaders[key]; if ('.less'.match(loader.test)) { loader.loader = ExtractTextPlugin.extract( 'css-loader?sourceMap!' + 'less-loader?sourceMap' ); } if ('.css'.match(loader.test)) { loader.loader = ExtractTextPlugin.extract( 'css-loader?sourceMap' ); } } }); // Add extract text plugin config.plugins.push(new ExtractTextPlugin('[name]-[hash].css')); // Uglify js config.plugins.push(new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false, screw_ie8: true, }, comments: false, })); module.exports = config;
Remove style-loader from .css too
Remove style-loader from .css too
JavaScript
mit
dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4
--- +++ @@ -11,7 +11,7 @@ const webpack = require('webpack'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); -config.devtool = 'cheap-module-source-map'; +config.devtool = 'cheap-source-map'; // Set environment to production config.plugins.push(new webpack.DefinePlugin({ @@ -22,7 +22,7 @@ // Extract css to file -// Replace less loader +// Remove style loader Object.keys(config.module.loaders).forEach((key) => { if ({}.hasOwnProperty.call(config.module.loaders, key)) { const loader = config.module.loaders[key]; @@ -30,6 +30,11 @@ loader.loader = ExtractTextPlugin.extract( 'css-loader?sourceMap!' + 'less-loader?sourceMap' + ); + } + if ('.css'.match(loader.test)) { + loader.loader = ExtractTextPlugin.extract( + 'css-loader?sourceMap' ); } }
453055d9b8142adaeb75f0e84cc4d3ce9e7f66f1
test/spec/controllers/authentication.js
test/spec/controllers/authentication.js
'use strict'; describe('Controller: AuthenticationCtrl', function () { // load the controller's module beforeEach(module('dockstore.ui')); var AuthenticationCtrl, scope; // Initialize the controller and a mock scope beforeEach(inject(function ($controller, $rootScope) { scope = $rootScope.$new(); AuthenticationCtrl = $controller('AuthenticationCtrl', { $scope: scope // place here mocked dependencies }); })); it('should attach a list of awesomeThings to the scope', function () { expect(AuthenticationCtrl.awesomeThings.length).toBe(3); }); });
'use strict'; describe('Controller: AuthenticationCtrl', function () { // load the controller's module beforeEach(module('dockstore.ui')); var AuthenticationCtrl, scope; // Initialize the controller and a mock scope beforeEach(inject(function ($controller, $rootScope) { scope = $rootScope.$new(); AuthenticationCtrl = $controller('AuthenticationCtrl', { $scope: scope // place here mocked dependencies }); })); // it('should attach a list of awesomeThings to the scope', function () { // expect(AuthenticationCtrl.awesomeThings.length).toBe(3); // }); });
Disable unused tests to fix the build.
Disable unused tests to fix the build.
JavaScript
apache-2.0
ga4gh/dockstore-ui,ga4gh/dockstore-ui,ga4gh/dockstore-ui
--- +++ @@ -17,7 +17,7 @@ }); })); - it('should attach a list of awesomeThings to the scope', function () { - expect(AuthenticationCtrl.awesomeThings.length).toBe(3); - }); + // it('should attach a list of awesomeThings to the scope', function () { + // expect(AuthenticationCtrl.awesomeThings.length).toBe(3); + // }); });
204d48dba743903b4b72e23a108e6a77ce4ccb02
tests/actions/nav.js
tests/actions/nav.js
import { expect } from 'chai' import types from '../../src/constants/actionTypes' import { onClickMenuButton } from '../../src/actions/nav' describe('actions/nav.js', () => { it('should toggle sidebar menu when click on menu button', () => { const isExpanded = false expect(onClickMenuButton(isExpanded)).to.deep.equal({ type: types.ON_CLICK_MENU_BUTTON, isExpanded: ! isExpanded }) }) })
import { expect } from 'chai' import types from '../../src/constants/actionTypes' import { onClickMenuButton } from '../../src/actions/nav' describe('actions/nav.js', () => { it('should toggle state "true" when click on menu button', () => { const isExpanded = false expect(onClickMenuButton(isExpanded)).to.deep.equal({ type: types.ON_CLICK_MENU_BUTTON, isExpanded: ! isExpanded }) }) it('should toggle state "false" when click on menu button', () => { const isExpanded = true expect(onClickMenuButton(isExpanded)).to.deep.equal({ type: types.ON_CLICK_MENU_BUTTON, isExpanded: ! isExpanded }) }) })
Add toggle false on click menu button
Add toggle false on click menu button
JavaScript
mit
nomkhonwaan/nomkhonwaan.github.io
--- +++ @@ -3,7 +3,7 @@ import { onClickMenuButton } from '../../src/actions/nav' describe('actions/nav.js', () => { - it('should toggle sidebar menu when click on menu button', () => { + it('should toggle state "true" when click on menu button', () => { const isExpanded = false expect(onClickMenuButton(isExpanded)).to.deep.equal({ @@ -11,4 +11,13 @@ isExpanded: ! isExpanded }) }) + + it('should toggle state "false" when click on menu button', () => { + const isExpanded = true + + expect(onClickMenuButton(isExpanded)).to.deep.equal({ + type: types.ON_CLICK_MENU_BUTTON, + isExpanded: ! isExpanded + }) + }) })
671db2df7f329ed0a23cd4d7f974cdc196e34e93
tests/support/integration-assertions.js
tests/support/integration-assertions.js
/*global QUnit*/ import Emblem from '../../emblem'; export function compilesTo( emblem, handlebars, message ) { var output = Emblem.compile(emblem); if (!message) { var maxLenth = 40; var messageEmblem = emblem.replace(/\n/g, "\\n"); if (messageEmblem.length > maxLenth) { messageEmblem = messageEmblem.slice(0,maxLenth) + '...'; } message = 'Expected "' + messageEmblem + '" to compile to "' + handlebars + '"'; } QUnit.push(output === handlebars, output, handlebars, message); };
/*global QUnit*/ import { w } from '../support/utils'; import Emblem from '../../emblem'; export function compilesTo( emblem, handlebars, message ) { var output = Emblem.compile(emblem); if (!message) { var maxLenth = 40; var messageEmblem = emblem.replace(/\n/g, "\\n"); if (messageEmblem.length > maxLenth) { messageEmblem = messageEmblem.slice(0,maxLenth) + '...'; } message = w( 'compilesTo assertion failed:', '\tEmblem: "' + messageEmblem + '"', '\tExpected: "' + handlebars + '"', '\tActual: "' + output + '"' ) } QUnit.push(output === handlebars, output, handlebars, message); };
Print a better message if assertion fails
Print a better message if assertion fails
JavaScript
mit
patricklx/emblem.js,patricklx/emblem.js,thec0keman/emblem.js,machty/emblem.js,machty/emblem.js,thec0keman/emblem.js,patricklx/emblem.js,bvellacott/emblem.js,NichenLg/emblem.js,machty/emblem.js,bvellacott/emblem.js,NichenLg/emblem.js,bvellacott/emblem.js,thec0keman/emblem.js,NichenLg/emblem.js
--- +++ @@ -1,4 +1,6 @@ /*global QUnit*/ + +import { w } from '../support/utils'; import Emblem from '../../emblem'; export function compilesTo( emblem, handlebars, message ) { @@ -9,7 +11,12 @@ if (messageEmblem.length > maxLenth) { messageEmblem = messageEmblem.slice(0,maxLenth) + '...'; } - message = 'Expected "' + messageEmblem + '" to compile to "' + handlebars + '"'; + message = w( + 'compilesTo assertion failed:', + '\tEmblem: "' + messageEmblem + '"', + '\tExpected: "' + handlebars + '"', + '\tActual: "' + output + '"' + ) } QUnit.push(output === handlebars, output, handlebars, message); };
94f4752a0a5ad07c38aa68cc79fef954a2379d1d
test/compile.js
test/compile.js
const test = require('ava') const path = require('path') const { readdirSync, readFileSync } = require('fs') const { compile, format } = require('../') const fixtures = path.join(__dirname, 'fixtures') const fixture = file => path.join(fixtures, file) const testFiles = readdirSync(fixtures) .filter(file => file.endsWith('.js')) .map(file => ({ [file]: { js: readFileSync(fixture(file)).toString(), re: readFileSync(fixture(file.replace('.js', '.re'))).toString() } })) .reduce((all, mod) => Object.assign({}, all, mod), {}) const compareSources = (t, { js, re }) => { t.is(compile(js), format(re)) } Object.entries(testFiles).forEach(([moduleName, source]) => { test(`Compile ${moduleName}`, compareSources, source) })
const test = require('ava') const path = require('path') const { readdirSync, readFile } = require('fs') const { compile, format } = require('../') const fixtures = path.join(__dirname, 'fixtures') const fixture = file => path.join(fixtures, file) const testFiles = readdirSync(fixtures) .filter(file => file.endsWith('.js')) .map(file => ({ [file]: { js: new Promise((resolve, reject) => { readFile(fixture(file), (err, data) => { if (err) return reject(err) resolve(data.toString()) }) }), re: new Promise((resolve, reject) => { readFile(fixture(file.replace('.js', '.re')), (err, data) => { if (err) return reject(err) resolve(data.toString()) }) }) } })) .reduce((all, mod) => Object.assign({}, all, mod), {}) const compareSources = async (t, { js, re }) => { t.is(compile(await js), format(await re)) } Object.entries(testFiles).forEach(([moduleName, source]) => { test(`Compile ${moduleName}`, compareSources, source) })
Use readFile instead of readFileSync in tests
Use readFile instead of readFileSync in tests
JavaScript
mit
rrdelaney/ReasonablyTyped,ReasonablyTyped/ReasonablyTyped,ReasonablyTyped/ReasonablyTyped,rrdelaney/ReasonablyTyped
--- +++ @@ -1,6 +1,6 @@ const test = require('ava') const path = require('path') -const { readdirSync, readFileSync } = require('fs') +const { readdirSync, readFile } = require('fs') const { compile, format } = require('../') const fixtures = path.join(__dirname, 'fixtures') const fixture = file => path.join(fixtures, file) @@ -9,15 +9,25 @@ .filter(file => file.endsWith('.js')) .map(file => ({ [file]: { - js: readFileSync(fixture(file)).toString(), - re: readFileSync(fixture(file.replace('.js', '.re'))).toString() + js: new Promise((resolve, reject) => { + readFile(fixture(file), (err, data) => { + if (err) return reject(err) + resolve(data.toString()) + }) + }), + re: new Promise((resolve, reject) => { + readFile(fixture(file.replace('.js', '.re')), (err, data) => { + if (err) return reject(err) + resolve(data.toString()) + }) + }) } })) .reduce((all, mod) => Object.assign({}, all, mod), {}) -const compareSources = (t, { js, re }) => { - t.is(compile(js), format(re)) +const compareSources = async (t, { js, re }) => { + t.is(compile(await js), format(await re)) } Object.entries(testFiles).forEach(([moduleName, source]) => {
075d715f6a3703268fb73eee973f1a90e86887ee
test/imports.js
test/imports.js
"use strict"; var path = require("path"), assert = require("assert"), imports = require("../imports"); describe("postcss-css-modules", function() { describe("imports", function() { it("should walk dependencies", function() { var result = imports.process("./test/specimens/imports/start.css"); assert("files" in result); assert(path.join(__dirname, "./specimens/imports/start.css") in result.files); assert(path.join(__dirname, "./specimens/imports/local.css") in result.files); assert(path.join(__dirname, "./specimens/imports/folder/folder.css") in result.files); }); it("should walk dependencies into node_modules", function() { var result = imports.process("./test/specimens/imports/node_modules.css"); assert(path.join(__dirname, "./specimens/imports/node_modules.css") in result.files); assert(path.join(__dirname, "./specimens/imports/node_modules/test-styles/styles.css") in result.files); }); }); }); });
"use strict"; var path = require("path"), assert = require("assert"), imports = require("../imports"); describe("postcss-css-modules", function() { describe("imports", function() { it("should walk dependencies", function() { var result = imports.process("./test/specimens/imports/start.css"); assert("files" in result); assert(path.join(__dirname, "./specimens/imports/start.css") in result.files); assert(path.join(__dirname, "./specimens/imports/local.css") in result.files); assert(path.join(__dirname, "./specimens/imports/folder/folder.css") in result.files); }); it("should walk dependencies into node_modules", function() { var result = imports.process("./test/specimens/imports/node_modules.css"); assert(path.join(__dirname, "./specimens/imports/node_modules.css") in result.files); assert(path.join(__dirname, "./specimens/imports/node_modules/test-styles/styles.css") in result.files); }); it("should export identifiers and their classes", function() { var result = imports.process("./test/specimens/imports/start.css"), exports = result.exports; assert.deepEqual(exports, { wooga : [ "771db310e8d1c8c48a9d4d3e5c0af682_booga" ], booga : [ "82a0a82265094a412fd49bf12216eac5_booga" ] }); }); }); });
Test import response w/ a hierarchy
Test import response w/ a hierarchy
JavaScript
mit
tivac/modular-css
--- +++ @@ -23,6 +23,15 @@ assert(path.join(__dirname, "./specimens/imports/node_modules.css") in result.files); assert(path.join(__dirname, "./specimens/imports/node_modules/test-styles/styles.css") in result.files); }); + + it("should export identifiers and their classes", function() { + var result = imports.process("./test/specimens/imports/start.css"), + exports = result.exports; + + assert.deepEqual(exports, { + wooga : [ "771db310e8d1c8c48a9d4d3e5c0af682_booga" ], + booga : [ "82a0a82265094a412fd49bf12216eac5_booga" ] + }); }); }); });
b369652ed5114e432953b485b9c8f24ba5a2afc7
test/s3-test.js
test/s3-test.js
describe('getFolders()', function() { it('should return the correct list of folders', function() { var objects = [ { Key: '/' }, { Key: 'test/' }, { Key: 'test/test/' }, { Key: 'test/a/b' }, { Key: 'test' }, ]; chai.expect(dodgercms.utils.getFolders(objects)).to.have.members(['/', 'test/', 'test/test/', 'test/a/']); }); it('should return the root folder if the array is empty', function() { var objects = []; chai.expect(dodgercms.utils.getFolders(objects)).to.have.members(['/']); }); }); describe('newFolder()', function(){ before(function(done) { sinon .stub(dodgercms.s3, 'putObject') .yields(null, 'index'); done(); }); after(function(done) { dodgercms.s3.putObject.restore(); done(); }); it('should match the given key', function(done){ dodgercms.utils.newFolder('index', 'dataBucket','siteBucket', function(err, key) { if (err) { return done(err); } chai.assert(key === 'index'); done(); }); }); });
describe('init()', function() { it('should throw exception on missing arguments', function() { var fn = dodgercms.s3.init; chai.expect(fn).to.throw(Error) });
Add some tests from the s3 lib
Add some tests from the s3 lib
JavaScript
mit
etopian/dodgercms,ChrisZieba/dodgercms,ChrisZieba/dodgercms,etopian/dodgercms
--- +++ @@ -1,41 +1,5 @@ -describe('getFolders()', function() { - it('should return the correct list of folders', function() { - var objects = [ - { Key: '/' }, - { Key: 'test/' }, - { Key: 'test/test/' }, - { Key: 'test/a/b' }, - { Key: 'test' }, - ]; - chai.expect(dodgercms.utils.getFolders(objects)).to.have.members(['/', 'test/', 'test/test/', 'test/a/']); - }); - - it('should return the root folder if the array is empty', function() { - var objects = []; - chai.expect(dodgercms.utils.getFolders(objects)).to.have.members(['/']); - }); +describe('init()', function() { + it('should throw exception on missing arguments', function() { + var fn = dodgercms.s3.init; + chai.expect(fn).to.throw(Error) }); - -describe('newFolder()', function(){ - before(function(done) { - sinon - .stub(dodgercms.s3, 'putObject') - .yields(null, 'index'); - done(); - }); - - after(function(done) { - dodgercms.s3.putObject.restore(); - done(); - }); - - it('should match the given key', function(done){ - dodgercms.utils.newFolder('index', 'dataBucket','siteBucket', function(err, key) { - if (err) { - return done(err); - } - chai.assert(key === 'index'); - done(); - }); - }); -});
8920b74b1564eb90bd6579b50f8d8292569343ea
worker.js
worker.js
self.onmessage = function(e) { var fileReader = new FileReader(); fileReader.onloadend = function(chunk) { postMessage({bin: (fileReader.result || chunk.srcElement || chunk.target).split(',')[1], chunkId: e.data.currentChunk, start: e.data.start}); }; fileReader.onerror = function(error) { throw (error.target || error.srcElement).error; }; fileReader.readAsDataURL(e.data.file.slice(e.data.chunkSize * (e.data.currentChunk - 1), e.data.chunkSize * e.data.currentChunk)); return; };
self.onmessage = function(e) { if (self.FileReader) { var fileReader = new FileReader(); fileReader.onloadend = function(chunk) { postMessage({bin: (fileReader.result || chunk.srcElement || chunk.target).split(',')[1], chunkId: e.data.currentChunk, start: e.data.start}); }; fileReader.onerror = function(error) { throw (error.target || error.srcElement).error; }; fileReader.readAsDataURL(e.data.file.slice(e.data.chunkSize * (e.data.currentChunk - 1), e.data.chunkSize * e.data.currentChunk)); } else if (self.FileReaderSync) { var fileReader = new FileReaderSync(); postMessage({bin: fileReader.readAsDataURL(e.data.file.slice(e.data.chunkSize * (e.data.currentChunk - 1), e.data.chunkSize * e.data.currentChunk)).split(',')[1], chunkId: e.data.currentChunk, start: e.data.start}); } else { postMessage({bin: null, chunkId: e.data.currentChunk, start: e.data.start, error: 'FileReader and fileReaderSunc is not supported in WebWorker!'}); } return; };
Support for FireFox Mozilla < 46
Support for FireFox Mozilla < 46 See Mozilla bug: https://bugzilla.mozilla.org/show_bug.cgi?id=901097
JavaScript
bsd-3-clause
VeliovGroup/Meteor-Files
--- +++ @@ -1,14 +1,22 @@ self.onmessage = function(e) { - var fileReader = new FileReader(); + if (self.FileReader) { + var fileReader = new FileReader(); + fileReader.onloadend = function(chunk) { + postMessage({bin: (fileReader.result || chunk.srcElement || chunk.target).split(',')[1], chunkId: e.data.currentChunk, start: e.data.start}); + }; - fileReader.onloadend = function(chunk) { - postMessage({bin: (fileReader.result || chunk.srcElement || chunk.target).split(',')[1], chunkId: e.data.currentChunk, start: e.data.start}); - }; + fileReader.onerror = function(error) { + throw (error.target || error.srcElement).error; + }; - fileReader.onerror = function(error) { - throw (error.target || error.srcElement).error; - }; + fileReader.readAsDataURL(e.data.file.slice(e.data.chunkSize * (e.data.currentChunk - 1), e.data.chunkSize * e.data.currentChunk)); - fileReader.readAsDataURL(e.data.file.slice(e.data.chunkSize * (e.data.currentChunk - 1), e.data.chunkSize * e.data.currentChunk)); + } else if (self.FileReaderSync) { + var fileReader = new FileReaderSync(); + postMessage({bin: fileReader.readAsDataURL(e.data.file.slice(e.data.chunkSize * (e.data.currentChunk - 1), e.data.chunkSize * e.data.currentChunk)).split(',')[1], chunkId: e.data.currentChunk, start: e.data.start}); + + } else { + postMessage({bin: null, chunkId: e.data.currentChunk, start: e.data.start, error: 'FileReader and fileReaderSunc is not supported in WebWorker!'}); + } return; };
5f0d4efdc74ec48da7021c35b931def3eac71082
node_modules/gzip-stream.js
node_modules/gzip-stream.js
var zlib = require('zlib') function gzip (req, value) { req.on('response', function (res) { if (req._redirect) return var encoding = value || res.headers['content-encoding'] || 'identity' var decompress = null if (encoding.match(/\bdeflate\b/)) { decompress = zlib.createInflate() } else if (encoding.match(/\bgzip\b/)) { decompress = zlib.createGunzip() } req._res = (req._res || res).pipe(decompress) }) } module.exports = gzip
var zlib = require('zlib') function gzip (req, options) { options.headers['accept-encoding'] = 'gzip, deflate' req.on('response', function (res) { if (req._redirect) return var encoding = (/gzip|deflate/.test(options.gzip)) ? options.gzip : (res.headers['content-encoding'] || 'identity') var decompress = null if (encoding.match(/\bdeflate\b/)) { decompress = zlib.createInflate() } else if (encoding.match(/\bgzip\b/)) { decompress = zlib.createGunzip() } req._res = (req._res || res).pipe(decompress) }) } module.exports = gzip
Set accept-encoding header for gzip option
Set accept-encoding header for gzip option
JavaScript
apache-2.0
request/core
--- +++ @@ -2,10 +2,15 @@ var zlib = require('zlib') -function gzip (req, value) { +function gzip (req, options) { + options.headers['accept-encoding'] = 'gzip, deflate' + req.on('response', function (res) { if (req._redirect) return - var encoding = value || res.headers['content-encoding'] || 'identity' + + var encoding = (/gzip|deflate/.test(options.gzip)) + ? options.gzip + : (res.headers['content-encoding'] || 'identity') var decompress = null if (encoding.match(/\bdeflate\b/)) {
0b6bda09ba1c979d81e789b423c77c4ed4c15079
test/plugin/html-meta-analyser/plugin.spec.js
test/plugin/html-meta-analyser/plugin.spec.js
import cheerio from 'cheerio'; import sinon from 'sinon'; import { expect } from 'chai'; import HtmlMetaAnalyserPlugin from '../../../src/plugin/html-meta-analyser/plugin'; describe('HtmlMetaAnalyser Plugin', () => { it('should test', () => { const $ = cheerio.load('<html><head><meta name="author" value="blub" /><meta name="description" value="desc123" /></head></html>'); const output = sinon.spy(); HtmlMetaAnalyserPlugin.process($, output); expect(output.calledOnce).to.be.true; expect(output.firstCall.calledWith("Found 2 tags: author, description")).to.be.true; }); });
import cheerio from 'cheerio'; import sinon from 'sinon'; import { expect } from 'chai'; import HtmlMetaAnalyserPlugin from '../../../src/plugin/html-meta-analyser/plugin'; describe('HtmlMetaAnalyser Plugin', () => { // it('should test', () => { // const $ = cheerio.load('<html><head><meta name="author" value="blub" /><meta name="description" value="desc123" /></head></html>'); // const output = sinon.spy(); // HtmlMetaAnalyserPlugin.process($, output); // expect(output.calledOnce).to.be.true; // expect(output.firstCall.calledWith("Found 2 tags: author, description")).to.be.true; // }); });
Comment out test for MetaAnalyserPlugin for now
Comment out test for MetaAnalyserPlugin for now
JavaScript
mit
developr-at/floob
--- +++ @@ -5,13 +5,13 @@ import HtmlMetaAnalyserPlugin from '../../../src/plugin/html-meta-analyser/plugin'; describe('HtmlMetaAnalyser Plugin', () => { - it('should test', () => { - const $ = cheerio.load('<html><head><meta name="author" value="blub" /><meta name="description" value="desc123" /></head></html>'); - const output = sinon.spy(); + // it('should test', () => { + // const $ = cheerio.load('<html><head><meta name="author" value="blub" /><meta name="description" value="desc123" /></head></html>'); + // const output = sinon.spy(); - HtmlMetaAnalyserPlugin.process($, output); + // HtmlMetaAnalyserPlugin.process($, output); - expect(output.calledOnce).to.be.true; - expect(output.firstCall.calledWith("Found 2 tags: author, description")).to.be.true; - }); + // expect(output.calledOnce).to.be.true; + // expect(output.firstCall.calledWith("Found 2 tags: author, description")).to.be.true; + // }); });
010b2a09d07305bf8f87974d279d51a71102c879
app/initializers/metrics.js
app/initializers/metrics.js
import config from '../config/environment'; export function initialize(_container, application ) { const { metricsAdapters } = config; application.register('config:metrics', metricsAdapters, { instantiate: false }); application.inject('service:metrics', 'metricsAdapters', 'config:metrics'); } export default { name: 'metrics', initialize };
import config from '../config/environment'; export function initialize(_container, application ) { const { metricsAdapters = {} } = config; application.register('config:metrics', metricsAdapters, { instantiate: false }); application.inject('service:metrics', 'metricsAdapters', 'config:metrics'); } export default { name: 'metrics', initialize };
Fix issue with addon breaking on install
Fix issue with addon breaking on install Closes #27
JavaScript
mit
opsb/ember-metrics,poteto/ember-metrics,opsb/ember-metrics,denneralex/ember-metrics,denneralex/ember-metrics,poteto/ember-metrics
--- +++ @@ -1,7 +1,7 @@ import config from '../config/environment'; export function initialize(_container, application ) { - const { metricsAdapters } = config; + const { metricsAdapters = {} } = config; application.register('config:metrics', metricsAdapters, { instantiate: false }); application.inject('service:metrics', 'metricsAdapters', 'config:metrics');
95bcfa2e70a5112c87a424e3c1f74ce1b6e6e65d
assets/js/utils/fetch_utils.js
assets/js/utils/fetch_utils.js
import React from "react"; import { JSON_AUTHORIZATION_HEADERS, JSON_POST_AUTHORIZATION_HEADERS } from "../constants/requests"; import { LOGOUT_URL } from "../constants/urls"; export const getFetch = url => { return fetch(url, { method: "GET", headers: JSON_AUTHORIZATION_HEADERS }); }; export const getFetchJSONAPI = url => { return getFetch(url).then(response => { // If not authenticated, means token has expired // force a hard logout if (response.status === 403) { window.location.assign(LOGOUT_URL); } const results = response.json(); return results; }); }; export const postFetchJSONAPI = (url, postParams) => { return fetch(url, { method: "POST", headers: JSON_POST_AUTHORIZATION_HEADERS, body: JSON.stringify(postParams) }).then(response => { if (!response.ok) { alert("Invalid Request Entered"); } return response.json(); }); };
import React from "react"; import { JSON_AUTHORIZATION_HEADERS, JSON_POST_AUTHORIZATION_HEADERS } from "../constants/requests"; import { LOGOUT_URL } from "../constants/urls"; export const getFetch = url => { return fetch(url, { method: "GET", headers: JSON_AUTHORIZATION_HEADERS }); }; export const getFetchJSONAPI = url => { return getFetch(url).then(response => { // If not authenticated, means token has expired // force a hard logout if (response.status === 401) { window.location.assign(LOGOUT_URL); } const results = response.json(); return results; }); }; export const postFetchJSONAPI = (url, postParams) => { return fetch(url, { method: "POST", headers: JSON_POST_AUTHORIZATION_HEADERS, body: JSON.stringify(postParams) }).then(response => { if (!response.ok) { alert("Invalid Request Entered"); } return response.json(); }); };
Fix change because you swapped url auth mechanisms
Fix change because you swapped url auth mechanisms
JavaScript
mit
jeffshek/betterself,jeffshek/betterself,jeffshek/betterself,jeffshek/betterself
--- +++ @@ -16,7 +16,7 @@ return getFetch(url).then(response => { // If not authenticated, means token has expired // force a hard logout - if (response.status === 403) { + if (response.status === 401) { window.location.assign(LOGOUT_URL); } const results = response.json();
fd378860b2275f1b0764df5ba8880039d5a07ec6
setup-test-db.js
setup-test-db.js
const knex = require('knex'); const postgres = knex({ client: 'postgres', connection: { user: 'postgres', host: 'localhost', database: 'postgres' } }); const mysql = knex({ client: 'mysql', connection: { user: 'root', host: 'localhost' } }); [ postgres.raw('DROP DATABASE IF EXISTS objection_test'), postgres.raw('DROP USER IF EXISTS objection'), postgres.raw('CREATE USER objection SUPERUSER'), postgres.raw('CREATE DATABASE objection_test'), mysql.raw('DROP DATABASE IF EXISTS objection_test'), mysql.raw('DROP USER IF EXISTS objection'), mysql.raw('CREATE USER objection'), mysql.raw('GRANT ALL PRIVILEGES ON *.* TO objection'), mysql.raw('CREATE DATABASE objection_test') ].reduce((promise, query) => { return promise.then(() => query); }, Promise.resolve()).then(() => { return Promise.all([ postgres.destroy(), mysql.destroy() ]); });
const knex = require('knex'); // DATABASES environment variable can contain a comma separated list // of databases to setup. const DATABASES = (process.env.DATABASES && process.env.DATABASES.split(',')) || []; const knexes = []; const commands = []; if (DATABASES.length === 0 || DATABASES.includes('postgres')) { const postgres = knex({ client: 'postgres', connection: { user: 'postgres', host: 'localhost', database: 'postgres', }, }); knexes.push(postgres); commands.push( postgres.raw('DROP DATABASE IF EXISTS objection_test'), postgres.raw('DROP USER IF EXISTS objection'), postgres.raw('CREATE USER objection SUPERUSER'), postgres.raw('CREATE DATABASE objection_test') ); } if (DATABASES.length === 0 || DATABASES.includes('mysql')) { const mysql = knex({ client: 'mysql', connection: { user: 'root', host: 'localhost', }, }); knexes.push(mysql); commands.push( mysql.raw('DROP DATABASE IF EXISTS objection_test'), mysql.raw('DROP USER IF EXISTS objection'), mysql.raw('CREATE USER objection'), mysql.raw('GRANT ALL PRIVILEGES ON *.* TO objection'), mysql.raw('CREATE DATABASE objection_test') ); } commands .reduce((promise, query) => { return promise.then(() => query); }, Promise.resolve()) .then(() => { return Promise.all(knexes.map((it) => it.destroy())); });
Support DATABASES env variable in database setup script
Support DATABASES env variable in database setup script
JavaScript
mit
Vincit/objection.js,Vincit/objection.js,Vincit/objection.js
--- +++ @@ -1,40 +1,56 @@ const knex = require('knex'); -const postgres = knex({ - client: 'postgres', +// DATABASES environment variable can contain a comma separated list +// of databases to setup. +const DATABASES = (process.env.DATABASES && process.env.DATABASES.split(',')) || []; - connection: { - user: 'postgres', - host: 'localhost', - database: 'postgres' - } -}); +const knexes = []; +const commands = []; -const mysql = knex({ - client: 'mysql', +if (DATABASES.length === 0 || DATABASES.includes('postgres')) { + const postgres = knex({ + client: 'postgres', - connection: { - user: 'root', - host: 'localhost' - } -}); + connection: { + user: 'postgres', + host: 'localhost', + database: 'postgres', + }, + }); -[ - postgres.raw('DROP DATABASE IF EXISTS objection_test'), - postgres.raw('DROP USER IF EXISTS objection'), - postgres.raw('CREATE USER objection SUPERUSER'), - postgres.raw('CREATE DATABASE objection_test'), + knexes.push(postgres); + commands.push( + postgres.raw('DROP DATABASE IF EXISTS objection_test'), + postgres.raw('DROP USER IF EXISTS objection'), + postgres.raw('CREATE USER objection SUPERUSER'), + postgres.raw('CREATE DATABASE objection_test') + ); +} - mysql.raw('DROP DATABASE IF EXISTS objection_test'), - mysql.raw('DROP USER IF EXISTS objection'), - mysql.raw('CREATE USER objection'), - mysql.raw('GRANT ALL PRIVILEGES ON *.* TO objection'), - mysql.raw('CREATE DATABASE objection_test') -].reduce((promise, query) => { - return promise.then(() => query); -}, Promise.resolve()).then(() => { - return Promise.all([ - postgres.destroy(), - mysql.destroy() - ]); -}); +if (DATABASES.length === 0 || DATABASES.includes('mysql')) { + const mysql = knex({ + client: 'mysql', + + connection: { + user: 'root', + host: 'localhost', + }, + }); + + knexes.push(mysql); + commands.push( + mysql.raw('DROP DATABASE IF EXISTS objection_test'), + mysql.raw('DROP USER IF EXISTS objection'), + mysql.raw('CREATE USER objection'), + mysql.raw('GRANT ALL PRIVILEGES ON *.* TO objection'), + mysql.raw('CREATE DATABASE objection_test') + ); +} + +commands + .reduce((promise, query) => { + return promise.then(() => query); + }, Promise.resolve()) + .then(() => { + return Promise.all(knexes.map((it) => it.destroy())); + });
695d933e197591d7972b944c62634cf2dae9c347
packages/nexrender-core/src/helpers/path.js
packages/nexrender-core/src/helpers/path.js
/** * Expand environment variables * Example: * Assuming $NEXRENDER_ASSETS is set to /Users/max/nexrender in the current process * an input of file://$NEXRENDER_ASSETS/projects/project2.aep * would output: file:///Users/max/nexrender/projects/project2.aep */ function expandEnvironmentVariables (pathString) { const sigiledStrings = pathString.match(/\$.\w*/g) || []; return sigiledStrings.reduce((accumulator, sigiledString) => { const potentialEnvVarKey = sigiledString.replace("$", ""); if (process.env.hasOwnProperty(potentialEnvVarKey)) { return accumulator.replace(sigiledString, process.env[potentialEnvVarKey]); } else { return accumulator; } }, pathString); }
/** * Expand environment variables * Example: * Assuming $NEXRENDER_ASSETS is set to /Users/max/nexrender * in the environment of thecurrent process * an input of file://$NEXRENDER_ASSETS/projects/project2.aep * would output: file:///Users/max/nexrender/projects/project2.aep */ function expandEnvironmentVariables (pathString) { const sigiledStrings = pathString.match(/\$.\w*/g) || []; return sigiledStrings.reduce((accumulator, sigiledString) => { const potentialEnvVarKey = sigiledString.replace("$", ""); if (process.env.hasOwnProperty(potentialEnvVarKey)) { return accumulator.replace(sigiledString, process.env[potentialEnvVarKey]); } else { return accumulator; } }, pathString); } module.exports = { expandEnvironmentVariables: expandEnvironmentVariables }
Fix module export & function docs
Fix module export & function docs
JavaScript
mit
Inlife/noxrender,Inlife/nexrender
--- +++ @@ -1,7 +1,8 @@ /** * Expand environment variables * Example: - * Assuming $NEXRENDER_ASSETS is set to /Users/max/nexrender in the current process + * Assuming $NEXRENDER_ASSETS is set to /Users/max/nexrender + * in the environment of thecurrent process * an input of file://$NEXRENDER_ASSETS/projects/project2.aep * would output: file:///Users/max/nexrender/projects/project2.aep */ @@ -18,3 +19,7 @@ } }, pathString); } + +module.exports = { + expandEnvironmentVariables: expandEnvironmentVariables +}
65a578a9727c84c1126eb5d2cf9f7da4148c72e7
testem.js
testem.js
module.exports = { test_page: 'tests/index.html?hidepassed', disable_watching: true, launch_in_ci: [ 'Chrome' ], launch_in_dev: [ 'Chrome' ], browser_args: { Chrome: { ci: [ // --no-sandbox is needed when running Chrome inside a container process.env.CI ? '--no-sandbox' : null, '--headless', '--disable-gpu', '--disable-dev-shm-usage', '--disable-software-rasterizer', '--mute-audio', '--remote-debugging-port=0', '--window-size=1440,900' ].filter(Boolean) } } };
module.exports = { test_page: 'tests/index.html?hidepassed', disable_watching: true, launch_in_ci: [ 'Chrome' ], launch_in_dev: [ 'Chrome' ], browser_args: { Chrome: { ci: [ // --no-sandbox is needed when running Chrome inside a container process.env.CI ? '--no-sandbox' : null, '--headless', '--disable-gpu', '--disable-software-rasterizer', '--mute-audio', '--remote-debugging-port=0', '--window-size=1440,900' ].filter(Boolean) } } };
Disable Chrome flag to get CircleCI working again
Disable Chrome flag to get CircleCI working again
JavaScript
mit
kpfefferle/liquid-fire-reveal,kpfefferle/liquid-fire-reveal
--- +++ @@ -14,7 +14,6 @@ process.env.CI ? '--no-sandbox' : null, '--headless', '--disable-gpu', - '--disable-dev-shm-usage', '--disable-software-rasterizer', '--mute-audio', '--remote-debugging-port=0',
2f977033e2f60108b8d504e2beb556512e70e4b2
react/components/Onboarding/components/Channels/components/CreateChannel/mutations/createChannel.js
react/components/Onboarding/components/Channels/components/CreateChannel/mutations/createChannel.js
import gql from 'graphql-tag'; export default gql` mutation createChannelMutation($title: String!) { create_channel(input: { title: $title }) { channel { id: slug href title } } } `;
import gql from 'graphql-tag'; export default gql` mutation createChannelMutation($title: String!, $visibility: ChannelVisibility = PRIVATE) { create_channel(input: { title: $title, visibility: $visibility }) { channel { id: slug href title } } } `;
Make channel private by default
Make channel private by default
JavaScript
mit
aredotna/ervell,aredotna/ervell,aredotna/ervell,aredotna/ervell,aredotna/ervell
--- +++ @@ -1,8 +1,8 @@ import gql from 'graphql-tag'; export default gql` - mutation createChannelMutation($title: String!) { - create_channel(input: { title: $title }) { + mutation createChannelMutation($title: String!, $visibility: ChannelVisibility = PRIVATE) { + create_channel(input: { title: $title, visibility: $visibility }) { channel { id: slug href
37d42c1a1147575ab2cfae8fe71ba4bc9ef4c647
tuneup.js
tuneup.js
#import "assertions.js" #import "uiautomation-ext.js" #import "lang-ext.js" #import "screen.js" #import "test.js"
#import "assertions.js" #import "lang-ext.js" #import "uiautomation-ext.js" #import "screen.js" #import "test.js"
Fix order of import statements
Fix order of import statements
JavaScript
mit
Banno/tuneup_js,Northern01/tuneup_js,Northern01/tuneup_js,alexvollmer/tuneup_js,giginet/tuneup_js,songxiang321/ios-monkey,alexvollmer/tuneup_js,songxiang321/ios-monkey,Banno/tuneup_js,MYOB-Technology/tuneup_js,misfitdavidl/tuneup_js,giginet/tuneup_js,misfitdavidl/tuneup_js,MYOB-Technology/tuneup_js
--- +++ @@ -1,5 +1,5 @@ #import "assertions.js" +#import "lang-ext.js" #import "uiautomation-ext.js" -#import "lang-ext.js" #import "screen.js" #import "test.js"
4e443077f233b0598d9ffe9d16cf868252a6acf3
django_auto_filter/static/js/django_auto_filter.js
django_auto_filter/static/js/django_auto_filter.js
$(document).ready( function () { // $('table').dragtable({ // dragHandle:'.th-inner' //// dragaccept:'th-inner' // }); // $('table').DataTable( { //// dom: 'Bfrtip', // dom: 'BHt', // buttons: [ 'colvis' ], // scrollX: true // } ); // $('table').bootstrapTable(); $('table').bootstrapTable(); $('body').taggingAjax({}); $('table').on('editable-save.bs.table', function(event, rowIndex, rowArray, d, f){ console.log("onEditableSave", event, rowIndex, rowArray, d ,f); //var $('body').taggingAjax("setTagForItem", rowArray[1], $(rowArray[25]).attr("objectId"), $(rowArray[25]).attr("contentType")); }); $('table td:first-child').each(function(){ $(this).html('<a href="{{admin_base_url}}'.replace('%d', $(this).text())+'">'+$(this).text()+'</a>'); }); });
$(document).ready( function () { // $('table').dragtable({ // dragHandle:'.th-inner' //// dragaccept:'th-inner' // }); // $('table').DataTable( { //// dom: 'Bfrtip', // dom: 'BHt', // buttons: [ 'colvis' ], // scrollX: true // } ); // $('table').bootstrapTable(); $('table').bootstrapTable(); $('body').taggingAjax({}); $('table').on('editable-save.bs.table', function(event, rowIndex, rowArray, editableElement){ console.log("onEditableSave", event, rowIndex, rowArray, editableElement); //var $('body').taggingAjax("setTagForItem", rowArray[1], $(rowArray[25]).attr("objectId"), $(rowArray[25]).attr("contentType"), function(){ editableElement.toggleClass("editable-unsaved") }); return true; }); $('table td:first-child').each(function(){ $(this).html('<a href="{{admin_base_url}}'.replace('%d', $(this).text())+'">'+$(this).text()+'</a>'); }); });
Update class after tag is set.
Update class after tag is set.
JavaScript
bsd-3-clause
weijia/django-auto-filter,weijia/django-auto-filter,weijia/django-auto-filter
--- +++ @@ -12,11 +12,14 @@ // $('table').bootstrapTable(); $('table').bootstrapTable(); $('body').taggingAjax({}); - $('table').on('editable-save.bs.table', function(event, rowIndex, rowArray, d, f){ - console.log("onEditableSave", event, rowIndex, rowArray, d ,f); + $('table').on('editable-save.bs.table', function(event, rowIndex, rowArray, editableElement){ + console.log("onEditableSave", event, rowIndex, rowArray, editableElement); //var $('body').taggingAjax("setTagForItem", rowArray[1], $(rowArray[25]).attr("objectId"), - $(rowArray[25]).attr("contentType")); + $(rowArray[25]).attr("contentType"), function(){ + editableElement.toggleClass("editable-unsaved") + }); + return true; }); $('table td:first-child').each(function(){ $(this).html('<a href="{{admin_base_url}}'.replace('%d', $(this).text())+'">'+$(this).text()+'</a>');
eeb1cd2452254f470ab3427da1756eb0828914a7
project/src/main/webapp/script.js
project/src/main/webapp/script.js
function switchTrend(val) { var trends = document.getElementsByClassName('trends'); var i = 0; var updatedCurrentSlide = false; while(i < trends.length && !updatedCurrentSlide) { if(trends[i].style.display === 'block') { var nextTrend = getNextTrend(trends[i],val); trends[i].style.display = 'none'; nextTrend.style.display = 'block'; updatedCurrentSlide = true; } i+=1; } } function getNextTrend(trend, val) { var nextSlide = -1; var currentTrendVal = parseInt(trend.getAttribute('value')); // Clicking left on the first slide returns to last slide if (currentTrendVal + val === 0) { nextSlide = 4; // Clicking right on the last slide returns to first slide } else if (currentTrendVal + val === 5) { nextSlide = 1; } else { nextSlide = currentTrendVal + val; } return document.getElementById('trend-' + nextSlide); }
/** Updates trend in carousel. */ function switchTrend(val) { var trends = document.getElementsByClassName('trends'); var i = 0; var updatedCurrentSlide = false; while(i < trends.length && !updatedCurrentSlide) { if(trends[i].style.display === 'block') { var nextTrend = getNextTrend(trends[i],val); trends[i].style.display = 'none'; nextTrend.style.display = 'block'; updatedCurrentSlide = true; } i+=1; } } /** Returns next trend in carousel. */ function getNextTrend(trend, val) { var nextSlide = -1; var currentTrendVal = parseInt(trend.getAttribute('value')); // Clicking left on the first slide returns to last slide if (currentTrendVal + val === 0) { nextSlide = 4; // Clicking right on the last slide returns to first slide } else if (currentTrendVal + val === 5) { nextSlide = 1; } else { nextSlide = currentTrendVal + val; } return document.getElementById('trend-' + nextSlide); }
Add comments to JS functions
Add comments to JS functions
JavaScript
apache-2.0
googleinterns/step19-2020,googleinterns/step19-2020,googleinterns/step19-2020
--- +++ @@ -1,3 +1,4 @@ +/** Updates trend in carousel. */ function switchTrend(val) { var trends = document.getElementsByClassName('trends'); var i = 0; @@ -13,6 +14,7 @@ } } +/** Returns next trend in carousel. */ function getNextTrend(trend, val) { var nextSlide = -1; var currentTrendVal = parseInt(trend.getAttribute('value'));
61ad1b4ae14fa79062c05fd7f27b3b9a4ec9ee73
website/app/application/core/account/settings/settings.js
website/app/application/core/account/settings/settings.js
(function (module) { module.controller("AccountSettingsController", AccountSettingsController); AccountSettingsController.$inject = ["mcapi", "User", "toastr"]; /* @ngInject */ function AccountSettingsController(mcapi, User, toastr) { var ctrl = this; ctrl.fullname = User.attr().fullname; ctrl.updateName = updateName; /////////////////////////// function updateName() { mcapi('/users/%', ctrl.mcuser.email) .success(function () { User.save(ctrl.mcuser); toastr.success('User name updated', 'Success', { closeButton: true }); }).error(function () { }).put({fullname: ctrl.fullname}); } } }(angular.module('materialscommons')));
(function (module) { module.controller("AccountSettingsController", AccountSettingsController); AccountSettingsController.$inject = ["mcapi", "User", "toastr"]; /* @ngInject */ function AccountSettingsController(mcapi, User, toastr) { var ctrl = this; ctrl.fullname = User.attr().fullname; ctrl.updateName = updateName; /////////////////////////// function updateName() { mcapi('/users/%', ctrl.mcuser.email) .success(function () { User.attr.fullname = ctrl.fullname; User.save(); toastr.success('User name updated', 'Success', { closeButton: true }); }).error(function () { }).put({fullname: ctrl.fullname}); } } }(angular.module('materialscommons')));
Update to User.save api references.
Update to User.save api references.
JavaScript
mit
materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org
--- +++ @@ -14,7 +14,8 @@ function updateName() { mcapi('/users/%', ctrl.mcuser.email) .success(function () { - User.save(ctrl.mcuser); + User.attr.fullname = ctrl.fullname; + User.save(); toastr.success('User name updated', 'Success', { closeButton: true });