commit
stringlengths 40
40
| old_file
stringlengths 4
264
| new_file
stringlengths 4
264
| old_contents
stringlengths 0
3.26k
| new_contents
stringlengths 1
4.43k
| subject
stringlengths 15
624
| message
stringlengths 15
4.7k
| lang
stringclasses 3
values | license
stringclasses 13
values | repos
stringlengths 5
91.5k
|
---|---|---|---|---|---|---|---|---|---|
6aa47fbe9e0185398d1dce628a9f7308455c1600
|
Gruntfile.js
|
Gruntfile.js
|
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
bower: {
install: {
options: {
targetDir: './lib/ui',
layout: 'byComponent',
install: true,
verbose: false,
cleanTargetDir: true,
cleanBowerDir: true,
bowerOptions: {}
}
}
},
jasmine_node: {
all: 'spec/server/'
},
jasmine: {
},
express: {
options: {
},
dev: {
options: {
script: 'src/server/app.js',
port: 1234
}
}
},
watch: {
express: {
files: [ 'src/server/**/*.js' ],
tasks: [ 'express:dev' ],
options: {
spawn: false
}
}
}
});
grunt.loadNpmTasks('grunt-bower-task');
grunt.loadNpmTasks('grunt-jasmine-node');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-express-server');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['jasmine_node']);
grunt.registerTask('run', ['express:dev', 'watch']);
};
|
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
bower: {
install: {
options: {
targetDir: './lib/ui',
layout: 'byComponent',
install: true,
verbose: false,
cleanTargetDir: true,
cleanBowerDir: true,
bowerOptions: {}
}
}
},
jasmine_node: {
all: 'spec/server/'
},
jasmine: {
},
express: {
options: {
},
dev: {
options: {
script: 'src/server/app.js',
port: 3000
}
}
},
watch: {
express: {
files: [ 'src/server/**/*.js' ],
tasks: [ 'express:dev' ],
options: {
spawn: false
}
}
}
});
grunt.loadNpmTasks('grunt-bower-task');
grunt.loadNpmTasks('grunt-jasmine-node');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-express-server');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['jasmine_node']);
grunt.registerTask('run', ['express:dev', 'watch']);
};
|
Set dev port back to 3000
|
Set dev port back to 3000
|
JavaScript
|
mit
|
iknowcss/rmd-dashboard
|
f9c828be3c1a9c647757565f285a67c5e6d814cb
|
scopes-chains-closures/scopes.js
|
scopes-chains-closures/scopes.js
|
function foo() {
var bar;
function zip() {
var quux;
}
}
|
function foo() {
var bar;
quux = 42;
function zip() {
var quux = 42+42;
}
}
|
Complete 'Global scope & Shadowing' challenge in 'Scopes chains closures' tutorial
|
Complete 'Global scope & Shadowing' challenge in 'Scopes chains closures' tutorial
|
JavaScript
|
mit
|
PaoloLaurenti/nodeschool
|
4447aedd0b2fa88be5ffa8f0d1aef7e0a9289116
|
gulpfile.js/tasks/styles.js
|
gulpfile.js/tasks/styles.js
|
var gulp = require('gulp');
var browserSync = require('browser-sync');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var handleErrors = require('../util/handleErrors');
var config = require('../config').styles;
var autoprefixer = require('gulp-autoprefixer');
gulp.task('styles', function () {
return gulp.src(config.src)
.pipe(sourcemaps.init())
.pipe(sass(config.settings))
.on('error', handleErrors)
.pipe(sourcemaps.write())
.pipe(autoprefixer({ browsers: ['last 2 version'] }))
.pipe(gulp.dest(config.dest))
.pipe(browserSync.reload({stream:true}));
});
|
var gulp = require('gulp');
var browserSync = require('browser-sync');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var handleErrors = require('../util/handleErrors');
var config = require('../config').styles;
var autoprefixer = require('gulp-autoprefixer');
gulp.task('styles', function () {
return gulp.src(config.src)
.pipe(sourcemaps.init())
.pipe(sass(config.settings))
.on('error', handleErrors)
.pipe(autoprefixer({ browsers: ['last 2 version'] }))
.pipe(sourcemaps.write())
.pipe(gulp.dest(config.dest))
.pipe(browserSync.reload({stream:true}));
});
|
Include Autoprefixer into sourcemaps process
|
Include Autoprefixer into sourcemaps process
|
JavaScript
|
mit
|
Bastly/bastly-tumblr-theme,Bastly/bastly-tumblr-theme
|
beea183636b98f0a8119625365e8af37384edc4d
|
api/db/migrations/20170418114929_remove_login_from_users.js
|
api/db/migrations/20170418114929_remove_login_from_users.js
|
const TABLE_NAME = 'users';
exports.up = function(knex, Promise) {
return Promise.all([
knex.schema.table(TABLE_NAME, function (table) {
table.dropColumn('login');
table.boolean('cgu');
})
]);
};
exports.down = function(knex, Promise) {
return Promise.all([
knex.schema.table(TABLE_NAME, function (table) {
table.string('login').defaultTo("").notNullable();
table.dropColumn('cgu');
})
]);
};
|
const TABLE_NAME = 'users';
exports.up = function(knex, Promise) {
return Promise.all([
knex.schema.table(TABLE_NAME, function (table) {
table.dropColumn('login');
table.boolean('cgu');
table.unique('email');
})
]);
};
exports.down = function(knex, Promise) {
return Promise.all([
knex.schema.table(TABLE_NAME, function (table) {
table.string('login').defaultTo("").notNullable();
table.dropColumn('cgu');
})
]);
};
|
Revert "FIX - Removing unique constraint on user.email from migration script"
|
Revert "FIX - Removing unique constraint on user.email from migration script"
This reverts commit c6cedc7fa613c9f376b5d59938acdaad1e4eae7f.
|
JavaScript
|
agpl-3.0
|
sgmap/pix,sgmap/pix,sgmap/pix,sgmap/pix
|
bc11793c04236270996f506e7bd4b6bceddc9543
|
examples/todomvc-flux/js/components/Header.react.js
|
examples/todomvc-flux/js/components/Header.react.js
|
/**
* Copyright 2013-2014 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @jsx React.DOM
*/
var React = require('react');
var TodoActions = require('../actions/TodoActions');
var TodoTextInput = require('./TodoTextInput.react');
var Header = React.createClass({
/**
* @return {object}
*/
render: function() {
return (
<header id="header">
<h1>todos</h1>
<TodoTextInput
id="new-todo"
placeholder="What needs to be done?"
onSave={this._onSave}
/>
</header>
);
},
/**
* Event handler called within TodoTextInput.
* Defining this here allows TodoTextInput to be used in multiple places
* in different ways.
* @param {string} text
*/
_onSave: function(text) {
if(text.trim()){
TodoActions.create(text);
}
}
});
module.exports = Header;
|
/**
* Copyright 2013-2014 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @jsx React.DOM
*/
var React = require('react');
var TodoActions = require('../actions/TodoActions');
var TodoTextInput = require('./TodoTextInput.react');
var Header = React.createClass({
/**
* @return {object}
*/
render: function() {
return (
<header id="header">
<h1>todos</h1>
<TodoTextInput
id="new-todo"
placeholder="What needs to be done?"
onSave={this._onSave}
/>
</header>
);
},
/**
* Event handler called within TodoTextInput.
* Defining this here allows TodoTextInput to be used in multiple places
* in different ways.
* @param {string} text
*/
_onSave: function(text) {
if (text.trim()){
TodoActions.create(text);
}
}
});
module.exports = Header;
|
Fix code style in TodoMVC Flux example
|
Fix code style in TodoMVC Flux example
|
JavaScript
|
bsd-3-clause
|
ms-carterk/react,gregrperkins/react,sejoker/react,BreemsEmporiumMensToiletriesFragrances/react,mohitbhatia1994/react,dmitriiabramov/react,ning-github/react,pyitphyoaung/react,chicoxyzzy/react,bruderstein/server-react,insionng/react,jordanpapaleo/react,Nieralyte/react,liyayun/react,glenjamin/react,magalhas/react,Jyrno42/react,kaushik94/react,dortonway/react,arasmussen/react,lucius-feng/react,gfogle/react,temnoregg/react,MichelleTodd/react,k-cheng/react,yisbug/react,zhangwei001/react,honger05/react,nickpresta/react,salzhrani/react,OculusVR/react,cody/react,Jonekee/react,stanleycyang/react,hejld/react,nhunzaker/react,cpojer/react,alvarojoao/react,stardev24/react,agideo/react,it33/react,pswai/react,jordanpapaleo/react,jordanpapaleo/react,1yvT0s/react,pletcher/react,jagdeesh109/react,framp/react,neomadara/react,tywinstark/react,hejld/react,mjul/react,jkcaptain/react,zs99/react,restlessdesign/react,orneryhippo/react,andrescarceller/react,chacbumbum/react,dgdblank/react,richiethomas/react,btholt/react,bestwpw/react,ABaldwinHunter/react-engines,billfeller/react,huanglp47/react,0x00evil/react,levibuzolic/react,shergin/react,pdaddyo/react,supriyantomaftuh/react,temnoregg/react,shripadk/react,livepanzo/react,gold3bear/react,tomv564/react,patrickgoudjoako/react,vikbert/react,richiethomas/react,silvestrijonathan/react,sarvex/react,nickpresta/react,vjeux/react,thr0w/react,guoshencheng/react,wesbos/react,glenjamin/react,apaatsio/react,cesine/react,ericyang321/react,reggi/react,rohannair/react,maxschmeling/react,VukDukic/react,savelichalex/react,christer155/react,andrescarceller/react,honger05/react,leohmoraes/react,it33/react,empyrical/react,BorderTravelerX/react,trellowebinars/react,claudiopro/react,wmydz1/react,dgdblank/react,vjeux/react,facebook/react,AlmeroSteyn/react,joecritch/react,jsdf/react,nLight/react,reactjs-vn/reactjs_vndev,dmitriiabramov/react,zorojean/react,glenjamin/react,billfeller/react,reactkr/react,thr0w/react,ramortegui/react,ABaldwinHunter/react-engines,DJCordhose/react,livepanzo/react,mtsyganov/react,evilemon/react,garbles/react,sebmarkbage/react,krasimir/react,chrisbolin/react,lonely8rain/react,luomiao3/react,inuscript/react,lyip1992/react,tywinstark/react,jfschwarz/react,psibi/react,rgbkrk/react,dmatteo/react,tako-black/react-1,mcanthony/react,reactkr/react,ABaldwinHunter/react-classic,aickin/react,reggi/react,greglittlefield-wf/react,zorojean/react,vikbert/react,dfosco/react,ZhouYong10/react,vjeux/react,mingyaaaa/react,gfogle/react,rickbeerendonk/react,obimod/react,howtolearntocode/react,odysseyscience/React-IE-Alt,nomanisan/react,shergin/react,kolmstead/react,musofan/react,alexanther1012/react,jbonta/react,soulcm/react,iOSDevBlog/react,DJCordhose/react,gajus/react,AlexJeng/react,ManrajGrover/react,yiminghe/react,haoxutong/react,hzoo/react,Nieralyte/react,roth1002/react,ericyang321/react,joon1030/react,dariocravero/react,ssyang0102/react,kamilio/react,wjb12/react,pwmckenna/react,Furzikov/react,andreypopp/react,billfeller/react,jontewks/react,theseyi/react,prathamesh-sonpatki/react,jdlehman/react,deepaksharmacse12/react,genome21/react,yongxu/react,kolmstead/react,roylee0704/react,garbles/react,ridixcr/react,syranide/react,zofuthan/react,niubaba63/react,Jonekee/react,pswai/react,haoxutong/react,linqingyicen/react,yjyi/react,venkateshdaram434/react,tjsavage/react,AnSavvides/react,pswai/react,jzmq/react,edvinerikson/react,kevinrobinson/react,zofuthan/react,jonhester/react,AlmeroSteyn/react,Furzikov/react,silvestrijonathan/react,carlosipe/react,Spotinux/react,cinic/react,jagdeesh109/react,rasj/react,joe-strummer/react,salier/react,bspaulding/react,ameyms/react,vipulnsward/react,genome21/react,conorhastings/react,mgmcdermott/react,spt110/react,greysign/react,yulongge/react,prometheansacrifice/react,jessebeach/react,MotherNature/react,ericyang321/react,VioletLife/react,jquense/react,zeke/react,jimfb/react,glenjamin/react,agideo/react,levibuzolic/react,gleborgne/react,kaushik94/react,yjyi/react,wmydz1/react,silkapp/react,OculusVR/react,nhunzaker/react,scottburch/react,linmic/react,salzhrani/react,airondumael/react,wuguanghai45/react,zenlambda/react,mik01aj/react,hzoo/react,zs99/react,studiowangfei/react,jlongster/react,nhunzaker/react,TheBlasfem/react,zigi74/react,leohmoraes/react,flarnie/react,lennerd/react,livepanzo/react,conorhastings/react,cody/react,ZhouYong10/react,kay-is/react,brigand/react,benjaffe/react,rgbkrk/react,cpojer/react,jzmq/react,rickbeerendonk/react,agileurbanite/react,Simek/react,gpbl/react,Rafe/react,yisbug/react,concerned3rdparty/react,musofan/react,jlongster/react,ilyachenko/react,brigand/react,soulcm/react,mgmcdermott/react,chrismoulton/react,joe-strummer/react,it33/react,dirkliu/react,yiminghe/react,stardev24/react,linmic/react,thr0w/react,quip/react,iamdoron/react,varunparkhe/react,ms-carterk/react,cinic/react,krasimir/react,RReverser/react,supriyantomaftuh/react,yuhualingfeng/react,greglittlefield-wf/react,joshblack/react,jessebeach/react,jzmq/react,jessebeach/react,brillantesmanuel/react,ashwin01/react,temnoregg/react,dirkliu/react,Jericho25/react,mik01aj/react,Jericho25/react,gpazo/react,gajus/react,devonharvey/react,cpojer/react,gxr1020/react,dilidili/react,yangshun/react,jedwards1211/react,silkapp/react,TaaKey/react,jontewks/react,eoin/react,sasumi/react,skyFi/react,Flip120/react,zs99/react,jedwards1211/react,LoQIStar/react,albulescu/react,xiaxuewuhen001/react,lonely8rain/react,MotherNature/react,tarjei/react,ManrajGrover/react,musofan/react,jakeboone02/react,yuhualingfeng/react,silppuri/react,patrickgoudjoako/react,MotherNature/react,lastjune/react,rgbkrk/react,k-cheng/react,nickdima/react,iammerrick/react,christer155/react,psibi/react,PeterWangPo/react,wushuyi/react,camsong/react,brigand/react,Instrument/react,felixgrey/react,miaozhirui/react,wmydz1/react,jakeboone02/react,conorhastings/react,hzoo/react,zigi74/react,kalloc/react,STRML/react,dgreensp/react,jontewks/react,iamchenxin/react,bitshadow/react,perperyu/react,claudiopro/react,jfschwarz/react,thomasboyt/react,tom-wang/react,chacbumbum/react,bspaulding/react,jmacman007/react,shripadk/react,joshblack/react,cpojer/react,usgoodus/react,jimfb/react,savelichalex/react,ms-carterk/react,ouyangwenfeng/react,panhongzhi02/react,salier/react,JoshKaufman/react,qq316278987/react,digideskio/react,rohannair/react,jonhester/react,dirkliu/react,JoshKaufman/react,ThinkedCoder/react,tako-black/react-1,gpbl/react,anushreesubramani/react,perterest/react,venkateshdaram434/react,manl1100/react,hejld/react,jameszhan/react,lennerd/react,framp/react,kakadiya91/react,conorhastings/react,skomski/react,yabhis/react,react-china/react-docs,misnet/react,bhamodi/react,gougouGet/react,levibuzolic/react,stanleycyang/react,gregrperkins/react,mosoft521/react,easyfmxu/react,gitignorance/react,bhamodi/react,yungsters/react,levibuzolic/react,staltz/react,react-china/react-docs,STRML/react,kchia/react,edmellum/react,yongxu/react,quip/react,jorrit/react,dgladkov/react,billfeller/react,mjul/react,camsong/react,vikbert/react,joecritch/react,TylerBrock/react,iamchenxin/react,concerned3rdparty/react,Flip120/react,yut148/react,nLight/react,elquatro/react,sergej-kucharev/react,mfunkie/react,wushuyi/react,dgreensp/react,edmellum/react,slongwang/react,airondumael/react,evilemon/react,mnordick/react,andreypopp/react,howtolearntocode/react,slongwang/react,zs99/react,songawee/react,slongwang/react,honger05/react,ssyang0102/react,crsr/react,vikbert/react,JoshKaufman/react,PrecursorApp/react,ericyang321/react,wesbos/react,getshuvo/react,trellowebinars/react,jakeboone02/react,deepaksharmacse12/react,1234-/react,laogong5i0/react,perterest/react,richiethomas/react,mjackson/react,skevy/react,spt110/react,ledrui/react,elquatro/react,jorrit/react,angeliaz/react,tomocchino/react,ledrui/react,dustin-H/react,stevemao/react,microlv/react,bitshadow/react,sdiaz/react,brillantesmanuel/react,mosoft521/react,MichelleTodd/react,10fish/react,bspaulding/react,tomocchino/react,alvarojoao/react,rickbeerendonk/react,inuscript/react,misnet/react,gregrperkins/react,JoshKaufman/react,trungda/react,dittos/react,vincentism/react,glenjamin/react,yongxu/react,magalhas/react,dmitriiabramov/react,stardev24/react,rohannair/react,mhhegazy/react,jeffchan/react,quip/react,gitoneman/react,aaron-goshine/react,tomv564/react,aaron-goshine/react,bitshadow/react,dfosco/react,jbonta/react,ipmobiletech/react,usgoodus/react,ericyang321/react,yasaricli/react,jameszhan/react,pletcher/react,arkist/react,juliocanares/react,facebook/react,theseyi/react,zeke/react,ramortegui/react,sebmarkbage/react,cody/react,eoin/react,vipulnsward/react,yiminghe/react,yuhualingfeng/react,diegobdev/react,patryknowak/react,usgoodus/react,wushuyi/react,JanChw/react,dgreensp/react,anushreesubramani/react,edvinerikson/react,jeffchan/react,sasumi/react,jedwards1211/react,mcanthony/react,mtsyganov/react,lonely8rain/react,spicyj/react,leexiaosi/react,jeffchan/react,zigi74/react,jfschwarz/react,gajus/react,wjb12/react,ninjaofawesome/reaction,laskos/react,kevinrobinson/react,chippieTV/react,chenglou/react,lastjune/react,10fish/react,insionng/react,yasaricli/react,vincentnacar02/react,inuscript/react,mjul/react,Jonekee/react,gj262/react,nomanisan/react,lina/react,neusc/react,yhagio/react,linqingyicen/react,patrickgoudjoako/react,ArunTesco/react,BreemsEmporiumMensToiletriesFragrances/react,willhackett/react,empyrical/react,haoxutong/react,varunparkhe/react,AlmeroSteyn/react,kchia/react,gregrperkins/react,honger05/react,joecritch/react,conorhastings/react,tako-black/react-1,michaelchum/react,agileurbanite/react,STRML/react,Simek/react,chinakids/react,chacbumbum/react,eoin/react,mohitbhatia1994/react,ashwin01/react,songawee/react,jmacman007/react,mtsyganov/react,jquense/react,gajus/react,marocchino/react,popovsh6/react,linqingyicen/react,felixgrey/react,tywinstark/react,arasmussen/react,concerned3rdparty/react,yut148/react,LoQIStar/react,bleyle/react,with-git/react,devonharvey/react,sasumi/react,rricard/react,ms-carterk/react,alvarojoao/react,dgdblank/react,1040112370/react,magalhas/react,Flip120/react,camsong/react,maxschmeling/react,jlongster/react,benchling/react,nsimmons/react,james4388/react,Simek/react,sverrejoh/react,gold3bear/react,AmericanSundown/react,yangshun/react,kevinrobinson/react,1234-/react,linalu1/react,jeromjoy/react,james4388/react,flarnie/react,jsdf/react,nathanmarks/react,jeffchan/react,dariocravero/react,acdlite/react,skevy/react,aickin/react,deepaksharmacse12/react,jsdf/react,neusc/react,prometheansacrifice/react,digideskio/react,psibi/react,zs99/react,kaushik94/react,jorrit/react,jsdf/react,pdaddyo/react,TaaKey/react,MoOx/react,marocchino/react,jfschwarz/react,andreypopp/react,savelichalex/react,microlv/react,pyitphyoaung/react,dgdblank/react,Riokai/react,Duc-Ngo-CSSE/react,concerned3rdparty/react,szhigunov/react,chippieTV/react,orneryhippo/react,wzpan/react,laskos/react,dgladkov/react,OculusVR/react,chenglou/react,iamdoron/react,MichelleTodd/react,miaozhirui/react,garbles/react,dittos/react,reactjs-vn/reactjs_vndev,k-cheng/react,roylee0704/react,nickdima/react,pletcher/react,kay-is/react,AlmeroSteyn/react,agideo/react,ABaldwinHunter/react-classic,Rafe/react,wzpan/react,KevinTCoughlin/react,andrerpena/react,AlmeroSteyn/react,andrewsokolov/react,Diaosir/react,ajdinhedzic/react,AlmeroSteyn/react,IndraVikas/react,S0lahart-AIRpanas-081905220200-Service/react,it33/react,haoxutong/react,gajus/react,genome21/react,bitshadow/react,howtolearntocode/react,stanleycyang/react,TylerBrock/react,dgdblank/react,AlexJeng/react,arasmussen/react,pyitphyoaung/react,zyt01/react,jiangzhixiao/react,terminatorheart/react,Furzikov/react,popovsh6/react,neomadara/react,mgmcdermott/react,angeliaz/react,billfeller/react,guoshencheng/react,staltz/react,Spotinux/react,STRML/react,roylee0704/react,hawsome/react,vipulnsward/react,jmptrader/react,jlongster/react,roylee0704/react,hawsome/react,zofuthan/react,haoxutong/react,vikbert/react,ajdinhedzic/react,davidmason/react,vipulnsward/react,framp/react,1040112370/react,niubaba63/react,vjeux/react,gougouGet/react,tjsavage/react,jimfb/react,ashwin01/react,1234-/react,edmellum/react,dittos/react,PeterWangPo/react,mnordick/react,AlexJeng/react,brigand/react,TaaKey/react,richiethomas/react,DigitalCoder/react,claudiopro/react,yiminghe/react,jquense/react,brigand/react,TaaKey/react,shripadk/react,james4388/react,getshuvo/react,miaozhirui/react,Simek/react,sitexa/react,anushreesubramani/react,k-cheng/react,savelichalex/react,dortonway/react,kieranjones/react,facebook/react,trungda/react,skomski/react,demohi/react,wushuyi/react,syranide/react,chrismoulton/react,chenglou/react,VukDukic/react,spt110/react,prometheansacrifice/react,blue68/react,quip/react,claudiopro/react,yulongge/react,mjul/react,iOSDevBlog/react,KevinTCoughlin/react,TaaKey/react,Simek/react,andrerpena/react,10fish/react,christer155/react,jordanpapaleo/react,VukDukic/react,joe-strummer/react,ABaldwinHunter/react-classic,zilaiyedaren/react,camsong/react,pdaddyo/react,zhangwei001/react,facebook/react,deepaksharmacse12/react,dmatteo/react,afc163/react,ZhouYong10/react,vipulnsward/react,chippieTV/react,inuscript/react,kakadiya91/react,andrewsokolov/react,ashwin01/react,zenlambda/react,niubaba63/react,lastjune/react,pyitphyoaung/react,levibuzolic/react,yongxu/react,jessebeach/react,szhigunov/react,sdiaz/react,sasumi/react,wzpan/react,concerned3rdparty/react,huanglp47/react,reactjs-vn/reactjs_vndev,zanjs/react,IndraVikas/react,TaaKey/react,wuguanghai45/react,lhausermann/react,Riokai/react,cmfcmf/react,cpojer/react,bspaulding/react,jlongster/react,chrisbolin/react,joshblack/react,gitoneman/react,anushreesubramani/react,pandoraui/react,zigi74/react,benchling/react,theseyi/react,kalloc/react,yungsters/react,roth1002/react,orneryhippo/react,JasonZook/react,andrerpena/react,jbonta/react,pdaddyo/react,ABaldwinHunter/react-engines,mingyaaaa/react,stanleycyang/react,OculusVR/react,pandoraui/react,framp/react,laogong5i0/react,MoOx/react,bruderstein/server-react,nsimmons/react,jdlehman/react,prathamesh-sonpatki/react,jeffchan/react,wjb12/react,savelichalex/react,spt110/react,brillantesmanuel/react,jasonwebster/react,sarvex/react,JasonZook/react,iamchenxin/react,arush/react,lennerd/react,quip/react,IndraVikas/react,trueadm/react,shergin/react,cody/react,Jyrno42/react,dortonway/react,luomiao3/react,mingyaaaa/react,microlv/react,nickdima/react,jonhester/react,mosoft521/react,linmic/react,devonharvey/react,arush/react,Rafe/react,it33/react,tom-wang/react,evilemon/react,haoxutong/react,ramortegui/react,rlugojr/react,ajdinhedzic/react,manl1100/react,pletcher/react,gfogle/react,jabhishek/react,bruderstein/server-react,hzoo/react,insionng/react,zyt01/react,VukDukic/react,varunparkhe/react,kamilio/react,mcanthony/react,ABaldwinHunter/react-engines,elquatro/react,joe-strummer/react,jbonta/react,digideskio/react,leohmoraes/react,chippieTV/react,ArunTesco/react,pze/react,qq316278987/react,juliocanares/react,yangshun/react,jorrit/react,patryknowak/react,zs99/react,rohannair/react,cmfcmf/react,rricard/react,ridixcr/react,blainekasten/react,zigi74/react,odysseyscience/React-IE-Alt,trungda/react,jonhester/react,spicyj/react,ThinkedCoder/react,jzmq/react,silkapp/react,thr0w/react,silvestrijonathan/react,tarjei/react,speedyGonzales/react,chippieTV/react,alwayrun/react,pandoraui/react,zhangwei900808/react,rlugojr/react,javascriptit/react,zilaiyedaren/react,Simek/react,k-cheng/react,silkapp/react,acdlite/react,flarnie/react,lina/react,ropik/react,theseyi/react,kevinrobinson/react,lastjune/react,yulongge/react,glenjamin/react,theseyi/react,bleyle/react,leeleo26/react,airondumael/react,kieranjones/react,aickin/react,chenglou/react,nathanmarks/react,lonely8rain/react,agileurbanite/react,dustin-H/react,react-china/react-docs,neusc/react,0x00evil/react,obimod/react,gitignorance/react,bruderstein/server-react,IndraVikas/react,Flip120/react,reactjs-vn/reactjs_vndev,jameszhan/react,nhunzaker/react,mcanthony/react,apaatsio/react,chacbumbum/react,LoQIStar/react,iOSDevBlog/react,gpazo/react,huanglp47/react,ArunTesco/react,stevemao/react,TaaKey/react,zhangwei900808/react,pyitphyoaung/react,vincentnacar02/react,jmptrader/react,anushreesubramani/react,iOSDevBlog/react,bitshadow/react,Diaosir/react,joecritch/react,pandoraui/react,Lonefy/react,eoin/react,ning-github/react,joaomilho/react,guoshencheng/react,iammerrick/react,dirkliu/react,supriyantomaftuh/react,VioletLife/react,tjsavage/react,panhongzhi02/react,nhunzaker/react,speedyGonzales/react,trungda/react,dilidili/react,Jyrno42/react,aaron-goshine/react,yulongge/react,yungsters/react,framp/react,kamilio/react,nathanmarks/react,zyt01/react,Instrument/react,zhangwei001/react,gj262/react,juliocanares/react,camsong/react,dilidili/react,DJCordhose/react,Furzikov/react,kchia/react,guoshencheng/react,isathish/react,dmatteo/react,shadowhunter2/react,ThinkedCoder/react,tzq668766/react,dariocravero/react,flarnie/react,sekiyaeiji/react,jordanpapaleo/react,pod4g/react,trellowebinars/react,with-git/react,cesine/react,reggi/react,mardigtch/react,wmydz1/react,Chiens/react,arkist/react,Instrument/react,salzhrani/react,orneryhippo/react,mhhegazy/react,nhunzaker/react,jdlehman/react,JungMinu/react,jorrit/react,deepaksharmacse12/react,zenlambda/react,ABaldwinHunter/react-engines,skyFi/react,roth1002/react,mingyaaaa/react,facebook/react,jsdf/react,AnSavvides/react,aaron-goshine/react,gpazo/react,pze/react,BorderTravelerX/react,garbles/react,ABaldwinHunter/react-classic,RReverser/react,gfogle/react,laogong5i0/react,trellowebinars/react,james4388/react,silvestrijonathan/react,mcanthony/react,joaomilho/react,greglittlefield-wf/react,wangyzyoga/react,salier/react,sergej-kucharev/react,hzoo/react,AnSavvides/react,VioletLife/react,KevinTCoughlin/react,dilidili/react,dfosco/react,yut148/react,nLight/react,livepanzo/react,dariocravero/react,Diaosir/react,mnordick/react,Chiens/react,joshbedo/react,DigitalCoder/react,lennerd/react,sitexa/react,jordanpapaleo/react,ABaldwinHunter/react-classic,negativetwelve/react,zenlambda/react,syranide/react,ameyms/react,zofuthan/react,richiethomas/react,AlexJeng/react,lonely8rain/react,vipulnsward/react,zhangwei001/react,facebook/react,AlmeroSteyn/react,jbonta/react,shripadk/react,aaron-goshine/react,IndraVikas/react,yongxu/react,isathish/react,mhhegazy/react,jameszhan/react,magalhas/react,VioletLife/react,savelichalex/react,nsimmons/react,yungsters/react,krasimir/react,joecritch/react,laskos/react,chicoxyzzy/react,6feetsong/react,reggi/react,bhamodi/react,luomiao3/react,linalu1/react,nhunzaker/react,dustin-H/react,brigand/react,empyrical/react,silkapp/react,wmydz1/react,salier/react,crsr/react,perperyu/react,chrisbolin/react,anushreesubramani/react,jimfb/react,RReverser/react,silppuri/react,jorrit/react,shergin/react,Jericho25/react,pze/react,studiowangfei/react,cody/react,mgmcdermott/react,sugarshin/react,ameyms/react,iammerrick/react,airondumael/react,cinic/react,roth1002/react,arkist/react,willhackett/react,ZhouYong10/react,angeliaz/react,Furzikov/react,billfeller/react,rasj/react,hejld/react,jordanpapaleo/react,lyip1992/react,iOSDevBlog/react,kaushik94/react,stardev24/react,slongwang/react,dariocravero/react,claudiopro/react,mgmcdermott/react,hawsome/react,jzmq/react,nickpresta/react,TaaKey/react,bspaulding/react,silppuri/react,jbonta/react,temnoregg/react,carlosipe/react,ssyang0102/react,chrisjallen/react,reactkr/react,TaaKey/react,MotherNature/react,zeke/react,soulcm/react,nathanmarks/react,neusc/react,brillantesmanuel/react,neusc/react,kalloc/react,studiowangfei/react,Nieralyte/react,ramortegui/react,scottburch/react,hawsome/react,maxschmeling/react,davidmason/react,supriyantomaftuh/react,rickbeerendonk/react,Chiens/react,skyFi/react,eoin/react,wesbos/react,pod4g/react,patrickgoudjoako/react,thomasboyt/react,tlwirtz/react,songawee/react,dariocravero/react,restlessdesign/react,vincentism/react,ropik/react,SpencerCDixon/react,supriyantomaftuh/react,jontewks/react,phillipalexander/react,OculusVR/react,zhangwei001/react,Galactix/react,joaomilho/react,gxr1020/react,tako-black/react-1,6feetsong/react,mjackson/react,MoOx/react,joshbedo/react,magalhas/react,Duc-Ngo-CSSE/react,BreemsEmporiumMensToiletriesFragrances/react,reactkr/react,chinakids/react,kakadiya91/react,jkcaptain/react,TylerBrock/react,Zeboch/react-tap-event-plugin,ericyang321/react,andrescarceller/react,jmacman007/react,felixgrey/react,orneryhippo/react,tom-wang/react,linqingyicen/react,Instrument/react,skevy/react,kevin0307/react,prometheansacrifice/react,yisbug/react,Spotinux/react,sebmarkbage/react,sarvex/react,empyrical/react,tomv564/react,JoshKaufman/react,bhamodi/react,0x00evil/react,tywinstark/react,sdiaz/react,jeromjoy/react,1040112370/react,sarvex/react,tlwirtz/react,ThinkedCoder/react,gfogle/react,reactkr/react,restlessdesign/react,jdlehman/react,zorojean/react,magalhas/react,szhigunov/react,jedwards1211/react,chrisjallen/react,bruderstein/server-react,lhausermann/react,ipmobiletech/react,nickdima/react,yasaricli/react,flipactual/react,leohmoraes/react,salzhrani/react,sejoker/react,sejoker/react,cmfcmf/react,crsr/react,niole/react,leeleo26/react,yangshun/react,pwmckenna/react,miaozhirui/react,thomasboyt/react,michaelchum/react,kaushik94/react,blainekasten/react,nLight/react,jsdf/react,jedwards1211/react,huanglp47/react,brigand/react,rickbeerendonk/react,apaatsio/react,zyt01/react,btholt/react,zorojean/react,sekiyaeiji/react,albulescu/react,ameyms/react,ianb/react,xiaxuewuhen001/react,yhagio/react,kevin0307/react,michaelchum/react,alwayrun/react,salzhrani/react,cmfcmf/react,MichelleTodd/react,maxschmeling/react,gpazo/react,davidmason/react,jorrit/react,jquense/react,0x00evil/react,DJCordhose/react,ABaldwinHunter/react-engines,patryknowak/react,arkist/react,sekiyaeiji/react,wmydz1/react,krasimir/react,kevin0307/react,ninjaofawesome/reaction,skevy/react,Spotinux/react,staltz/react,1234-/react,trellowebinars/react,dilidili/react,nickpresta/react,rlugojr/react,andrewsokolov/react,trueadm/react,rgbkrk/react,garbles/react,dmitriiabramov/react,linmic/react,wudouxingjun/react,vincentism/react,alvarojoao/react,tzq668766/react,chicoxyzzy/react,arasmussen/react,crsr/react,pyitphyoaung/react,niole/react,alexanther1012/react,dilidili/react,S0lahart-AIRpanas-081905220200-Service/react,glenjamin/react,kaushik94/react,MoOx/react,studiowangfei/react,rlugojr/react,KevinTCoughlin/react,pdaddyo/react,dilidili/react,1040112370/react,syranide/react,SpencerCDixon/react,PeterWangPo/react,restlessdesign/react,odysseyscience/React-IE-Alt,neomadara/react,Instrument/react,panhongzhi02/react,jmacman007/react,ramortegui/react,lyip1992/react,marocchino/react,jameszhan/react,henrik/react,ninjaofawesome/reaction,christer155/react,wangyzyoga/react,Datahero/react,mhhegazy/react,jquense/react,stardev24/react,rlugojr/react,yangshun/react,jmptrader/react,yut148/react,kay-is/react,tomocchino/react,jasonwebster/react,inuscript/react,yangshun/react,diegobdev/react,rlugojr/react,nLight/react,varunparkhe/react,flowbywind/react,crsr/react,concerned3rdparty/react,linmic/react,Instrument/react,mjackson/react,iammerrick/react,musofan/react,6feetsong/react,gajus/react,lhausermann/react,salier/react,joaomilho/react,cpojer/react,iammerrick/react,mhhegazy/react,ms-carterk/react,dgdblank/react,roylee0704/react,thr0w/react,zyt01/react,claudiopro/react,bruderstein/server-react,10fish/react,popovsh6/react,terminatorheart/react,patrickgoudjoako/react,acdlite/react,trueadm/react,btholt/react,javascriptit/react,miaozhirui/react,AnSavvides/react,patrickgoudjoako/react,rricard/react,gpbl/react,marocchino/react,hawsome/react,joe-strummer/react,ipmobiletech/react,nomanisan/react,scottburch/react,terminatorheart/react,easyfmxu/react,jagdeesh109/react,joe-strummer/react,arkist/react,jameszhan/react,javascriptit/react,huanglp47/react,gitoneman/react,honger05/react,benjaffe/react,AnSavvides/react,with-git/react,conorhastings/react,jameszhan/react,Galactix/react,dfosco/react,Riokai/react,alvarojoao/react,wmydz1/react,qq316278987/react,yasaricli/react,jlongster/react,skevy/react,jontewks/react,andrerpena/react,ianb/react,pandoraui/react,trueadm/react,scottburch/react,Zeboch/react-tap-event-plugin,TaaKey/react,tarjei/react,chicoxyzzy/react,felixgrey/react,jonhester/react,jimfb/react,Diaosir/react,STRML/react,Jericho25/react,aickin/react,blainekasten/react,ManrajGrover/react,labs00/react,maxschmeling/react,MoOx/react,gleborgne/react,dgreensp/react,reactkr/react,yulongge/react,roth1002/react,obimod/react,studiowangfei/react,niubaba63/react,insionng/react,mik01aj/react,flipactual/react,joshbedo/react,hejld/react,manl1100/react,james4388/react,mfunkie/react,dortonway/react,elquatro/react,gpazo/react,darobin/react,yuhualingfeng/react,andreypopp/react,blue68/react,pswai/react,prathamesh-sonpatki/react,ameyms/react,dgreensp/react,tarjei/react,jagdeesh109/react,ilyachenko/react,tako-black/react-1,shadowhunter2/react,ledrui/react,sugarshin/react,benjaffe/react,JasonZook/react,mosoft521/react,aickin/react,pletcher/react,MotherNature/react,shergin/react,easyfmxu/react,jmptrader/react,jimfb/react,odysseyscience/React-IE-Alt,howtolearntocode/react,yungsters/react,TheBlasfem/react,bspaulding/react,chrisjallen/react,leexiaosi/react,greyhwndz/react,MichelleTodd/react,8398a7/react,vincentism/react,afc163/react,dittos/react,Jyrno42/react,hawsome/react,restlessdesign/react,ridixcr/react,airondumael/react,1040112370/react,brian-murray35/react,tom-wang/react,zeke/react,gitoneman/react,pswai/react,BreemsEmporiumMensToiletriesFragrances/react,pze/react,prathamesh-sonpatki/react,hejld/react,ms-carterk/react,trueadm/react,salier/react,PrecursorApp/react,nickpresta/react,spicyj/react,vincentism/react,Datahero/react,chicoxyzzy/react,ropik/react,perterest/react,claudiopro/react,AmericanSundown/react,tomocchino/react,reactjs-vn/reactjs_vndev,silvestrijonathan/react,pwmckenna/react,iamchenxin/react,rwwarren/react,orzyang/react,rwwarren/react,gfogle/react,jessebeach/react,arasmussen/react,dmatteo/react,roth1002/react,empyrical/react,blue68/react,ianb/react,DJCordhose/react,8398a7/react,rasj/react,yiminghe/react,negativetwelve/react,ZhouYong10/react,marocchino/react,eoin/react,shergin/react,Spotinux/react,rickbeerendonk/react,darobin/react,benchling/react,lastjune/react,shadowhunter2/react,AlexJeng/react,sarvex/react,iamdoron/react,dittos/react,tomocchino/react,yiminghe/react,acdlite/react,mardigtch/react,it33/react,sugarshin/react,stardev24/react,jedwards1211/react,ropik/react,kamilio/react,1234-/react,negativetwelve/react,andrerpena/react,BorderTravelerX/react,laskos/react,dmatteo/react,framp/react,angeliaz/react,kamilio/react,sergej-kucharev/react,niubaba63/react,ljhsai/react,jmacman007/react,rohannair/react,maxschmeling/react,jfschwarz/react,yasaricli/react,lyip1992/react,camsong/react,yut148/react,camsong/react,apaatsio/react,staltz/react,react-china/react-docs,musofan/react,sugarshin/react,niubaba63/react,usgoodus/react,VukDukic/react,dustin-H/react,nLight/react,Riokai/react,arush/react,benchling/react,devonharvey/react,qq316278987/react,shergin/react,pswai/react,dmitriiabramov/react,gleborgne/react,ljhsai/react,JanChw/react,jabhishek/react,chicoxyzzy/react,guoshencheng/react,sugarshin/react,jontewks/react,gxr1020/react,dirkliu/react,neusc/react,wudouxingjun/react,ridixcr/react,edvinerikson/react,gxr1020/react,S0lahart-AIRpanas-081905220200-Service/react,afc163/react,vincentism/react,S0lahart-AIRpanas-081905220200-Service/react,angeliaz/react,kakadiya91/react,zenlambda/react,zeke/react,chenglou/react,willhackett/react,nathanmarks/react,Diaosir/react,nickpresta/react,mjackson/react,silvestrijonathan/react,restlessdesign/react,iamdoron/react,pwmckenna/react,howtolearntocode/react,henrik/react,chacbumbum/react,zofuthan/react,sejoker/react,zilaiyedaren/react,zhengqiangzi/react,trueadm/react,chrisjallen/react,joon1030/react,TheBlasfem/react,brian-murray35/react,Riokai/react,trellowebinars/react,joshbedo/react,felixgrey/react,gpbl/react,qq316278987/react,lennerd/react,flarnie/react,tom-wang/react,Jyrno42/react,edvinerikson/react,greysign/react,gregrperkins/react,cpojer/react,free-memory/react,KevinTCoughlin/react,algolia/react,TheBlasfem/react,prathamesh-sonpatki/react,Lonefy/react,ledrui/react,xiaxuewuhen001/react,TheBlasfem/react,mosoft521/react,jdlehman/react,manl1100/react,tlwirtz/react,easyfmxu/react,kakadiya91/react,mardigtch/react,iamchenxin/react,pwmckenna/react,MichelleTodd/react,panhongzhi02/react,andrescarceller/react,gxr1020/react,panhongzhi02/react,levibuzolic/react,Simek/react,lhausermann/react,zorojean/react,mik01aj/react,phillipalexander/react,RReverser/react,jakeboone02/react,skevy/react,labs00/react,easyfmxu/react,Jyrno42/react,mohitbhatia1994/react,Flip120/react,chippieTV/react,tomocchino/react,afc163/react,chenglou/react,digideskio/react,jkcaptain/react,trungda/react,jonhester/react,edmellum/react,apaatsio/react,gold3bear/react,trungda/react,obimod/react,davidmason/react,yisbug/react,staltz/react,mjackson/react,dgreensp/react,linalu1/react,flowbywind/react,blainekasten/react,prometheansacrifice/react,kakadiya91/react,ZhouYong10/react,ninjaofawesome/reaction,kevinrobinson/react,devonharvey/react,flarnie/react,niubaba63/react,microlv/react,orneryhippo/react,dirkliu/react,blainekasten/react,JasonZook/react,reggi/react,benchling/react,mosoft521/react,with-git/react,empyrical/react,livepanzo/react,lonely8rain/react,DJCordhose/react,TaaKey/react,acdlite/react,joecritch/react,dortonway/react,laskos/react,venkateshdaram434/react,iamdoron/react,lina/react,ilyachenko/react,tako-black/react-1,tywinstark/react,mhhegazy/react,BreemsEmporiumMensToiletriesFragrances/react,rwwarren/react,liyayun/react,mhhegazy/react,songawee/react,Rafe/react,zyt01/react,1040112370/react,musofan/react,isathish/react,tomv564/react,dmitriiabramov/react,usgoodus/react,stanleycyang/react,gpazo/react,JanChw/react,richiethomas/react,theseyi/react,demohi/react,0x00evil/react,panhongzhi02/react,gpbl/react,kolmstead/react,joaomilho/react,dittos/react,rlugojr/react,dortonway/react,VioletLife/react,with-git/react,gitoneman/react,wangyzyoga/react,ning-github/react,KevinTCoughlin/react,negativetwelve/react,shripadk/react,nathanmarks/react,bleyle/react,rricard/react,mjackson/react,niole/react,1yvT0s/react,Lonefy/react,henrik/react,Galactix/react,Spotinux/react,niole/react,PrecursorApp/react,andrerpena/react,spicyj/react,microlv/react,neomadara/react,mjackson/react,quip/react,kolmstead/react,roylee0704/react,albulescu/react,kamilio/react,0x00evil/react,jdlehman/react,tomocchino/react,reactjs-vn/reactjs_vndev,chinakids/react,speedyGonzales/react,edmellum/react,bitshadow/react,shripadk/react,angeliaz/react,sverrejoh/react,greyhwndz/react,STRML/react,free-memory/react,PrecursorApp/react,kaushik94/react,jquense/react,Rafe/react,AmericanSundown/react,perperyu/react,yungsters/react,rickbeerendonk/react,arkist/react,carlosipe/react,gitignorance/react,alwayrun/react,laskos/react,gougouGet/react,andreypopp/react,facebook/react,1234-/react,thomasboyt/react,zhangwei001/react,garbles/react,lucius-feng/react,perterest/react,easyfmxu/react,ridixcr/react,mcanthony/react,ridixcr/react,JungMinu/react,microlv/react,niole/react,wjb12/react,iamchenxin/react,stevemao/react,krasimir/react,wuguanghai45/react,guoshencheng/react,obimod/react,chrismoulton/react,digideskio/react,cesine/react,zhangwei900808/react,kevinrobinson/react,howtolearntocode/react,tarjei/react,ljhsai/react,jquense/react,staltz/react,miaozhirui/react,isathish/react,insionng/react,arasmussen/react,ashwin01/react,jasonwebster/react,yabhis/react,usgoodus/react,dustin-H/react,mgmcdermott/react,PrecursorApp/react,roth1002/react,flipactual/react,marocchino/react,TheBlasfem/react,sverrejoh/react,lhausermann/react,mtsyganov/react,leexiaosi/react,zhengqiangzi/react,bestwpw/react,kchia/react,jiangzhixiao/react,andreypopp/react,richiethomas/react,thomasboyt/react,stanleycyang/react,edmellum/react,labs00/react,quip/react,insionng/react,tzq668766/react,apaatsio/react,laogong5i0/react,Jericho25/react,Lonefy/react,lyip1992/react,neomadara/react,cody/react,yhagio/react,rohannair/react,with-git/react,jagdeesh109/react,tlwirtz/react,krasimir/react,JasonZook/react,tlwirtz/react,afc163/react,orzyang/react,phillipalexander/react,gold3bear/react,gregrperkins/react,algolia/react,misnet/react,qq316278987/react,laogong5i0/react,yuhualingfeng/react,dgladkov/react,wushuyi/react,yisbug/react,nickdima/react,lucius-feng/react,isathish/react,ashwin01/react,chrisjallen/react,silvestrijonathan/react,zigi74/react,darobin/react,k-cheng/react,prathamesh-sonpatki/react,krasimir/react,jzmq/react,SpencerCDixon/react,temnoregg/react,kieranjones/react,aaron-goshine/react,empyrical/react,joshblack/react,james4388/react,terminatorheart/react,manl1100/react,spt110/react,mingyaaaa/react,leohmoraes/react,VioletLife/react,rricard/react,VioletLife/react,maxschmeling/react,Duc-Ngo-CSSE/react,prometheansacrifice/react,psibi/react,joshblack/react,IndraVikas/react,chenglou/react,acdlite/react,yiminghe/react,AmericanSundown/react,wudouxingjun/react,thomasboyt/react,benchling/react,Jericho25/react,digideskio/react,sverrejoh/react,cmfcmf/react,sejoker/react,edvinerikson/react,alvarojoao/react,brillantesmanuel/react,ouyangwenfeng/react,psibi/react,zanjs/react,getshuvo/react,with-git/react,yut148/react,AnSavvides/react,Riokai/react,jdlehman/react,ledrui/react,dustin-H/react,linqingyicen/react,cmfcmf/react,reggi/react,mosoft521/react,bhamodi/react,gpbl/react,zanjs/react,christer155/react,wjb12/react,gold3bear/react,bhamodi/react,mik01aj/react,JoshKaufman/react,free-memory/react,iOSDevBlog/react,joon1030/react,jeffchan/react,DigitalCoder/react,alexanther1012/react,btholt/react,chicoxyzzy/react,davidmason/react,yangshun/react,davidmason/react,zenlambda/react,flowbywind/react,joecritch/react,anushreesubramani/react,elquatro/react,leeleo26/react,yabhis/react,diegobdev/react,edvinerikson/react,rricard/react,vikbert/react,jmptrader/react,linmic/react,prometheansacrifice/react,aickin/react,kolmstead/react,brian-murray35/react,yisbug/react,spt110/react,zorojean/react,tomv564/react,AlexJeng/react,8398a7/react,zhengqiangzi/react,vincentnacar02/react,ABaldwinHunter/react-classic,scottburch/react,pyitphyoaung/react,thr0w/react,greysign/react,Furzikov/react,ameyms/react,ropik/react,dfosco/react,aickin/react,Datahero/react,sasumi/react,odysseyscience/React-IE-Alt,sarvex/react,yungsters/react,jmacman007/react,jiangzhixiao/react,jeromjoy/react,brillantesmanuel/react,trueadm/react,apaatsio/react,sverrejoh/react,STRML/react,pze/react,jakeboone02/react,liyayun/react,devonharvey/react,ropik/react,slongwang/react,1yvT0s/react,ericyang321/react,btholt/react,JungMinu/react,gj262/react,lyip1992/react,terminatorheart/react,billfeller/react,lhausermann/react,orzyang/react,zeke/react,tlwirtz/react,skomski/react,demohi/react,tom-wang/react,rohannair/react,negativetwelve/react,iamdoron/react,acdlite/react,sverrejoh/react,terminatorheart/react,S0lahart-AIRpanas-081905220200-Service/react,bestwpw/react,sugarshin/react,sebmarkbage/react,sitexa/react,joaomilho/react,inuscript/react,ouyangwenfeng/react,yjyi/react,AmericanSundown/react,ThinkedCoder/react,mfunkie/react,pod4g/react,elquatro/react,blainekasten/react,jzmq/react,jabhishek/react,flarnie/react,algolia/react,bspaulding/react,edvinerikson/react,mfunkie/react,jasonwebster/react,andrescarceller/react,rgbkrk/react,greyhwndz/react,perterest/react,salzhrani/react
|
d62ffda36104d6620756a2d083b125d893d07419
|
frontend/scripts/controllers/install_update_ctrl.js
|
frontend/scripts/controllers/install_update_ctrl.js
|
angular.module("protonet.platform").controller("InstallUpdateCtrl", function($scope, $state, $timeout, API, Notification) {
function toggleDetailedUpdateStatus() {
$scope.showDetailedUpdateStatus = !$scope.showDetailedUpdateStatus;
}
$scope.toggleDetailedUpdateStatus = toggleDetailedUpdateStatus;
function updateDetailedStatus(images) {
$scope.status = {};
for (var property in images) {
if (images.hasOwnProperty(property)) {
var image = images[property];
$scope.status[property] = {
local: image.local,
remote: image.remote,
upToDate: image.local === image.remote
}
}
}
$scope.statusAvailable = !$.isEmptyObject($scope.status);
}
function check() {
$timeout(function() {
API.get("/admin/api/system/update").then(function(data) {
if (data.up_to_date) {
Notification.notice("Update successfully installed");
$state.go("dashboard.index");
} else {
updateDetailedStatus(data.images);
check();
}
}).catch(check);
}, 10000);
}
check();
});
|
angular.module("protonet.platform").controller("InstallUpdateCtrl", function($scope, $state, $timeout, API, Notification) {
function toggleDetailedUpdateStatus() {
$scope.showDetailedUpdateStatus = !$scope.showDetailedUpdateStatus;
}
$scope.toggleDetailedUpdateStatus = toggleDetailedUpdateStatus;
function updateDetailedStatus(images) {
$scope.status = {};
for (var property in images) {
if (images.hasOwnProperty(property)) {
var image = images[property];
$scope.status[property] = {
local: image.local,
remote: image.remote,
upToDate: image.local === image.remote
}
}
}
$scope.statusAvailable = !$.isEmptyObject($scope.status);
}
function check() {
$timeout(function() {
API.get("/admin/api/system/update").then(function(data) {
if (data.up_to_date) {
Notification.success("Update successfully installed");
$state.go("dashboard.index");
} else {
updateDetailedStatus(data.images);
check();
}
}).catch(check);
}, 10000);
}
check();
});
|
Fix js error after update
|
Fix js error after update
|
JavaScript
|
apache-2.0
|
experimental-platform/platform-frontend,DarkSwoop/platform-frontend,DarkSwoop/platform-frontend,experimental-platform/platform-frontend,DarkSwoop/platform-frontend,experimental-platform/platform-frontend
|
197563cf26894571304abb762aeb192c5f63c21a
|
src/sanity/inputs/Reference.js
|
src/sanity/inputs/Reference.js
|
import {ReferenceInput} from 'role:@sanity/form-builder'
import client from 'client:@sanity/base/client'
import {unprefixType} from '../utils/unprefixType'
function fetchSingle(id) {
return client.fetch('*[.$id == %id]', {id}).then(response => unprefixType(response.result[0]))
}
export default ReferenceInput.createBrowser({
fetch(field) {
const toFieldTypes = field.to.map(toField => toField.type)
const params = toFieldTypes.reduce((acc, toFieldType, i) => {
acc[`toFieldType${i}`] = `beerfiesta.${toFieldType}`
return acc
}, {})
const eqls = Object.keys(params).map(key => (
`.$type == %${key}`
)).join(' || ')
return client.fetch(`*[${eqls}]`, params)
.then(response => response.result.map(unprefixType))
},
materializeReferences(referenceIds) {
return Promise.all(referenceIds.map(fetchSingle))
}
})
|
import client from 'client:@sanity/base/client'
import {ReferenceInput} from 'role:@sanity/form-builder'
import {unprefixType} from '../utils/unprefixType'
function fetchSingle(id) {
return client.data.getDocument(id).then(doc => unprefixType(doc))
}
export default ReferenceInput.createBrowser({
fetch(field) {
const toFieldTypes = field.to.map(toField => toField.type)
const dataset = client.config().dataset
const params = toFieldTypes.reduce((acc, toFieldType, i) => {
acc[`toFieldType${i}`] = `${dataset}.${toFieldType}`
return acc
}, {})
const eqls = Object.keys(params).map(key => (
`.$type == %${key}`
)).join(' || ')
return client.data.fetch(`*[${eqls}]`, params)
.then(response => response.map(unprefixType))
},
materializeReferences(referenceIds) {
return Promise.all(referenceIds.map(fetchSingle))
}
})
|
Make reference input use new Sanity client syntax
|
Make reference input use new Sanity client syntax
|
JavaScript
|
mit
|
sanity-io/sanity,sanity-io/sanity,sanity-io/sanity,sanity-io/sanity
|
bd3b6698e3cfa10a758aa93441ed36b029fbc3cd
|
js/source/github.js
|
js/source/github.js
|
(function() {
'use strict';
var _ = Timeline.helpers;
Timeline.Stream.source.GitHub = {
icon: 'github',
options: {
response: 'json',
paginate: 10,
url: 'https://api.github.com/',
action: '{stream}/events/public',
},
params: {
page: function(action) {
return (action == 'poll') ? 1 : '{page}';
},
},
headers: {
Accept: 'applicatioin/vnd.github.v3+json',
},
getEvents: function(data) {
return data;
},
getEventID: function(event) {
return parseInt(this.getEventDate(event), 10);
},
getEventDate: function(event) {
return _.parseTime(event.created_at);
},
getEventMessage: function(event) {
return 'GitHub: ' + event.actor.login + ' ' + event.type;
},
getEventLink: function(event) {},
};
})();
|
(function() {
'use strict';
var _ = Timeline.helpers;
Timeline.Stream.source.GitHub = {
icon: 'github',
options: {
response: 'json',
paginate: 10,
url: 'https://api.github.com/',
action: '{stream}/events/public',
},
params: {
page: function(action) {
return (action == 'poll') ? 1 : '{page}';
},
},
headers: {
Accept: 'applicatioin/vnd.github.v3+json',
},
getEvents: function(data) {
return data;
},
getEventID: function(event) {
return parseInt(this.getEventDate(event), 10);
},
getEventDate: function(event) {
return _.parseTime(event.created_at);
},
getEventMessage: function(event) {
var message = '';
var params = {};
switch (event.type) {
case 'PushEvent':
message = 'Pushed {commits} commit{s} to <code>{ref}</code> ' +
'on <a href="{repo_url}">{repo}</a>';
params = {
commits: event.payload.size,
s: event.payload.size == 1 ? '' : 's',
ref: event.payload.ref.replace(/^refs\/heads\//, ''),
repo_url: event.repo.url,
repo: event.repo.name,
};
break;
}
if (message.length)
return _.template(message, params);
},
getEventLink: function(event) {},
};
})();
|
Adjust GitHub source to produce meaningful output
|
Adjust GitHub source to produce meaningful output
|
JavaScript
|
mpl-2.0
|
rummik/zenosphere.js
|
39c5facffd81d7e768d6519036d0f0f0a7ed3ad2
|
migrations/20141022152322_init.js
|
migrations/20141022152322_init.js
|
'use strict';
exports.up = function(knex, Promise) {
return knex.schema.createTable('Transactions', function (table) {
table.increments("id").primary();
table.string("address", 128);
table.integer("amount");
table.string("memo", 512);
table.text("txblob");
table.string("txhash", 128);
table.integer("sequence");
table.text("error");
table.timestamp("signedAt").nullable();
table.timestamp("submittedAt").nullable();
table.timestamp("confirmedAt").nullable();
table.timestamp("abortedAt").nullable();
});
};
exports.down = function(knex, Promise) {
return knex.schema.dropTable("Transactions");
};
|
'use strict';
exports.up = function(knex, Promise) {
return knex.schema.createTable('Transactions', function (table) {
table.increments("id").primary();
table.string("address", 128);
table.integer("amount");
table.string("currency", 3);
table.string("issuer", 128);
table.string("memo", 512);
table.text("txblob");
table.string("txhash", 128);
table.integer("sequence");
table.text("error");
table.timestamp("signedAt").nullable();
table.timestamp("submittedAt").nullable();
table.timestamp("confirmedAt").nullable();
table.timestamp("abortedAt").nullable();
});
};
exports.down = function(knex, Promise) {
return knex.schema.dropTable("Transactions");
};
|
Change migration to add currency and issuer
|
Change migration to add currency and issuer
|
JavaScript
|
isc
|
Payshare/stellar-payments,nybbs2003/stellar-payments,Payshares/payshares-payments
|
0562d99c152305c93a6dbb1298549c766018358f
|
lib/randomstring.js
|
lib/randomstring.js
|
"use strict";
var crypto = require('crypto');
var charset = require('./charset.js');
exports.generate = function(length, options) {
var chars;
if (typeof options === 'object') {
if (options.charset) {
chars = charset.generate(options.charset, options.readable);
}
else {
charset.generate('default', options.readable);
}
}
else {
chars = charset.generate('default');
}
length = length || 32;
var string = '';
while(string.length < length) {
var bf;
try {
bf = crypto.randomBytes(length);
}
catch (e) {
continue;
}
for (var i = 0; i < bf.length; i++) {
var index = bf.readUInt8(i) % chars.length;
string += chars.charAt(index);
}
}
return string;
}
|
"use strict";
var crypto = require('crypto');
var charset = require('./charset.js');
exports.generate = function(options) {
var length, chars, string = '';
// Handle options
if (typeof options === 'object') {
length = options.length || 32;
if (options.charset) {
chars = charset.generate(options.charset, options.readable);
}
else {
charset.generate('default', options.readable);
}
}
else if (typeof options === 'number') {
length = options;
chars = charset.generate('default');
}
else {
length = 32;
chars = charset.generate('default');
}
// Generate the string
while (string.length < length) {
var bf;
try {
bf = crypto.randomBytes(length);
}
catch (e) {
continue;
}
for (var i = 0; i < bf.length; i++) {
var index = bf.readUInt8(i) % chars.length;
string += chars.charAt(index);
}
}
return string;
}
|
Move length to options while keeping support for legacy params
|
Move length to options while keeping support for legacy params
|
JavaScript
|
mit
|
prashantgupta24/node-randomstring,prashantgupta24/node-randomstring,klughammer/node-randomstring
|
6b691039e6a2a6bcd7e45d291fbc42650c6c1f01
|
tests/current_route_tests.js
|
tests/current_route_tests.js
|
Tinytest.addAsync('CurrentRoute.name returns the name of the current route', function (test, next) {
Router.go('apple');
setTimeout(function () {
test.equal(CurrentRoute.name, 'apple');
next();
}, 500);
});
Tinytest.addAsync('CurrentRoute.is returns false when routeName is not current route name', function (test, next) {
Router.go('orange');
setTimeout(function () {
test.isFalse(CurrentRoute.is('apple'));
next();
}, 500);
});
Tinytest.addAsync('CurrentRoute.is returns true when routeName is the current route name', function (test, next) {
Router.go('apple');
setTimeout(function () {
test.isTrue(CurrentRoute.is('apple'));
next();
}, 500);
});
Tinytest.addAsync('CurrentRoute.params returns an array of params', function (test, next) {
Router.go('fruit.show', {name: 'banana'});
setTimeout(function () {
test.isTrue(CurrentRoute.params.indexOf('banana') > -1);
next();
}, 500);
});
|
Tinytest.addAsync('CurrentRoute.name returns the name of the current route', function (test, next) {
Router.go('apple');
Meteor.defer(function () {
test.equal(CurrentRoute.name, 'apple');
next();
}, 500);
});
Tinytest.addAsync('CurrentRoute.is returns false when routeName is not current route name', function (test, next) {
Router.go('orange');
Meteor.defer(function () {
test.isFalse(CurrentRoute.is('apple'));
next();
}, 500);
});
Tinytest.addAsync('CurrentRoute.is returns true when routeName is the current route name', function (test, next) {
Router.go('apple');
Meteor.defer(function () {
test.isTrue(CurrentRoute.is('apple'));
next();
}, 500);
});
Tinytest.addAsync('CurrentRoute.params returns an array of params', function (test, next) {
Router.go('fruit.show', {name: 'banana'});
Meteor.defer(function () {
test.isTrue(CurrentRoute.params.indexOf('banana') > -1);
next();
}, 500);
});
|
Fix TravisCI issue where the build hangs after starting
|
Fix TravisCI issue where the build hangs after starting
|
JavaScript
|
mit
|
sungwoncho/iron-utils
|
a05a9eb968458117c00de3a196ed8891be52b3a0
|
admin/src/components/FormHeading.js
|
admin/src/components/FormHeading.js
|
var React = require('react');
function evalDependsOn(dependsOn, values) {
if (!_.isObject(dependsOn)) return true;
var keys = _.keys(dependsOn);
return (keys.length) ? _.every(keys, function(key) {
var matches = _.isArray(dependsOn[key]) ? dependsOn[key] : [dependsOn[key]];
return _.contains(matches, values[key]);
}, this) : true;
}
module.exports = React.createClass({
displayName: 'FormHeading',
render: function() {
if (!evalDependsOn(this.props.options.dependsOn, this.props.options.values)) {
return null;
}
return <h3 className="form-heading">{this.props.content}</h3>;
}
});
|
var React = require('react');
function evalDependsOn(dependsOn, values) {
if (!_.isObject(dependsOn)) return true;
var keys = _.keys(dependsOn);
return (keys.length) ? _.every(keys, function(key) {
var dependsValue = dependsOn[key];
if(_.isBoolean(dependsValue)) {
return dependsValue !== _.isEmpty(values[key]);
}
var matches = _.isArray(dependsValue) ? dependsValue : [dependsValue];
return _.contains(matches, values[key]);
}, this) : true;
}
module.exports = React.createClass({
displayName: 'FormHeading',
render: function() {
if (!evalDependsOn(this.props.options.dependsOn, this.props.options.values)) {
return null;
}
return <h3 className="form-heading">{this.props.content}</h3>;
}
});
|
Allow boolean evaluation of dependsOn on headings
|
Allow boolean evaluation of dependsOn on headings
|
JavaScript
|
mit
|
Adam14Four/keystone,sendyhalim/keystone,webteckie/keystone,andrewlinfoot/keystone,MORE-HEALTH/keystone,webteckie/keystone,kidaa/keystone,the1sky/keystone,dryna/keystone-twoje-urodziny,kidaa/keystone,Yaska/keystone,asifiqbal84/keystone,kloudsio/keystone,nickhsine/keystone,Adam14Four/keystone,francesconero/keystone,vokal/keystone,creynders/keystone,dvdcastro/keystone,matthieugayon/keystone,ligson/keystone,jeffreypriebe/keystone,trentmillar/keystone,BlakeRxxk/keystone,stosorio/keystone,youprofit/keystone,efernandesng/keystone,tomasztunik/keystone,developer-prosenjit/keystone,lojack/keystone,vokal/keystone,danielmahon/keystone,kloudsio/keystone,sarriaroman/keystone,unsworn/keystone,brianjd/keystone,wmertens/keystone,linhanyang/keystone,SJApps/keystone,mbayfield/keystone,mbayfield/keystone,dryna/keystone-twoje-urodziny,naustudio/keystone,lastjune/keystone,jstockwin/keystone,beni55/keystone,Ftonso/keystone,wilsonfletcher/keystone,magalhas/keystone,joerter/keystone,w01fgang/keystone,gemscng/keystone,pr1ntr/keystone,frontyard/keystone,tony2cssc/keystone,DenisNeustroev/keystone,akoesnan/keystone,andrewlinfoot/keystone,vokal/keystone,mekanics/keystone,jrit/keystone,Pylipala/keystone,davibe/keystone,antonj/keystone,nickhsine/keystone,stunjiturner/keystone,andreufirefly/keystone,geminiyellow/keystone,Pylipala/keystone,woody0907/keystone,cermati/keystone,andreufirefly/keystone,benkroeger/keystone,kristianmandrup/keystone,Tangcuyu/keystone,cermati/keystone,matthewstyers/keystone,kumo/keystone,everisARQ/keystone,pr1ntr/keystone,kwangkim/keystone,belafontestudio/keystone,geminiyellow/keystone,Pop-Code/keystone,Pop-Code/keystone,benkroeger/keystone,frontyard/keystone,danielmahon/keystone,Yaska/keystone,matthewstyers/keystone,woody0907/keystone,joerter/keystone,pswoodworth/keystone,ONode/keystone,tony2cssc/keystone,SJApps/keystone,Tangcuyu/keystone,dvdcastro/keystone,onenorth/keystone,KZackery/keystone,creynders/keystone,MORE-HEALTH/keystone,qwales1/keystone,onenorth/keystone,SlashmanX/keystone,lojack/keystone,codevlabs/keystone,michaelerobertsjr/keystone,chrisgornall/d29blog,Yaska/keystone,the1sky/keystone,akoesnan/keystone,jeffreypriebe/keystone,davibe/keystone,w01fgang/keystone,stosorio/keystone,WofloW/keystone,tomasztunik/keystone,ratecity/keystone,developer-prosenjit/keystone,Redmart/keystone,asifiqbal84/keystone,DenisNeustroev/keystone,andrewlinfoot/keystone,trentmillar/keystone,kristianmandrup/keystone,jacargentina/keystone,WingedToaster/keystone,snowkeeper/keystone,wustxing/keystone,sendyhalim/keystone,trentmillar/keystone,suryagh/keystone,beni55/keystone,mekanics/keystone,efernandesng/keystone,matthieugayon/keystone,omnibrain/keystone,WofloW/keystone,rafmsou/keystone,vmkcom/keystone,jrit/keystone,codevlabs/keystone,concoursbyappointment/keystoneRedux,vmkcom/keystone,trystant/keystone,gcortese/keystone,omnibrain/keystone,youprofit/keystone,xyzteam2016/keystone,riyadhalnur/keystone,concoursbyappointment/keystoneRedux,magalhas/keystone,naustudio/keystone,everisARQ/keystone,francesconero/keystone,kwangkim/keystone,riyadhalnur/keystone,ratecity/keystone,trystant/keystone,wustxing/keystone,stunjiturner/keystone,jacargentina/keystone,douglasf/keystone,udp/keystone,udp/keystone,sarriaroman/keystone,rafmsou/keystone,KZackery/keystone,jstockwin/keystone,douglasf/keystone,BlakeRxxk/keystone,tanbo800/keystone,qwales1/keystone,tanbo800/keystone,gcortese/keystone,Freakland/keystone,kumo/keystone,unsworn/keystone,xyzteam2016/keystone,suryagh/keystone,matthewstyers/keystone,frontyard/keystone,Ftonso/keystone,danielmahon/keystone,snowkeeper/keystone,brianjd/keystone,lastjune/keystone,gemscng/keystone,alobodig/keystone,belafontestudio/keystone,WingedToaster/keystone,wilsonfletcher/keystone,SlashmanX/keystone,naustudio/keystone,ligson/keystone,antonj/keystone,michaelerobertsjr/keystone,alobodig/keystone,mikaoelitiana/keystone,Freakland/keystone,chrisgornall/d29blog,pswoodworth/keystone,Redmart/keystone,benkroeger/keystone,mikaoelitiana/keystone,ONode/keystone,wmertens/keystone
|
b30f6630199cb723a59d5581161c60a742d29c14
|
app/assets/javascripts/responses.js
|
app/assets/javascripts/responses.js
|
$(document).ready( function () {
$(".upvote").click( function() {
var commentId = $(".upvote").data("id");
event.preventDefault();
$.ajax({
url: '/response/up_vote',
method: 'POST',
data: { id: commentId },
dataType: 'JSON'
}).done( function (voteCount) {
if (voteCount == 1) {
$("span[data-id=" + commentId + "]").html(voteCount + " vote");
} else {
$("span[data-id=" + commentId + "]").html(voteCount + " vote");
}
}).fail( function (voteCount) {
console.log("Failed. Here is the voteCount:");
console.log(voteCount);
})
})
})
|
$(document).ready( function () {
$(".upvote").click( function() {
var commentId = $(".upvote").data("id");
event.preventDefault();
$.ajax({
url: '/response/up_vote',
method: 'POST',
data: { id: commentId },
dataType: 'JSON'
}).done( function (voteCount) {
if (voteCount == 1) {
$("span[data-id=" + commentId + "]").html(voteCount + " vote");
} else {
$("span[data-id=" + commentId + "]").html(voteCount + " vote");
}
}).fail( function (failureInfo) {
console.log("Failed. Here is why:");
console.log(failureInfo.responseText);
})
})
})
|
Change failure callback to show responding html embedded failure message from Active Record.
|
Change failure callback to show responding html embedded failure message from Active Record.
|
JavaScript
|
mit
|
great-horned-owls-2014/dbc-what-is-this,great-horned-owls-2014/dbc-what-is-this
|
e5c56ff931be01e97055f47fd05da85d56acca74
|
app/scripts/services/offlinemode.js
|
app/scripts/services/offlinemode.js
|
'use strict';
angular.module('offlineMode', [])
.config(function ($httpProvider) {
$httpProvider.interceptors.push('httpInterceptor');
})
.factory('httpInterceptor', function ($q) {
var OFFLINE = location.search.indexOf('offline=true') > -1,
_config = {
OFFLINE_DATA_PATH: '/offline_data',
API_PATH: '/api'
};
return {
request: function(req) {
if (OFFLINE && req) {
if (req.url.indexOf(_config.API_PATH) === 0) {
var path = req.url.substring(_config.API_PATH.length);
req.url = _config.OFFLINE_DATA_PATH + path + '.' + req.method.toLowerCase() + '.json';
}
}
return req || $q.when(req);
},
config: _config
};
}
);
|
'use strict';
angular.module('offlineMode', [])
.config(function ($httpProvider) {
$httpProvider.interceptors.push('httpInterceptor');
})
.factory('httpInterceptor', function ($q) {
var OFFLINE = location.search.indexOf('offline=true') > -1,
config = {
OFFLINE_DATA_PATH: '/offline_data',
API_PATH: '/api'
};
return {
request: function(req) {
if (OFFLINE && req) {
if (req.url.indexOf(config.API_PATH) === 0) {
var path = req.url.substring(config.API_PATH.length);
req.url = config.OFFLINE_DATA_PATH + path + '.' + req.method.toLowerCase() + '.json';
}
}
return req || $q.when(req);
},
config: config
};
}
);
|
Rename _config to config now
|
Rename _config to config now
|
JavaScript
|
mit
|
MartinSandstrom/angular-apimock,seriema/angular-apimock,seriema/angular-apimock,MartinSandstrom/angular-apimock
|
ce41f4599a9a68c23ccb9569f702ee1c0bb25bd0
|
lib/assets/javascripts/cartodb/common/public_footer_view.js
|
lib/assets/javascripts/cartodb/common/public_footer_view.js
|
var cdb = require('cartodb.js-v3');
var DEFAULT_LIGHT_ACTIVE = false;
module.exports = cdb.core.View.extend({
initialize: function () {
this._initModels();
this.template = this.isHosted
? cdb.templates.getTemplate('public/views/public_footer')
: cdb.templates.getTemplate('common/views/footer_static');
},
render: function () {
this.$el.html(
this.template({
isHosted: this.isHosted,
light: this.light,
onpremiseVersion: this.onpremiseVersion
})
);
return this;
},
_initModels: function () {
this.isHosted = cdb.config.get('cartodb_com_hosted');
this.onpremiseVersion = cdb.config.get('onpremise_version');
this.light = !!this.options.light || DEFAULT_LIGHT_ACTIVE;
}
});
|
var cdb = require('cartodb.js-v3');
var DEFAULT_LIGHT_ACTIVE = false;
module.exports = cdb.core.View.extend({
initialize: function () {
this._initModels();
this.template = this.isHosted
? cdb.templates.getTemplate('common/views/footer_static')
: cdb.templates.getTemplate('public/views/public_footer');
},
render: function () {
this.$el.html(
this.template({
isHosted: this.isHosted,
light: this.light,
onpremiseVersion: this.onpremiseVersion
})
);
return this;
},
_initModels: function () {
this.isHosted = cdb.config.get('cartodb_com_hosted');
this.onpremiseVersion = cdb.config.get('onpremise_version');
this.light = !!this.options.light || DEFAULT_LIGHT_ACTIVE;
}
});
|
Fix the proper footer based on cartodb_com_hosted.
|
Fix the proper footer based on cartodb_com_hosted.
|
JavaScript
|
bsd-3-clause
|
CartoDB/cartodb,CartoDB/cartodb,splashblot/dronedb,CartoDB/cartodb,splashblot/dronedb,splashblot/dronedb,CartoDB/cartodb,splashblot/dronedb,CartoDB/cartodb,splashblot/dronedb
|
856b1f29230acc829d627aa8779f345c71a3ddaa
|
packages/babel-plugin-transform-react-jsx-self/src/index.js
|
packages/babel-plugin-transform-react-jsx-self/src/index.js
|
/**
* This adds {fileName, lineNumber} annotations to React component definitions
* and to jsx tag literals.
*
*
* == JSX Literals ==
*
* <sometag />
*
* becomes:
*
* <sometag __self={this} />
*/
const TRACE_ID = "__self";
export default function ({ types: t }) {
let visitor = {
JSXOpeningElement(node) {
const id = t.jSXIdentifier(TRACE_ID);
const trace = t.identifier("this");
node.container.openingElement.attributes.push(t.jSXAttribute(id, t.jSXExpressionContainer(trace)));
}
};
return {
visitor
};
}
|
/**
* This adds a __self={this} JSX attribute to all JSX elements, which React will use
* to generate some runtime warnings.
*
*
* == JSX Literals ==
*
* <sometag />
*
* becomes:
*
* <sometag __self={this} />
*/
const TRACE_ID = "__self";
export default function ({ types: t }) {
let visitor = {
JSXOpeningElement({ node }) {
const id = t.jSXIdentifier(TRACE_ID);
const trace = t.thisExpression();
node.attributes.push(t.jSXAttribute(id, t.jSXExpressionContainer(trace)));
}
};
return {
visitor
};
}
|
Fix some mistakes in the jsx-self transform.
|
Fix some mistakes in the jsx-self transform.
|
JavaScript
|
mit
|
babel/babel,claudiopro/babel,kaicataldo/babel,tikotzky/babel,hzoo/babel,samwgoldman/babel,kellyselden/babel,shuhei/babel,PolymerLabs/babel,kassens/babel,babel/babel,iamchenxin/babel,samwgoldman/babel,hulkish/babel,tikotzky/babel,garyjN7/babel,hzoo/babel,KunGha/babel,Skillupco/babel,shuhei/babel,jridgewell/babel,jridgewell/babel,kassens/babel,ccschneidr/babel,iamchenxin/babel,hulkish/babel,kedromelon/babel,existentialism/babel,zertosh/babel,zjmiller/babel,jridgewell/babel,rmacklin/babel,hulkish/babel,KunGha/babel,bcoe/babel,guybedford/babel,PolymerLabs/babel,kaicataldo/babel,rmacklin/babel,chicoxyzzy/babel,Skillupco/babel,bcoe/babel,ccschneidr/babel,STRML/babel,claudiopro/babel,jchip/babel,jridgewell/babel,kellyselden/babel,babel/babel,kellyselden/babel,kellyselden/babel,hzoo/babel,guybedford/babel,zertosh/babel,existentialism/babel,guybedford/babel,PolymerLabs/babel,chicoxyzzy/babel,maurobringolf/babel,jchip/babel,vadzim/babel,lxe/babel,kaicataldo/babel,maurobringolf/babel,Skillupco/babel,garyjN7/babel,maurobringolf/babel,zjmiller/babel,hzoo/babel,STRML/babel,kaicataldo/babel,lxe/babel,chicoxyzzy/babel,babel/babel,vadzim/babel,chicoxyzzy/babel,existentialism/babel,shuhei/babel,Skillupco/babel,claudiopro/babel,kedromelon/babel,iamchenxin/babel,kedromelon/babel,hulkish/babel,samwgoldman/babel
|
977c9fe1b897e8ed3a25eab75c01f60f828319a0
|
src/js/app/pagespeed-app.module.js
|
src/js/app/pagespeed-app.module.js
|
;(function() {
'use strict';
angular.module('pagespeedApp', ['pagespeed.templates']).config(function($sceDelegateProvider) {
$sceDelegateProvider.resourceUrlWhitelist([
'self',
'https://www.googleapis.com/pagespeedonline/v2/runPagespeed' // TODO pull from service instead of hard coded
]);
});
})();
|
;(function() {
'use strict';
angular.module('pagespeedApp', ['pagespeed.templates']).config(['$sceDelegateProvider', function($sceDelegateProvider) {
$sceDelegateProvider.resourceUrlWhitelist([
'self',
'https://www.googleapis.com/pagespeedonline/v2/runPagespeed' // TODO pull from service instead of hard coded
]);
}]);
})();
|
Use inline annotation in config block
|
Use inline annotation in config block
Fixes minification issues
|
JavaScript
|
mit
|
WileESpaghetti/demo-pagespeed,WileESpaghetti/demo-pagespeed
|
cc719f1526929d67df889ad2edfbb15f12445fbe
|
src/Chromabits/Loader/Loader.js
|
src/Chromabits/Loader/Loader.js
|
'use strict';
var ensure = require('ensure.js'),
ClassNotFoundException = require('./Exceptions/ClassNotFoundException.js'),
ClassMap = require('../Mapper/ClassMap.js');
var Loader;
/**
* ClassLoader
*
* Capable of loading a class using multiple class maps. A class will be
* resolved in the order the class maps have been added.
*
* @return {undefined} -
*/
Loader = function () {
this.maps = [];
};
/**
* Add a map to the loader
*
* @param {enclosure.Chromabits.Mapper.ClassMap} map -
*
* @return {undefined} -
*/
Loader.prototype.addMap = function (map) {
ensure(map, ClassMap);
this.maps.push(map);
};
/**
* Get the constructor for the specified class
*
* @param {String} fullClassName -
*
* @return {Function} -
*/
Loader.prototype.get = function (fullClassName) {
for (var map in this.maps) {
if (map.has(fullClassName)) {
return map.get(fullClassName);
}
}
throw new ClassNotFoundException(fullClassName);
};
module.exports = Loader;
|
'use strict';
var ensure = require('ensure.js'),
ClassNotFoundException = require('./Exceptions/ClassNotFoundException.js'),
ClassMap = require('../Mapper/ClassMap.js');
var Loader;
/**
* ClassLoader
*
* Capable of loading a class using multiple class maps. A class will be
* resolved in the order the class maps have been added.
*
* @return {undefined} -
*/
Loader = function () {
this.maps = [];
};
/**
* Add a map to the loader
*
* @param {enclosure.Chromabits.Mapper.ClassMap} map -
*
* @return {undefined} -
*/
Loader.prototype.addMap = function (map) {
ensure(map, ClassMap);
this.maps.push(map);
};
/**
* Get the constructor for the specified class
*
* @param {String} fullClassName -
*
* @return {Function} -
*/
Loader.prototype.get = function (fullClassName) {
for (var key in this.maps) {
if (this.maps.hasOwnProperty(key)) {
var map = this.maps[key];
if (map.has(fullClassName)) {
return map.get(fullClassName);
}
}
}
throw new ClassNotFoundException(fullClassName);
};
module.exports = Loader;
|
Fix bug on the class loader
|
Fix bug on the class loader
|
JavaScript
|
mit
|
etcinit/enclosure
|
1a12317c2c9fa53e0ead42abe63b55ad222f9b49
|
test/conf/karma-common.conf.js
|
test/conf/karma-common.conf.js
|
/*eslint-env node */
var sourceList = require("../../src/source-list");
var sourceFiles = sourceList.list.map(function(src) {
return "src/" + src;
});
var commonJsSourceFiles = sourceList.commonJsModuleList;
var testFiles = [
"test/util/dom.js",
"test/util/matchers.js",
"test/util/mock/vivliostyle/logging-mock.js",
"test/util/mock/vivliostyle/plugin-mock.js",
"test/spec/**/*.js"
];
module.exports = function(config) {
return {
basePath: "../..",
frameworks: ["jasmine", 'commonjs'],
files: sourceFiles.concat(testFiles).concat(commonJsSourceFiles),
preprocessors: {
},
commonjsPreprocessor: {
modulesRoot: './'
},
port: 9876,
colors: true,
logLevel: config.LOG_INFO
};
};
|
/*eslint-env node */
var sourceList = require("../../src/source-list");
var sourceFiles = sourceList.list.map(function(src) {
return "src/" + src;
});
var commonJsSourceFiles = sourceList.commonJsModuleList;
var testFiles = [
"test/util/dom.js",
"test/util/matchers.js",
"test/util/mock/vivliostyle/logging-mock.js",
"test/util/mock/vivliostyle/plugin-mock.js",
"test/spec/**/*.js"
];
module.exports = function(config) {
return {
basePath: "../..",
frameworks: ["jasmine"],
files: sourceFiles.concat(testFiles).concat(commonJsSourceFiles),
// frameworks: ["jasmine", 'commonjs'],
// preprocessors: {
// "node_modules/dummy/*.js": ['commonjs']
// },
// commonjsPreprocessor: {
// modulesRoot: './'
// },
port: 9876,
colors: true,
logLevel: config.LOG_INFO
};
};
|
Remove karma-commonjs settings for avoiding error.
|
Remove karma-commonjs settings for avoiding error.
- If you require commonjs modules, Add settings below:
- Add `commonjs` to `frameworks`.
```
frameworks: ["jasmine", 'commonjs'],
```
- Add `preprocessors` and `commonjsPreprocessor` setting.
```
preprocessors: {
"node_modules/dummy/*.js": ['commonjs']
},
commonjsPreprocessor: {
modulesRoot: './'
},
```
|
JavaScript
|
agpl-3.0
|
vivliostyle/vivliostyle.js,vivliostyle/vivliostyle.js,vivliostyle/vivliostyle.js,vivliostyle/vivliostyle.js
|
40ee9312b1d8c6f1d13f737ffc0846bb4c104d8e
|
test/integration/proxy.test.js
|
test/integration/proxy.test.js
|
import {browser} from '../mini-testium-mocha';
import {delay} from 'Bluebird';
describe('proxy', () => {
before(browser.beforeHook);
describe('handles errors', () => {
it('with no content type and preserves status code', () =>
browser
.navigateTo('/').assertStatusCode(200)
.navigateTo('/error').assertStatusCode(500));
it('that crash and preserves status code', () =>
browser.navigateTo('/crash').assertStatusCode(500));
});
it('handles request abortion', async () => {
// loads a page that has a resource that will
// be black holed
await browser
.navigateTo('/blackholed-resource.html').assertStatusCode(200);
// this can't simply be sync
// because firefox blocks dom-ready
// if we don't wait on the client-side
await delay(50);
// when navigating away, the proxy should
// abort the resource request;
// this should not interfere with the new page load
// or status code retrieval
await browser.navigateTo('/').assertStatusCode(200);
});
it('handles hashes in urls', () =>
browser.navigateTo('/#deals').assertStatusCode(200));
});
|
import {browser} from '../mini-testium-mocha';
import {delay} from 'bluebird';
describe('proxy', () => {
before(browser.beforeHook);
describe('handles errors', () => {
it('with no content type and preserves status code', () =>
browser
.navigateTo('/').assertStatusCode(200)
.navigateTo('/error').assertStatusCode(500));
it('that crash and preserves status code', () =>
browser.navigateTo('/crash').assertStatusCode(500));
});
it('handles request abortion', async () => {
// loads a page that has a resource that will
// be black holed
await browser
.navigateTo('/blackholed-resource.html').assertStatusCode(200);
// this can't simply be sync
// because firefox blocks dom-ready
// if we don't wait on the client-side
await delay(50);
// when navigating away, the proxy should
// abort the resource request;
// this should not interfere with the new page load
// or status code retrieval
await browser.navigateTo('/').assertStatusCode(200);
});
it('handles hashes in urls', () =>
browser.navigateTo('/#deals').assertStatusCode(200));
});
|
Fix casing of bluebird import
|
Fix casing of bluebird import
|
JavaScript
|
bsd-3-clause
|
testiumjs/testium-driver-wd
|
a27e54cf245444f6b858ff57549967795e11021b
|
lib/hydrater-tika/helpers/hydrate.js
|
lib/hydrater-tika/helpers/hydrate.js
|
'use strict';
/**
* @file Hydrate the file from scratch.
* Download it from Cluestr, save it to local storage, run tika and returns the result.
*
* This helper is used in the server queue.
*/
var async = require('async');
var request = require('request');
var crypto = require('crypto');
var fs = require('fs');
var tikaShell = require('./tika-shell.js');
/**
* Take a Cluestr document and returns metadatas
*
* @param {Object} task Task object, keys must be file_path (file URL) and callback (URL)
* @param {Function} cb Callback, first parameter is the error.
*/
module.exports = function(task, done) {
var serverUrl = require('../../../app.js').url;
// Download the file
async.waterfall([
function(cb) {
request.get(task.file_path, cb);
},
function(res, body, cb) {
var path = '/tmp/' + crypto.randomBytes(20).toString('hex');
fs.writeFile(path, body, function(err) {
cb(err, path);
});
},
function(path, cb) {
tikaShell(path , cb);
},
function(data, cb) {
// Upload to server
var params = {
url: task.callback,
json: {
hydrater: serverUrl + '/hydrate',
metadatas: data,
}
};
request.patch(params, cb);
}
], done);
};
|
'use strict';
/**
* @file Hydrate the file from scratch.
* Download it from Cluestr, save it to local storage, run tika and returns the result.
*
* This helper is used in the server queue.
*/
var async = require('async');
var request = require('request');
var crypto = require('crypto');
var fs = require('fs');
var tikaShell = require('./tika-shell.js');
/**
* Take a Cluestr document and returns metadatas
*
* @param {Object} task Task object, keys must be file_path (file URL) and callback (URL)
* @param {Function} cb Callback, first parameter is the error.
*/
module.exports = function(task, done) {
var serverUrl = require('../../../app.js').url;
async.waterfall([
function(cb) {
var path = '/tmp/' + crypto.randomBytes(20).toString('hex');
// Download the file
request(task.file_path)
.pipe(fs.createWriteStream(path))
.on('finish', function() {
cb(null, path);
});
},
function(path, cb) {
tikaShell(path , cb);
},
function(data, cb) {
// Upload to server
var params = {
url: task.callback,
json: {
hydrater: serverUrl + '/hydrate',
metadatas: data,
}
};
request.patch(params, cb);
}
], done);
};
|
Use stream while reading file
|
Use stream while reading file
|
JavaScript
|
mit
|
AnyFetch/anyfetch-hydrater.js
|
a34b2269c3749a5c014e2fcdd663795f3c8f1731
|
lib/auth/token-container.js
|
lib/auth/token-container.js
|
var crypto = require('crypto');
var _ = require('underscore');
function TokenContainer() {
this._tokens = {};
this._startGarbageCollecting();
}
TokenContainer._hourMs = 60 * 60 * 1000;
TokenContainer._collectorIntervalMs = 12 * TokenContainer._hourMs;
TokenContainer._oudatedTimeMs = 48 * TokenContainer._hourMs;
TokenContainer.prototype.saveToken = function(res, token) {
var cookie = crypto.randomBytes(32).toString('hex');
this._tokens[cookie] = {token: token, lastUsage: Date.now()};
res.cookies.set('userid', cookie, {path: '/', secure: true, httpOnly: false});
};
TokenContainer.prototype.hasToken = function(tokenKey) {
var info = this._tokens[tokenKey];
if (info) {
info.lastUsage = Date.now();
}
return !!info;
};
TokenContainer.prototype.extractTokenKeyFromRequest = function(req) {
return req.cookies.get('userid');
};
TokenContainer.prototype._startGarbageCollecting = function() {
setInterval(function() {
var now = Date.now();
_.each(this._tokens, function(info, cookie, cookies) {
if (now - info.lastUsage > TokenContainer._oudatedTimeMs) {
delete cookies[cookie];
}
});
}.bind(this), TokenContainer._collectorIntervalMs);
};
module.exports = TokenContainer;
|
var crypto = require('crypto');
var _ = require('underscore');
function TokenContainer() {
this._tokens = {};
this._startGarbageCollecting();
}
TokenContainer._hourMs = 60 * 60 * 1000;
TokenContainer._collectorIntervalMs = 12 * TokenContainer._hourMs;
TokenContainer._oudatedTimeMs = 48 * TokenContainer._hourMs;
TokenContainer.prototype.saveToken = function(res, token) {
var cookie = crypto.randomBytes(32).toString('hex');
this._tokens[cookie] = {token: token, lastUsage: Date.now()};
res.cookies.set('userid', cookie, {path: '/'});
};
TokenContainer.prototype.hasToken = function(tokenKey) {
var info = this._tokens[tokenKey];
if (info) {
info.lastUsage = Date.now();
}
return !!info;
};
TokenContainer.prototype.extractTokenKeyFromRequest = function(req) {
return req.cookies.get('userid');
};
TokenContainer.prototype._startGarbageCollecting = function() {
setInterval(function() {
var now = Date.now();
_.each(this._tokens, function(info, cookie, cookies) {
if (now - info.lastUsage > TokenContainer._oudatedTimeMs) {
delete cookies[cookie];
}
});
}.bind(this), TokenContainer._collectorIntervalMs);
};
module.exports = TokenContainer;
|
Remove https restriction from cookie setter.
|
Remove https restriction from cookie setter.
|
JavaScript
|
mit
|
cargomedia/pulsar-rest-api,njam/pulsar-rest-api,cargomedia/pulsar-rest-api,njam/pulsar-rest-api,cargomedia/pulsar-rest-api,vogdb/pulsar-rest-api,cargomedia/pulsar-rest-api,njam/pulsar-rest-api,vogdb/pulsar-rest-api,njam/pulsar-rest-api,vogdb/pulsar-rest-api
|
e5f08ef8be8d7484c963454e84e89e9f28aae810
|
tests/e2e/utils/page-wait.js
|
tests/e2e/utils/page-wait.js
|
/**
* Utlity to have the page wait for a given length.
*
* Site Kit by Google, Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export const E2E_PAGE_WAIT = 250;
/**
* Set the page to wait for the passed time. Defaults to 250 milliseconds.
*
* @since 1.10.0
*
* @param {number} [delay] Optional. The amount of milliseconds to wait.
*/
export const pageWait = async ( delay = E2E_PAGE_WAIT ) => {
if ( typeof delay !== 'number' ) {
throw new Error( 'pageWait requires a number to be passed.' );
}
await page.waitFor( delay );
};
|
/**
* Utility to have the page wait for a given length.
*
* Site Kit by Google, Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export const E2E_PAGE_WAIT = 250;
/**
* Set the page to wait for the passed time. Defaults to 250 milliseconds.
*
* @since 1.10.0
*
* @param {number} [delay] Optional. The amount of milliseconds to wait.
*/
export const pageWait = async ( delay = E2E_PAGE_WAIT ) => {
if ( typeof delay !== 'number' ) {
throw new Error( 'pageWait requires a number to be passed.' );
}
await page.waitFor( delay );
};
|
Fix spelling error in file header.
|
Fix spelling error in file header.
|
JavaScript
|
apache-2.0
|
google/site-kit-wp,google/site-kit-wp,google/site-kit-wp,google/site-kit-wp
|
3bc6773ac0ae53037a53dfea0df672ba2fa613f8
|
lib/collections/requests.js
|
lib/collections/requests.js
|
Requests = new Mongo.Collection('requests');
Meteor.methods({
addRequest: function(requestAttributes) {
check(Meteor.userId(), String);
check(requestAttributes, {
user: Object,
project: Object
});
if (hasRequestPending(requestAttributes.user.userId, requestAttributes.project.projectId)) {
throw new Meteor.Error('User has already requested to join');
}
var request = _.extend(requestAttributes, {
createdAt: new Date(),
status: 'pending'
});
Requests.insert(request);
createRequestNotification(request);
}
});
hasRequestPending = function(userId, projectId) {
return Requests.find({
'user.userId': userId,
'project.projectId': projectId,
status: 'pending' }).count() > 0;
};
|
Requests = new Mongo.Collection('requests');
Meteor.methods({
addRequest: function(requestAttributes) {
check(Meteor.userId(), String);
check(requestAttributes, {
user: Object,
project: Object
});
if (hasRequestPending(requestAttributes.user.userId, requestAttributes.project.projectId)) {
throw new Meteor.Error('User has already requested to join');
}
var request = _.extend(requestAttributes, {
createdAt: new Date(),
status: 'pending'
});
var requestId = Requests.insert(request);
var request = _.extend(request, {
_id: requestId
});
createRequestNotification(request);
}
});
hasRequestPending = function(userId, projectId) {
return Requests.find({
'user.userId': userId,
'project.projectId': projectId,
status: 'pending' }).count() > 0;
};
|
Add extra field so _id is passed to make notification read
|
Add extra field so _id is passed to make notification read
|
JavaScript
|
mit
|
PUMATeam/puma,PUMATeam/puma
|
fadf55c806d8339d2aca59fdbc1b1ebcc92de81d
|
webpack.config.js
|
webpack.config.js
|
var path = require('path');
var process = require('process');
var fs = require('fs');
var nodeModules = {};
fs.readdirSync('node_modules')
.filter(function(x) {
return ['.bin'].indexOf(x) === -1;
})
.forEach(function(mod) {
nodeModules[mod] = 'commonjs ' + mod;
});
module.exports = {
context: path.join(process.env.PWD, 'frontend'),
entry: "./index.js",
target: 'node',
output: {
path: path.join(__dirname, 'dist'),
filename: 'webpack.bundle.js'
},
externals: nodeModules,
module: {
loaders: [
{ test: /\.js$/, loader: 'babel' }
]
}
};
|
var path = require('path');
var process = require('process');
var fs = require('fs');
module.exports = {
context: path.join(process.env.PWD, 'frontend'),
entry: "./index.js",
target: 'node',
output: {
path: path.join(__dirname, 'dist'),
filename: 'webpack.bundle.js'
},
module: {
loaders: [
{ test: /\.js$/, loader: 'babel' }
]
}
};
|
Remove externals option for import React, ReactDOM, etc...
|
Remove externals option for import React, ReactDOM, etc...
|
JavaScript
|
mit
|
mgi166/usi-front,mgi166/usi-front
|
df4ec07d287066f89ae9077bbcc622426005ae06
|
webpack.config.js
|
webpack.config.js
|
/* global __dirname, require, module*/
const webpack = require('webpack');
const UglifyJsPlugin = webpack.optimize.UglifyJsPlugin;
const path = require('path');
const env = require('yargs').argv.env; // use --env with webpack 2
let libraryName = 'library';
let plugins = [], outputFile;
if (env === 'build') {
plugins.push(new UglifyJsPlugin({ minimize: true }));
outputFile = libraryName + '.min.js';
} else {
outputFile = libraryName + '.js';
}
const config = {
entry: __dirname + '/src/index.js',
devtool: 'source-map',
output: {
path: __dirname + '/lib',
filename: outputFile,
library: libraryName,
libraryTarget: 'umd',
umdNamedDefine: true
},
module: {
rules: [
{
test: /(\.jsx|\.js)$/,
loader: 'babel-loader',
exclude: /(node_modules|bower_components)/
},
{
test: /(\.jsx|\.js)$/,
loader: 'eslint-loader',
exclude: /node_modules/
}
]
},
resolve: {
modules: [path.resolve('./node_modules'), path.resolve('./src')],
extensions: ['.json', '.js']
},
plugins: plugins
};
module.exports = config;
|
/* global __dirname, require, module*/
const webpack = require('webpack');
const UglifyJsPlugin = webpack.optimize.UglifyJsPlugin;
const path = require('path');
const env = require('yargs').argv.env; // use --env with webpack 2
const pkg = require('./package.json');
let libraryName = pkg.name;
let plugins = [], outputFile;
if (env === 'build') {
plugins.push(new UglifyJsPlugin({ minimize: true }));
outputFile = libraryName + '.min.js';
} else {
outputFile = libraryName + '.js';
}
const config = {
entry: __dirname + '/src/index.js',
devtool: 'source-map',
output: {
path: __dirname + '/lib',
filename: outputFile,
library: libraryName,
libraryTarget: 'umd',
umdNamedDefine: true
},
module: {
rules: [
{
test: /(\.jsx|\.js)$/,
loader: 'babel-loader',
exclude: /(node_modules|bower_components)/
},
{
test: /(\.jsx|\.js)$/,
loader: 'eslint-loader',
exclude: /node_modules/
}
]
},
resolve: {
modules: [path.resolve('./node_modules'), path.resolve('./src')],
extensions: ['.json', '.js']
},
plugins: plugins
};
module.exports = config;
|
Use name of package.json as build output
|
Use name of package.json as build output
|
JavaScript
|
mit
|
krasimir/webpack-library-starter
|
dbe77896c2233f3ae06e539a4c3a50cbee778b28
|
web/src/main/ng/client/assets/js/context/List.Controller.js
|
web/src/main/ng/client/assets/js/context/List.Controller.js
|
angular.module('contextModule').controller('Context.ListController', [
'$scope',
'$http',
'$filter',
'$routeParams',
'FoundationApi',
'Event.Service',
function ($scope, $http, $filter, $routeParams, foundationApi, eventService) {
self = this;
var contexts;
eventService.register('Context.ListController', processEvent);
function processEvent(event) {
if (event.type === 'greenmoonsoftware.tidewater.web.context.events.PipelineContextEndedEvent') {
var c = $filter('getBy')(self.contexts, 'contextId', event.aggregateId);
c.status = event.status;
c.endTime = event.endTime.epochSecond * 1000;
$scope.$apply();
}
};
$scope.pipelineName = $routeParams.pipelineName;
$http.get('/pipelines/' + $scope.pipelineName + '/contexts').
then (function (response) {
self.contexts = response.data.reverse();
$scope.contexts = self.contexts;
}, function(response) {
foundationApi.publish('main-notifications', { color: 'alert', autoclose: 3000, content: 'Failed' });
});
}
]);
|
angular.module('contextModule').controller('Context.ListController', [
'$scope',
'$http',
'$filter',
'$routeParams',
'FoundationApi',
'Event.Service',
function ($scope, $http, $filter, $routeParams, foundationApi, eventService) {
self = this;
var contexts;
eventService.register('Context.ListController', processEvent);
function processEvent(event) {
if (event.type === 'greenmoonsoftware.tidewater.web.context.events.PipelineContextStartedEvent') {
$scope.contexts.unshift({
contextId: event.aggregateId,
pipelineName: $routeParams.pipelineName,
status: 'IN_PROGRESS',
startTime: event.eventDateTime.epochSecond * 1000,
});
$scope.apply();
}
else if (event.type === 'greenmoonsoftware.tidewater.web.context.events.PipelineContextEndedEvent') {
var c = $filter('getBy')(self.contexts, 'contextId', event.aggregateId);
c.status = event.status;
c.endTime = event.endTime.epochSecond * 1000;
$scope.$apply();
}
};
$scope.pipelineName = $routeParams.pipelineName;
$http.get('/pipelines/' + $scope.pipelineName + '/contexts').
then (function (response) {
self.contexts = response.data.reverse();
$scope.contexts = self.contexts;
}, function(response) {
foundationApi.publish('main-notifications', { color: 'alert', autoclose: 3000, content: 'Failed' });
});
}
]);
|
Add context to list upon start event
|
Add context to list upon start event
|
JavaScript
|
apache-2.0
|
greathouse/tidewater,greathouse/tidewater,greathouse/tidewater
|
4ac5daf222c879222677d66049505637a9a7836d
|
resources/assets/js/app.js
|
resources/assets/js/app.js
|
/**
* First we will load all of this project's JavaScript dependencies which
* includes Vue and other libraries. It is a great starting point when
* building robust, powerful web applications using Vue and Laravel.
*/
require('./bootstrap');
window.Vue = require('vue');
/**
* Next, we will create a fresh Vue application instance and attach it to
* the page. Then, you may begin adding components to this application
* or customize the JavaScript scaffolding to fit your unique needs.
*/
// Vue.component('example', require('./components/Example.vue'));
Vue.component('app-tracker', require('./components/Tracker.vue'));
const app = new Vue({
el: '#app-canvas',
data: {
coinSaved: ['Awjp27', 'LEc69S', 'cgSvK4'],
coinData: []
},
created: function() {
axios.get('/api/coins/list')
.then(function (response) {
app.coinData = response.data;
}).catch(function (response) {
return response;
})
}
});
|
/**
* First we will load all of this project's JavaScript dependencies which
* includes Vue and other libraries. It is a great starting point when
* building robust, powerful web applications using Vue and Laravel.
*/
require('./bootstrap');
window.Vue = require('vue');
/**
* Next, we will create a fresh Vue application instance and attach it to
* the page. Then, you may begin adding components to this application
* or customize the JavaScript scaffolding to fit your unique needs.
*/
// Vue.component('example', require('./components/Example.vue'));
Vue.component('app-tracker', require('./components/Tracker.vue'));
const app = new Vue({
el: '#app-canvas',
data: {
coinSaved: ['Awjp27', 'LEc69S', 'cgSvK4'],
coinData: []
},
methods: {
getPrices: function(coinUids) {
return axios.post('/api/coins/prices', {
coins: coinUids
})
.then(function (response) {
app.coinData = response.data;
}).catch(function (error) {
return error;
})
},
getAllPrices: function() {
return axios.get('/api/coins/prices')
.then(function (response) {
app.coinData = response.data;
}).catch(function (error) {
return error;
})
}
},
created: function() {
if (this.coinSaved.length > 0) {
this.getPrices(this.coinSaved);
} else {
this.getAllPrices();
}
}
});
|
Add method for limited coin retreival
|
Add method for limited coin retreival
|
JavaScript
|
mit
|
vadremix/zealoustools-core,vadremix/zealoustools-core
|
eaad32c88ae888c9e479ec5a7bef08f6d0f4502a
|
src/scene/scene_depthmaterial.js
|
src/scene/scene_depthmaterial.js
|
pc.extend(pc, function () {
/**
* @name pc.DepthMaterial
* @class A Depth material is is for rendering linear depth values to a render target.
* @author Will Eastcott
*/
var DepthMaterial = function () {
};
DepthMaterial = pc.inherits(DepthMaterial, pc.Material);
pc.extend(DepthMaterial.prototype, {
/**
* @function
* @name pc.DepthMaterial#clone
* @description Duplicates a Depth material.
* @returns {pc.DepthMaterial} A cloned Depth material.
*/
clone: function () {
var clone = new pc.DepthMaterial();
Material.prototype._cloneInternal.call(this, clone);
clone.update();
return clone;
},
update: function () {
},
updateShader: function (device) {
var options = {
skin: !!this.meshInstances[0].skinInstance
};
var library = device.getProgramLibrary();
this.shader = library.getProgram('depth', options);
}
});
return {
DepthMaterial: DepthMaterial
};
}());
|
pc.extend(pc, function () {
/**
* @private
* @name pc.DepthMaterial
* @class A Depth material is is for rendering linear depth values to a render target.
* @author Will Eastcott
*/
var DepthMaterial = function () {
};
DepthMaterial = pc.inherits(DepthMaterial, pc.Material);
pc.extend(DepthMaterial.prototype, {
/**
* @private
* @function
* @name pc.DepthMaterial#clone
* @description Duplicates a Depth material.
* @returns {pc.DepthMaterial} A cloned Depth material.
*/
clone: function () {
var clone = new pc.DepthMaterial();
Material.prototype._cloneInternal.call(this, clone);
clone.update();
return clone;
},
update: function () {
},
updateShader: function (device) {
var options = {
skin: !!this.meshInstances[0].skinInstance
};
var library = device.getProgramLibrary();
this.shader = library.getProgram('depth', options);
}
});
return {
DepthMaterial: DepthMaterial
};
}());
|
Remove pc.DepthMaterial from API ref.
|
Remove pc.DepthMaterial from API ref.
|
JavaScript
|
mit
|
guycalledfrank/engine,aidinabedi/playcanvas-engine,guycalledfrank/engine,sereepap2029/playcanvas,H1Gdev/engine,sereepap2029/playcanvas,H1Gdev/engine,sereepap2029/playcanvas,MicroWorldwide/PlayCanvas,playcanvas/engine,aidinabedi/playcanvas-engine,MicroWorldwide/PlayCanvas,playcanvas/engine
|
a54ed8d797aa22cdeefc30c28f18e737fda1265c
|
src/test/resources/specRunner.js
|
src/test/resources/specRunner.js
|
var scanner = require('./scanner');
module.exports = {
run: function(pattern) {
// load jasmine and a terminal reporter into global
load("jasmine-1.3.1/jasmine.js");
load('./terminalReporter.js');
// load the specs
var jasmineEnv = jasmine.getEnv(),
specs = scanner.findSpecs(pattern),
reporter = new jasmine.TerminalReporter({verbosity:3,color:true});
jasmineEnv.addReporter(reporter);
for(var i = 0; i < specs.length; i++) {
require(specs[i]);
}
process.nextTick(jasmineEnv.execute.bind(jasmineEnv));
}
};
|
var scanner = require('./scanner');
module.exports = {
run: function(pattern) {
// load jasmine and a terminal reporter into global
load("jasmine-1.3.1/jasmine.js");
load('./terminalReporter.js');
color = !process.env.JASMINE_NOCOLOR;
// load the specs
var jasmineEnv = jasmine.getEnv(),
specs = scanner.findSpecs(pattern),
reporter = new jasmine.TerminalReporter({verbosity:3,color:color});
jasmineEnv.addReporter(reporter);
for(var i = 0; i < specs.length; i++) {
require(specs[i]);
}
process.nextTick(jasmineEnv.execute.bind(jasmineEnv));
}
};
|
Use an env var to determine whether spec output should colorize
|
Use an env var to determine whether spec output should colorize
|
JavaScript
|
apache-2.0
|
dherges/nodyn,tony--/nodyn,tony--/nodyn,tony--/nodyn,dherges/nodyn,nodyn/nodyn,nodyn/nodyn,dherges/nodyn,nodyn/nodyn
|
58d581984caa03c468f4b5d05d7e2a61cc66374b
|
src/util/server/requestLogger.js
|
src/util/server/requestLogger.js
|
const uuid = require('uuid');
const DEFAULT_HEADER_NAME = 'x-request-id';
/**
* Create a request loging express middleware
* @param {Object} logger - a logger instance
* @param {Object} options
* @param {String?} options.headerName
* @returns {Function}
*/
export default function createRequestLogger(logger, options = { headerName: DEFAULT_HEADER_NAME }) {
/**
* Request Logger Middleware
* Adds base logging to every request
* Attaches a `log` child to each request object
*
* @param {Object} req
* @param {Object} res
* @param {Function} next
* @returns {undefined}
*/
return function requestLoggerMiddleware(req, res, next) {
const id = req.get(options.headerName) || uuid.v4();
let log = logger.child({ component: 'request', req_id: id, req });
// attach a logger to each request
req.log = log;
res.setHeader(options.headerName, id);
log.info('start request');
const time = process.hrtime();
res.on('finish', () => {
const diff = process.hrtime(time);
const duration = diff[0] * 1e3 + diff[1] * 1e-6;
log.info({ res, duration }, 'end request');
// Release the request logger for GC
req.log = null;
log = null;
});
next();
};
}
|
const uuid = require('uuid');
const DEFAULT_HEADER_NAME = 'x-request-id';
/**
* Create a request loging express middleware
* @param {Object} logger - a logger instance
* @param {Object} options
* @param {String?} options.reqIdHeader
* @returns {Function}
*/
export default function createRequestLogger(logger, { reqIdHeader = DEFAULT_HEADER_NAME } = {}) {
/**
* Request Logger Middleware
* Adds base logging to every request
* Attaches a `log` child to each request object
*
* @param {Object} req
* @param {Object} res
* @param {Function} next
* @returns {undefined}
*/
return function requestLoggerMiddleware(req, res, next) {
const id = req.get(reqIdHeader) || uuid.v4();
let log = logger.child({ component: 'request', req_id: id, req });
// attach a logger to each request
req.log = log;
res.setHeader(reqIdHeader, id);
log.info('start request');
const time = process.hrtime();
res.on('finish', () => {
const diff = process.hrtime(time);
const duration = diff[0] * 1e3 + diff[1] * 1e-6;
log.info({ res, duration }, 'end request');
// Release the request logger for GC
req.log = null;
log = null;
});
next();
};
}
|
Rename server request logger request id header name option and make the config object optional
|
Rename server request logger request id header name option and make the config object optional
|
JavaScript
|
mit
|
wework/we-js-logger
|
30d95d67c12157692037c015a41d18b352de5a89
|
packages/card-picker/addon/components/field-editors/cardstack-cards-editor.js
|
packages/card-picker/addon/components/field-editors/cardstack-cards-editor.js
|
import Component from '@ember/component';
import { inject as service } from '@ember/service';
import layout from '../../templates/components/field-editors/cardstack-cards-editor';
export default Component.extend({
tools: service('cardstack-card-picker'),
layout,
actions: {
addCard() {
this.tools.pickCard().then((card) => {
this.get(`content.${this.get('field')}`).pushObject(card);
})
},
orderChanged(rearrangedCards) {
this.set(`content.${this.get('field')}`, rearrangedCards);
},
deleteCard(card) {
this.get(`content.${this.get('field')}`).removeObject(card);
}
}
});
|
import Component from '@ember/component';
import { inject as service } from '@ember/service';
import { get, set } from '@ember/object';
import layout from '../../templates/components/field-editors/cardstack-cards-editor';
export default Component.extend({
tools: service('cardstack-card-picker'),
layout,
actions: {
addCard() {
let field = get(this, 'field');
let content = get(this, 'content');
this.tools.pickCard().then((card) => {
content.watchRelationship(field, () => {
get(content, field).pushObject(card);
});
})
},
orderChanged(rearrangedCards) {
let field = get(this, 'field');
let content = get(this, 'content');
content.watchRelationship(field, () => {
set(content, field, rearrangedCards);
});
},
deleteCard(card) {
let field = get(this, 'field');
let content = get(this, 'content');
content.watchRelationship(field, () => {
get(content, field).removeObject(card);
});
}
}
});
|
Use ember-data-relationship-tracker in cards editor
|
Use ember-data-relationship-tracker in cards editor
|
JavaScript
|
mit
|
cardstack/cardstack,cardstack/cardstack,cardstack/cardstack,cardstack/cardstack,cardstack/cardstack,cardstack/cardstack
|
9fe2c911f946bb05c6883405d24b7f61283f6aa4
|
app/index.js
|
app/index.js
|
'use strict';
var Generator = module.exports = function () {
var cb = this.async();
var ignores = [
'.git',
'CHANGELOG.md',
'CONTRIBUTING.md',
'LICENSE.md',
'README.md'
];
this.prompt([{
name: 'docs',
message: 'Would you like docs included?',
default: 'y/N'
}], function (err, props) {
if (err) {
return this.emit('error', err);
}
if (!/n/i.test(props.docs)) {
this.directory('doc');
}
this.directory('css');
this.directory('img');
this.directory('js');
this.expandFiles('*', {
cwd: this.sourceRoot(),
dot: true
}).forEach(function (el) {
if (/n/i.test(props.docs)) {
if (ignores.indexOf(el) === -1) {
this.copy(el, el);
}
} else {
if (el !== '.git') {
this.copy(el, el);
}
}
}, this);
cb();
}.bind(this));
};
Generator.name = 'HTML5 Boilerplate';
|
'use strict';
var Generator = module.exports = function () {
var cb = this.async();
var ignores = [
'.git',
'CHANGELOG.md',
'CONTRIBUTING.md',
'LICENSE.md',
'README.md'
];
this.prompt([{
type: 'confirm',
name: 'docs',
message: 'Would you like docs included?'
}], function (props) {
if (props.docs) {
this.directory('doc');
}
this.directory('css');
this.directory('img');
this.directory('js');
this.expandFiles('*', {
cwd: this.sourceRoot(),
dot: true
}).forEach(function (el) {
if (props.docs) {
if (ignores.indexOf(el) === -1) {
this.copy(el, el);
}
} else {
if (el !== '.git') {
this.copy(el, el);
}
}
}, this);
cb();
}.bind(this));
};
Generator.name = 'HTML5 Boilerplate';
|
Prepare for new Yeoman Generator prompt()s.
|
Prepare for new Yeoman Generator prompt()s.
|
JavaScript
|
mit
|
h5bp/generator-h5bp
|
c632fde791d79cd58b010189a9995ef9917f0040
|
app/store.js
|
app/store.js
|
import { createStore, combineReducers } from 'redux'
import Task from './reducers/Task'
export default createStore(
combineReducers(
{
Task
}
)
)
|
import { createStore, combineReducers } from 'redux'
import Task from './reducers/Task'
export default createStore(
combineReducers(
{
tasks: Task
}
)
)
|
Rename the state from 'Task' to 'tasks'.
|
Rename the state from 'Task' to 'tasks'.
|
JavaScript
|
mit
|
rhberro/the-react-client,rhberro/the-react-client
|
b4c8c52d3bd293c7067a5a9d16121aa34a4b855e
|
frontend/app/components/source-code.js
|
frontend/app/components/source-code.js
|
var LanguageMap = {
"crystal": "ruby",
"gcc": "c++"
};
export default Ember.Component.extend({
highlightLanguage: function() {
return LanguageMap[this.get('language')] || this.get('language');
}.property('language'),
watchForChanges: function() {
this.rerender();
}.observes('code'),
didInsertElement: function() {
var code = this.$('pre > code')[0];
code.innerHTML = window.ansi_up.ansi_to_html(code.innerHTML, {use_classes: true});
window.hljs.highlightBlock(this.$('pre > code')[0]);
window.hljs.lineNumbersBlock(this.$('pre > code')[0]);
}
});
|
var LanguageMap = {
"crystal": "ruby",
"gcc": "c++"
};
export default Ember.Component.extend({
highlightLanguage: function() {
return LanguageMap[this.get('language')] || this.get('language');
}.property('language'),
watchForChanges: function() {
this.rerender();
}.observes('code'),
didInsertElement: function() {
var code = this.$('pre > code')[0];
code.innerHTML = window.ansi_up.ansi_to_html(code.innerHTML, {use_classes: true});
window.hljs.highlightBlock(this.$('pre > code')[0]);
// window.hljs.lineNumbersBlock(this.$('pre > code')[0]);
}
});
|
Revert "Enable line numbers on result view"
|
Revert "Enable line numbers on result view"
This reverts commit cba57c3ab39796c9ac007d4e26f9c4ad94aa7a3f.
Still broken on FF
|
JavaScript
|
mit
|
jhass/carc.in,jhass/carc.in
|
c5b02f68eb68b83e63c4ec53f8ece85371e96ca0
|
js/main.js
|
js/main.js
|
$(function() {
$('a.white-text').on('click', function() {
$(this).addClass('animated bounceOutUp');
var href = $(this).attr('href');
setTimeout(function() {window.location = href}, 750);
return false;
});
$('#user').text(window.sessionStorage.name);
var animationName = 'animated bounce';
var animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';
$('.mc-answer').mouseenter( function() {
$(this).addClass(animationName).one(animationEnd, function() {
$(this).removeClass(animationName);
});
});
$('a#start').on('click', function () {
window.sessionStorage.name = $('input#name').val();
});
$('.modal-trigger').leanModal();
});
$(function() {
$('#back').on('click', function() {
var href = $(this).attr('href');
$('.s12 .card').addClass('animated bounceOutRight');
setTimeout(function() {window.location = href}, 375);
return false;
});
});
|
$(function() {
$('a.white-text').on('click', function() {
$(this).addClass('animated bounceOutUp');
var href = $(this).attr('href');
setTimeout(function() {window.location = href}, 750);
return false;
});
$('#user').text(window.sessionStorage.name);
var animationName = 'animated bounce';
var animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';
$('.mc-answer').mouseenter( function() {
$(this).addClass(animationName).one(animationEnd, function() {
$(this).removeClass(animationName);
});
});
$('button#start').on('click', function () {
window.sessionStorage.user_id = $('input[name=users]:checked + label').attr('for');
window.sessionStorage.name = $('input#name').val();
});
$('.modal-trigger').leanModal();
});
$(function() {
$('#back').on('click', function() {
var href = $(this).attr('href');
$('.s12 .card').addClass('animated bounceOutRight');
setTimeout(function() {window.location = href}, 375);
return false;
});
});
|
Change $ selector to new element
|
Change $ selector to new element
|
JavaScript
|
mit
|
whathejoe/lms-m4g4,whathejoe/lms-m4g4,whathejoe/lms-m4g4
|
14d31914de651203912a95fdcdef461be35ba1ac
|
exports.js
|
exports.js
|
goog.require('fontface.Observer');
if (typeof module !== 'undefined') {
module.exports = fontface.Observer;
} else {
window['FontFaceObserver'] = fontface.Observer;
window['FontFaceObserver']['prototype']['load'] = fontface.Observer.prototype.load;
}
|
goog.require('fontface.Observer');
if (typeof module === 'object') {
module.exports = fontface.Observer;
} else {
window['FontFaceObserver'] = fontface.Observer;
window['FontFaceObserver']['prototype']['load'] = fontface.Observer.prototype.load;
}
|
Check that module is an object, rather than that it's defined
|
Check that module is an object, rather than that it's defined
|
JavaScript
|
bsd-2-clause
|
bramstein/fontfaceobserver,bramstein/fontfaceobserver
|
785e223325cbce75b63a93db432fec2d2bea6dca
|
mixin/test/js/qunit-shim.js
|
mixin/test/js/qunit-shim.js
|
// Temporary Shim File for use while migrating from QUnit to Mocha
/*global chai */
function qunitShim() {
var _currentTest,
_describe = describe;
function emitQUnit() {
if (_currentTest) {
_describe(_currentTest.name, function() {
var config = _currentTest.config;
if (config && config.setup) {
beforeEach(config.setup);
}
if (config && config.teardown) {
afterEach(config.teardown);
}
_.each(_currentTest.tests, function(config) {
it(config.msg, config.exec);
});
});
}
_currentTest = undefined;
}
window.describe = function(name, exec) {
emitQUnit();
_describe.call(this, name, exec);
};
window.test = function(msg, exec) {
if (typeof exec === 'number') {
exec = arguments[2];
}
if (_currentTest) {
_currentTest.tests.push({msg: msg, exec: exec});
} else {
it(msg, exec);
}
};
window.QUnit = {
test: window.test,
module: function(name, config) {
emitQUnit();
_currentTest = {
name: name,
config: config,
tests: []
};
}
};
window.equal = chai.assert.equal;
window.deepEqual = chai.assert.deepEqual;
window.notEqual = chai.assert.notEqual;
window.ok = chai.assert.ok;
}
|
// Temporary Shim File for use while migrating from QUnit to Mocha
/*global chai */
function qunitShim() {
var _currentTest,
_describe = describe;
function emitQUnit() {
if (_currentTest) {
_describe(_currentTest.name, function() {
var config = _currentTest.config;
if (config && config.setup) {
beforeEach(config.setup);
}
if (config && config.teardown) {
afterEach(config.teardown);
}
_.each(_currentTest.tests, function(config) {
it(config.msg, config.exec);
});
});
}
_currentTest = undefined;
}
window.describe = function(name, exec) {
emitQUnit();
_describe.call(this, name, exec);
};
window.describe.skip = function(name, exec) {
emitQUnit();
_describe.skip.call(this, name, exec);
};
window.test = function(msg, exec) {
if (typeof exec === 'number') {
exec = arguments[2];
}
if (_currentTest) {
_currentTest.tests.push({msg: msg, exec: exec});
} else {
it(msg, exec);
}
};
window.QUnit = {
test: window.test,
module: function(name, config) {
emitQUnit();
_currentTest = {
name: name,
config: config,
tests: []
};
}
};
window.equal = chai.assert.equal;
window.deepEqual = chai.assert.deepEqual;
window.notEqual = chai.assert.notEqual;
window.ok = chai.assert.ok;
}
|
Add skip support to shim
|
Add skip support to shim
|
JavaScript
|
mit
|
walmartlabs/phoenix-build
|
7fa8cd27d134a0d493535c5ae6a25edbb0629697
|
runserver.js
|
runserver.js
|
#!/usr/bin/env node
var forever = require('forever-monitor');
var server = new (forever.Monitor)('server.js', {
options: process.argv.slice(2)
});
server.on('exit', function() {
console.log('server.js exiting');
});
server.start();
|
#!/usr/bin/env node
var forever = require('forever-monitor');
var server = new (forever.Monitor)('server.js', {
options: process.argv.slice(2),
watch: true,
watchIgnorePatterns: ['public', 'views'],
watchDirectory: '.'
});
server.on('exit', function() {
console.log('server.js exiting');
});
server.start();
|
Make forever.monitor watch source for modifications
|
Make forever.monitor watch source for modifications
|
JavaScript
|
mit
|
voithos/swiftcode,voithos/swiftcode,BarthV/swiftcode,BarthV/swiftcode
|
7e760caf56b58bea8a35bbdf86c70cc364dbbced
|
app/index.js
|
app/index.js
|
import Telegraf from 'telegraf';
import config from 'config';
import feedReader from './feed';
/* commands */
import commands from './commands';
/* helpers */
import { sendIntervalMessages } from './helpers/messageHelper';
// TODO move this to a DB
const chatids = process.env.CHAT_IDS || JSON.parse(config.get('CHAT_IDS'));
const app = new Telegraf(config.get('token'));
/* add commands from command array */
commands.forEach(command => app.command(command.key, ctx => command.func(ctx)));
/** telegram app **/
const token = process.env.token || config.get('token');
const URL = process.env.URL || config.get('URL');
const PORT = process.env.PORT || config.get('PORT');
const isDevelopment = process.env.NODE_ENV === 'development';
// start telegram listeners
if (isDevelopment) {
// remove webhook in case any is attached from previous sessions
app.telegram.setWebhook();
app.startPolling();
} else {
app.telegram.setWebhook(`${URL}/bot${token}`);
app.startWebhook(`/bot${token}`, null, PORT);
}
// start reading rss articles
feedReader.read((articles) => {
if (!articles) return;
chatids.forEach(id => sendIntervalMessages(app.telegram, id, articles));
});
|
import Telegraf from 'telegraf';
import config from 'config';
import feedReader from './feed';
/* commands */
import commands from './commands';
/* helpers */
import { sendIntervalMessages } from './helpers/messageHelper';
// TODO move this to a DB
const chatids = process.env.CHAT_IDS || JSON.parse(config.get('CHAT_IDS'));
/** telegram app **/
const token = process.env.token || config.get('token');
const URL = process.env.URL || config.get('URL');
const PORT = process.env.PORT || config.get('PORT');
const isDevelopment = process.env.NODE_ENV === 'development';
const app = new Telegraf(token);
/* add commands from command array */
commands.forEach(command => app.command(command.key, ctx => command.func(ctx)));
// start telegram listeners
if (isDevelopment) {
// remove webhook in case any is attached from previous sessions
app.telegram.setWebhook();
app.startPolling();
} else {
app.telegram.setWebhook(`${URL}/bot${token}`);
app.startWebhook(`/bot${token}`, null, PORT);
}
// start reading rss articles
feedReader.read((articles) => {
if (!articles) return;
chatids.forEach(id => sendIntervalMessages(app.telegram, id, articles));
});
|
Use token reference from env
|
Use token reference from env
|
JavaScript
|
mit
|
erikvilla/promo-bot,erikvilla/promo-bot
|
a29448bea260e5ac85c095035001ed0388f1a212
|
bin/pwned.js
|
bin/pwned.js
|
#!/usr/bin/env node
const program = require('commander');
const pkg = require('../package.json');
const addCommands = require('../lib/commands');
// Begin command-line argument configuration
program
.usage('[option | command]')
.description('Each command has its own -h (--help) option.')
.version(pkg.version, '-v, --version');
// Add all the commands
addCommands(program);
// Display help and exit if unknown arguments are provided
program.on('*', () => program.help());
// Initiate the parser
program.parse(process.argv);
// Display help and exit if no arguments are provided
if (!process.argv.slice(2).length) {
program.help();
}
|
#!/usr/bin/env node
const program = require('commander');
const pkg = require('../package.json');
// eslint-disable-next-line import/no-unresolved
const addCommands = require('../lib/commands');
// Begin command-line argument configuration
program
.usage('[option | command]')
.description('Each command has its own -h (--help) option.')
.version(pkg.version, '-v, --version');
// Add all the commands
addCommands(program);
// Display help and exit if unknown arguments are provided
program.on('*', () => program.help());
// Initiate the parser
program.parse(process.argv);
// Display help and exit if no arguments are provided
if (!process.argv.slice(2).length) {
program.help();
}
|
Disable eslint import/no-unresolved rule in bin script
|
Disable eslint import/no-unresolved rule in bin script
|
JavaScript
|
mit
|
wKovacs64/pwned,wKovacs64/pwned
|
649f0298319c941883ff220e4245282664829002
|
src/middleware/session-store.js
|
src/middleware/session-store.js
|
const session = require('express-session')
const redisStore = require('../../config/redis-store')
const config = require('../../config')
const sessionStore = session({
store: redisStore,
proxy: config.isProd,
cookie: {
secure: config.isProd,
maxAge: config.session.ttl,
},
rolling: true,
secret: config.session.secret,
resave: true,
saveUninitialized: false,
unset: 'destroy',
})
module.exports = sessionStore
|
const session = require('express-session')
const redisStore = require('../../config/redis-store')
const config = require('../../config')
const sessionStore = session({
store: redisStore,
proxy: config.isProd,
cookie: {
secure: config.isProd,
maxAge: config.session.ttl,
},
rolling: true,
secret: config.session.secret,
resave: true,
saveUninitialized: false,
unset: 'destroy',
key: 'datahub.sid',
})
module.exports = sessionStore
|
Add datahub specific session key
|
Add datahub specific session key
This changes brings back in the datahub.sid key for our session, I
previously removed this and have noticed that it is needed back as we
clear the cookie via "datahub.sid".
This changes the default "connect.sid" to "datahub.sid"
|
JavaScript
|
mit
|
uktrade/data-hub-frontend,uktrade/data-hub-fe-beta2,uktrade/data-hub-frontend,uktrade/data-hub-fe-beta2,uktrade/data-hub-frontend
|
dc67b982481411b0fae26c3f69e3c0ac2ad7b2aa
|
examples/03-build-systems/server.js
|
examples/03-build-systems/server.js
|
var express = require("express"),
app = express()
app.get("/", function (req, res) {
res.send("<!DOCTYPE html>" +
"<html>" +
"<head>" +
"<title>2.x basic usage</title>" +
"</head>" +
"<body>" +
"<div id='app'></div>" +
"<script type='text/javascript' src='/static/bundle.js'></script>" +
"</body>" +
"</html>")
})
app.get("/static/bundle.js", function (req, res) {
res.sendFile("bundle.js", {root: __dirname})
})
app.listen(3000)
|
var express = require("express"),
app = express()
app.get("/", function (req, res) {
res.send("<!DOCTYPE html>" +
"<html>" +
"<head>" +
"<title>2.x build systems</title>" +
"</head>" +
"<body>" +
"<div id='app'></div>" +
"<script type='text/javascript' src='/static/bundle.js'></script>" +
"</body>" +
"</html>")
})
app.get("/static/bundle.js", function (req, res) {
res.sendFile("bundle.js", {root: __dirname})
})
app.listen(3000)
|
Fix build systems example title
|
Fix build systems example title
|
JavaScript
|
mit
|
milankinen/livereactload
|
ed0297e988e707d158f00f3cec07cb6d8dc4ded7
|
src/pre.js
|
src/pre.js
|
const args = unescape(document.location.hash).substring(1);
let argv = args === "" ? [] : args.split(' ');
if (argv.length === 0 && window.DEFAULT_ARGV) argv = window.DEFAULT_ARGV;
Module['arguments'] = argv;
|
const args = unescape(document.location.hash).substring(1);
var argv = args === "" ? [] : args.split(' ');
if (argv.length === 0 && window.DEFAULT_ARGV) argv = window.DEFAULT_ARGV;
Module['arguments'] = argv;
|
Fix uglify-js TypeError with emcc -O3, no ES6. Closes GH-58
|
Fix uglify-js TypeError with emcc -O3, no ES6. Closes GH-58
|
JavaScript
|
mit
|
satoshinm/NetCraft,satoshinm/NetCraft,satoshinm/NetCraft,satoshinm/NetCraft,satoshinm/NetCraft
|
932750f77df037b7b4b3e5d04bcb79522588ee27
|
tools/tests/cordova-platforms.js
|
tools/tests/cordova-platforms.js
|
var selftest = require('../tool-testing/selftest.js');
var Sandbox = selftest.Sandbox;
var files = require('../fs/files.js');
selftest.define("add cordova platforms", ["cordova"], function () {
var s = new Sandbox();
var run;
// Starting a run
s.createApp("myapp", "package-tests");
s.cd("myapp");
run = s.run("run", "android");
run.matchErr("Please add the Android platform to your project first");
run.match("meteor add-platform android");
run.expectExit(1);
var run = s.run("add-platform", "android");
// Cordova may need to download cordova-android if it's not already
// cached (in ~/.cordova).
run.waitSecs(30);
run.match("added platform");
run.expectExit(0);
run = s.run("remove-platform", "foo");
run.matchErr("foo: platform is not");
run.expectExit(1);
run = s.run("remove-platform", "android");
run.match("removed");
run = s.run("run", "android");
run.matchErr("Please add the Android platform to your project first");
run.match("meteor add-platform android");
run.expectExit(1);
});
|
var selftest = require('../tool-testing/selftest.js');
var Sandbox = selftest.Sandbox;
var files = require('../fs/files.js');
selftest.define("add cordova platforms", ["cordova"], function () {
var s = new Sandbox();
let run;
// Starting a run
s.createApp("myapp", "package-tests");
s.cd("myapp");
run = s.run("run", "android");
run.matchErr("Please add the Android platform to your project first");
run.match("meteor add-platform android");
run.expectExit(1);
run = s.run("add-platform", "android");
// Cordova may need to download cordova-android if it's not already
// cached (in ~/.cordova).
run.waitSecs(30);
run.match("added platform");
run.expectExit(0);
run = s.run("remove-platform", "foo");
run.matchErr("foo: platform is not");
run.expectExit(1);
run = s.run("remove-platform", "android");
run.match("removed");
run = s.run("run", "android");
run.matchErr("Please add the Android platform to your project first");
run.match("meteor add-platform android");
run.expectExit(1);
});
|
Fix redeclared var & change to let
|
Fix redeclared var & change to let
|
JavaScript
|
mit
|
mjmasn/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,mjmasn/meteor,mjmasn/meteor,mjmasn/meteor,mjmasn/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,mjmasn/meteor,mjmasn/meteor,Hansoft/meteor
|
6ea3c3e834314fcd9dd9a29041f3eae633ebf1ff
|
src/forecast/forecastHourly/SummaryButton.test.js
|
src/forecast/forecastHourly/SummaryButton.test.js
|
import React from 'react'
import {shallow} from 'enzyme'
import toJson from 'enzyme-to-json'
import SummaryButton from './SummaryButton'
describe('<SummaryButton />', () => {
it('should render', () => {
const wrapper = shallow(<SummaryButton />)
expect(toJson(wrapper)).toMatchSnapshot()
})
})
|
import React from 'react'
import {shallow} from 'enzyme'
import toJson from 'enzyme-to-json'
import sinon from 'sinon'
import SummaryButton from './SummaryButton'
describe('<SummaryButton />', () => {
it('should render', () => {
const wrapper = shallow(<SummaryButton />)
expect(toJson(wrapper)).toMatchSnapshot()
})
it('should simulate click event', () => {
const onSummaryClick = sinon.spy()
let wrapper = shallow(<SummaryButton onSummaryClick={onSummaryClick} />)
wrapper.find('button').simulate('click')
expect(onSummaryClick.called).toEqual(true)
})
})
|
Add sinon.spy for event handlers
|
Add sinon.spy for event handlers
|
JavaScript
|
mit
|
gibbok/react-redux-weather-app,gibbok/react-redux-weather-app
|
dfb2455921900dd6ca257d86bbc19c5d2bd1a7e2
|
templates/admin/js/featured_apps.js
|
templates/admin/js/featured_apps.js
|
<script type=text/javascript>
$SCRIPT_ROOT = {{ request.script_root|tojson|safe }};
function add(app_id) {
var url = $SCRIPT_ROOT + "/admin/featured/" + app_id;
var xhr = $.ajax({
type: 'POST',
url: url,
dataType: 'json',
});
xhr.done(function(){
$("#appBtnDel" + app_id).show();
$("#appBtnAdd" + app_id).hide();
});
}
function del(app_id) {
var url = $SCRIPT_ROOT + "/admin/featured/" + app_id;
var xhr = $.ajax({
type: 'DELETE',
url: url,
dataType: 'json',
});
xhr.done(function(){
$("#appBtnDel" + app_id).hide();
$("#appBtnAdd" + app_id).show();
});
}
</script>
|
<script type="text/javascript">
var csrftoken = "{{ csrf_token() }}";
$.ajaxSetup({
beforeSend: function(xhr, settings) {
if (!/^(GET|HEAD|OPTIONS|TRACE)$/i.test(settings.type)) {
xhr.setRequestHeader("X-CSRFToken", csrftoken)
}
}
})
$SCRIPT_ROOT = {{ request.script_root|tojson|safe }};
function add(app_id) {
var url = $SCRIPT_ROOT + "/admin/featured/" + app_id;
var xhr = $.ajax({
type: 'POST',
url: url,
dataType: 'json',
});
xhr.done(function(){
$("#appBtnDel" + app_id).show();
$("#appBtnAdd" + app_id).hide();
});
}
function del(app_id) {
var url = $SCRIPT_ROOT + "/admin/featured/" + app_id;
var xhr = $.ajax({
type: 'DELETE',
url: url,
dataType: 'json',
});
xhr.done(function(){
$("#appBtnDel" + app_id).hide();
$("#appBtnAdd" + app_id).show();
});
}
</script>
|
Fix for using the csrf token in xhr requests
|
Fix for using the csrf token in xhr requests
|
JavaScript
|
mit
|
spMohanty/geotagx-theme,geotagx/geotagx-theme,spMohanty/geotagx-theme,CRUKorg/pybossa-cruk-theme,jeffersonrpn/pybossa-contribua-theme,CRUKorg/pybossa-cruk-theme,PyBossa/pybossa-default-theme,proyectos-analizo-info/pybossa-analizo-info-default-theme,jeffersonrpn/pybossa-contribua-theme,AltClick/pybossa-amnesty-theme,spMohanty/geotagx-theme,spMohanty/geotagx-theme,geotagx/geotagx-theme,geotagx/geotagx-theme,PyBossa/pybossa-default-theme,AltClick/pybossa-amnesty-theme,khadgarmage/pybossa-stardust-theme,proyectos-analizo-info/pybossa-analizo-info-default-theme,Scifabric/mrallergen-theme,proyectos-analizo-info/pybossa-analizo-info-default-theme,PyBossa/mrallergen-theme,khadgarmage/pybossa-stardust-theme,CRUKorg/pybossa-cruk-theme,Scifabric/mrallergen-theme,jeffersonrpn/pybossa-contribua-theme,PyBossa/mrallergen-theme
|
53640302616c8ddc1b0012b72cec65d17d249bba
|
src/index.js
|
src/index.js
|
import React from 'react';
import ReactDOM from 'react-dom';
import SearchBar from './components/search_bar';
import secret from './_secret.js';
const YOUTUBE_API_KEY = secret.API_KEY;
// console.log(YOUTUBE_API_KEY);
// This is a class of a component
// To create an instance of this class use <App />
const App = () => {
return (
<div>
<SearchBar />
</div>
);
};
// Render App inside an element with class name 'container'
ReactDOM.render(<App />, document.querySelector('.container'));
|
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import YTSearch from 'youtube-api-search';
import SearchBar from './components/search_bar';
import secret from './_secret.js';
const YOUTUBE_API_KEY = secret.API_KEY;
// console.log(YOUTUBE_API_KEY);
YTSearch({key: YOUTUBE_API_KEY, term: 'surfboards' }, (data) => {
console.log(data);
})
// This is a class of a component
// To create an instance of this class use <App />
class App extends Component {
constructor(props) {
super(props);
this.state = {}
}
render() {
return (
<div>
<SearchBar />
</div>
);
}
}
// Render App inside an element with class name 'container'
ReactDOM.render(<App />, document.querySelector('.container'));
|
Use YTSearch to search Youtube. Refactor App into class.
|
Use YTSearch to search Youtube.
Refactor App into class.
|
JavaScript
|
mit
|
RobGThai/ReduxTutorial,RobGThai/ReduxTutorial
|
f08fa9edef3e8fc31b9628779b29794e0785cb96
|
src/index.js
|
src/index.js
|
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import './index.scss';
ReactDOM.render(
<App />,
document.getElementById('root')
);
|
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import './index.scss';
// change page title with window visibility
document.addEventListener('visibilitychange', () => (
document.hidden
? document.title = document.title.replace(' - ', ' | ')
: document.title = document.title.replace(' | ', ' - ')
));
ReactDOM.render(
<App />,
document.getElementById('root')
);
|
Change page title with window visibility
|
Change page title with window visibility
|
JavaScript
|
mit
|
emyarod/afw,emyarod/afw
|
1e60681342054cae707c66a797fe303146f95023
|
src/index.js
|
src/index.js
|
export default ({ types: t }) => {
const buildPropertyAssignment = (objName, propName, valueNode) =>
t.assignmentExpression(
'=',
t.memberExpression(t.identifier(objName), t.identifier(propName)),
valueNode
)
return {
visitor: {
Program: {
exit(program, { opts }) {
program.traverse({
AssignmentExpression: {
enter(path) {
if (path.node.operator !== '=' || !t.isMemberExpression(path.node.left)) {
return
}
for (const name of Object.keys(opts)) {
if (!t.isIdentifier(path.node.left.object, { name: 'global' })
|| !t.isIdentifier(path.node.left.property, { name })) {
continue
}
const [to, ...aliases] = [].concat(opts[name])
const renamedAssignment = buildPropertyAssignment('global', to, path.node.right)
const chainedAliasAssignments = aliases.reduce(
(chained, alias) =>
buildPropertyAssignment('global', alias, chained),
renamedAssignment
)
path.replaceWith(t.expressionStatement(chainedAliasAssignments))
}
}
}
})
}
}
}
}
}
|
export default ({ types: t }) => {
const buildPropertyAssignment = (objName, propName, valueNode) =>
t.assignmentExpression(
'=',
t.memberExpression(t.identifier(objName), t.identifier(propName)),
valueNode
)
return {
visitor: {
Program: {
exit(program, { opts }) {
program.traverse({
AssignmentExpression: {
enter(path) {
const { node: { operator, left: memberExpression, right: valueExpression } } = path
if (operator !== '=' || !t.isMemberExpression(memberExpression)) {
return
}
for (const object of Object.keys(opts)) {
if (!t.isIdentifier(memberExpression.object, { name: object })) {
continue
}
for (const property of Object.keys(opts[object])) {
if (!t.isIdentifier(memberExpression.property, { name: property })) {
continue
}
const [to, ...aliases] = [].concat(opts[object][property])
const renamedAssignment = buildPropertyAssignment(object, to, valueExpression)
const chainedAliasAssignments = aliases.reduce(
(chained, alias) =>
buildPropertyAssignment(object, alias, chained),
renamedAssignment
)
path.replaceWith(t.expressionStatement(chainedAliasAssignments))
}
}
}
}
})
}
}
}
}
}
|
Support any object and property name given with options
|
Support any object and property name given with options
|
JavaScript
|
mit
|
jamonkko/babel-plugin-rename-assigned-properties
|
63cd62a25e3d1f6781921976afeaf71950fa35fc
|
app/assets/javascripts/application.js
|
app/assets/javascripts/application.js
|
//= require govuk_publishing_components/dependencies
//= require govuk_publishing_components/all_components
//= require password-strength-indicator
//= require jquery_ujs
|
//= require govuk_publishing_components/dependencies
//= require govuk_publishing_components/all_components
//= require password-strength-indicator
//= require rails-ujs
|
Switch from jquery_ujs to rails-ujs
|
Switch from jquery_ujs to rails-ujs
This has been done with the expectation that jQuery will soon be removed
from the govuk_publishing_components and that we will need to use the
vanilla JS equivalent of Rails unobtrusive JavaScript.
|
JavaScript
|
mit
|
alphagov/signonotron2,alphagov/signonotron2,alphagov/signonotron2,alphagov/signonotron2
|
ba5ef76991b2fc557240374edb1502c4772ea586
|
app/assets/javascripts/invitations.js
|
app/assets/javascripts/invitations.js
|
$(document).ready(function() {
$(document).on("ajax:success", "a[data-remote]", function(e, data, status, xhr) {
$("#invitations").html(xhr.responseText);
$('select').chosen(function(){
allow_single_deselect: true
no_results_text: 'No results matched'
});
$(document).foundation();
});
$(document).on('change','#workshop_invitations ',function() {
this.form.submit();
})
});
|
$(document).ready(function() {
$(document).on("ajax:success", "a[data-remote]", function(e, data, status, xhr) {
var $invitations = $("#invitations");
$invitations.html(xhr.responseText);
$invitations.find('select').chosen(function () {
allow_single_deselect: true
no_results_text: 'No results matched'
});
$invitations.foundation('tooltip', 'reflow');
});
$(document).on('change','#workshop_invitations ',function() {
this.form.submit();
})
});
|
Improve HTML re-rendering after marked as attended
|
Improve HTML re-rendering after marked as attended
This change will slightly improve the time we have to wait when
checking someone in for a workshop. In order to get faster times,
the whole technique has to be replaced by something different.
At the moment, there are a lot of JS events and layout reflows
which slow down the page considerably.
|
JavaScript
|
mit
|
codebar/planner,codebar/planner,laszpio/planner,laszpio/planner,laszpio/planner,codebar/planner,codebar/planner,laszpio/planner
|
9a556e8fb8ed74b000a4cc354cba8d2d9fe9082a
|
src/index.js
|
src/index.js
|
var formatLocale = require('./utils').formatLocale
function getLocale(locale) {
if (locale) return locale
if (global.Intl && typeof global.Intl.DateTimeFormat === 'function') {
return global.Intl.DateTimeFormat().resolvedOptions && global.Intl.DateTimeFormat().resolvedOptions().locale
}
if (global.chrome && typeof global.chrome.app.getDetails === 'function') {
return global.chrome.app.getDetails().current_locale
}
locale = (global.clientInformation || global.navigator || Object.create(null)).language ||
(global.navigator &&
(global.navigator.userLanguage ||
(global.navigator.languages && global.navigator.languages[0]) ||
(global.navigator.userAgent && global.navigator.userAgent.match(/;.(\w+\-\w+)/i)[1])))
if (!locale && ['LANG', 'LANGUAGE'].some(Object.hasOwnProperty, process.env)) {
return (process.env.LANG ||
process.env.LANGUAGE ||
String()).replace(/[.:].*/, '')
.replace('_', '-')
}
return locale
}
var locale2 = function(locale) {
return formatLocale(getLocale(locale))
}
exports.locale2 = locale2
|
var formatLocale = require('./utils').formatLocale
function getLocale(locale) {
if (locale) return locale
if (global.Intl && typeof global.Intl.DateTimeFormat === 'function') {
return global.Intl.DateTimeFormat().resolvedOptions && global.Intl.DateTimeFormat().resolvedOptions().locale
}
if (global.chrome && global.chrome.app && typeof global.chrome.app.getDetails === 'function') {
return global.chrome.app.getDetails().current_locale
}
locale = (global.clientInformation || global.navigator || Object.create(null)).language ||
(global.navigator &&
(global.navigator.userLanguage ||
(global.navigator.languages && global.navigator.languages[0]) ||
(global.navigator.userAgent && global.navigator.userAgent.match(/;.(\w+\-\w+)/i)[1])))
if (!locale && ['LANG', 'LANGUAGE'].some(Object.hasOwnProperty, process.env)) {
return (process.env.LANG ||
process.env.LANGUAGE ||
String()).replace(/[.:].*/, '')
.replace('_', '-')
}
return locale
}
var locale2 = function(locale) {
return formatLocale(getLocale(locale))
}
exports.locale2 = locale2
|
Fix issue for Samsung Android Stock Browser
|
Fix issue for Samsung Android Stock Browser
Some Android Samsung Stock Browsers have window.chrome defined but no "app" property underneath.
|
JavaScript
|
mit
|
moimikey/locale2,moimikey/locale2
|
0ed8255690d62eeb08700c5410149c7f2d2a58c4
|
src/index.js
|
src/index.js
|
import "core-js/fn/array/from";
import "core-js/fn/object/get-own-property-symbols";
import "core-js/fn/object/keys";
import "core-js/fn/set";
import Helmet from "./Helmet";
export default Helmet;
|
import "core-js/fn/array/from";
import "core-js/fn/object/get-own-property-symbols";
import "core-js/fn/set";
import Helmet from "./Helmet";
export default Helmet;
|
Remove Object.keys polyfill (supported since IE9)
|
Remove Object.keys polyfill (supported since IE9)
|
JavaScript
|
mit
|
magus/react-helmet,bountylabs/react-helmet,nfl/react-helmet
|
352dbf15e0ed91a78519d6f37c5678492b6988d5
|
src/index.js
|
src/index.js
|
import React from 'react';
import ReactDOM from 'react-dom';
import Web3 from 'web3'
import App from './App';
import registerServiceWorker from './registerServiceWorker';
import { useStrict } from 'mobx';
import { Provider } from 'mobx-react';
import * as stores from './stores';
import 'font-awesome/css/font-awesome.css'
useStrict(true);
if (!process.env['REACT_APP_REGISTRY_ADDRESS']) {
throw new Error('REACT_APP_REGISTRY_ADDRESS env variable is not present')
}
const devEnvironment = process.env.NODE_ENV === 'development';
if (devEnvironment) {
window.web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545'));
}
ReactDOM.render(
<Provider { ...stores }>
<App />
</Provider>,
document.getElementById('root'));
registerServiceWorker();
|
import React from 'react';
import ReactDOM from 'react-dom';
import Web3 from 'web3'
import App from './App';
import registerServiceWorker from './registerServiceWorker';
import { useStrict } from 'mobx';
import { Provider } from 'mobx-react';
import * as stores from './stores';
import 'font-awesome/css/font-awesome.css'
useStrict(true);
if (!process.env['REACT_APP_REGISTRY_ADDRESS']) {
throw new Error('REACT_APP_REGISTRY_ADDRESS env variable is not present')
}
const devEnvironment = process.env.NODE_ENV === 'development';
if (devEnvironment && !window.web3) {
window.web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545'));
}
ReactDOM.render(
<Provider { ...stores }>
<App />
</Provider>,
document.getElementById('root'));
registerServiceWorker();
|
Fix dev environment web3 loading
|
Fix dev environment web3 loading
|
JavaScript
|
mit
|
oraclesorg/ico-wizard,oraclesorg/ico-wizard,oraclesorg/ico-wizard
|
3bfbcc81d6ad2b0984db6485b335eb9fe8706942
|
app/initializers/coordinator-setup.js
|
app/initializers/coordinator-setup.js
|
import Coordinator from '../models/coordinator';
export default {
name: "setup coordinator",
initialize: function(container,app) {
app.register("drag:coordinator",Coordinator);
app.inject("component","coordinator","drag:coordinator");
}
};
|
import Coordinator from '../models/coordinator';
export default {
name: "setup coordinator",
initialize: function() {
let app = arguments[1] || arguments[0];
app.register("drag:coordinator",Coordinator);
app.inject("component","coordinator","drag:coordinator");
}
};
|
Remove Ember 2.1 deprecation warning
|
Remove Ember 2.1 deprecation warning
Updates the initializer to remove the deprecation warning in Ember 2.1 caused by having two arguments (container, app) in the initialize function. This uses the backwards compatible safe method described in the deprecation pages (http://emberjs.com/deprecations/v2.x/#toc_initializer-arity)
|
JavaScript
|
mit
|
mharris717/ember-drag-drop,mharris717/ember-drag-drop,drourke/ember-drag-drop,drourke/ember-drag-drop,curit/ember-drag-drop,curit/ember-drag-drop
|
bb5c90c579b8ac79345c02c9d3316f20e350aaad
|
app/javascript/shared/autocomplete.js
|
app/javascript/shared/autocomplete.js
|
import autocomplete from 'autocomplete.js';
import { getJSON, fire } from '@utils';
const sources = [
{
type: 'address',
url: '/address/suggestions'
},
{
type: 'path',
url: '/admin/procedures/path_list'
}
];
const options = {
autoselect: true,
minLength: 1
};
function selector(type) {
return `[data-autocomplete=${type}]`;
}
function source(url) {
return {
source(query, callback) {
getJSON(url, { request: query }).then(callback);
},
templates: {
suggestion({ label, mine }) {
const mineClass = `path-mine-${mine ? 'true' : 'false'}`;
const openTag = `<div class="aa-suggestion ${mineClass}">`;
return autocomplete.escapeHighlightedString(label, openTag, '</div>');
}
},
debounce: 300
};
}
addEventListener('turbolinks:load', function() {
for (let { type, url } of sources) {
for (let target of document.querySelectorAll(selector(type))) {
let select = autocomplete(target, options, [source(url)]);
select.on('autocomplete:selected', ({ target }, suggestion) => {
fire(target, 'autocomplete:select', suggestion);
select.autocomplete.setVal(suggestion.label);
});
}
}
});
|
import autocomplete from 'autocomplete.js';
import { getJSON, fire } from '@utils';
const sources = [
{
type: 'address',
url: '/address/suggestions'
},
{
type: 'path',
url: '/admin/procedures/path_list'
}
];
const options = {
autoselect: true,
minLength: 1
};
function selector(type) {
return `[data-autocomplete=${type}]`;
}
function source(url) {
return {
source(query, callback) {
getJSON(url, { request: query }).then(callback);
},
templates: {
suggestion({ label, mine }) {
const mineClass = `path-mine-${mine ? 'true' : 'false'}`;
const openTag = `<div class="aa-suggestion ${mineClass}">`;
return autocomplete.escapeHighlightedString(label, openTag, '</div>');
}
},
debounce: 300
};
}
addEventListener('turbolinks:load', function() {
autocompleteSetup();
});
addEventListener('ajax:success', function() {
autocompleteSetup();
});
function autocompleteSetup() {
for (let { type, url } of sources) {
for (let element of document.querySelectorAll(selector(type))) {
if (!element.dataset.autocompleteInitialized) {
autocompleteInitializeElement(element, url);
}
}
}
}
function autocompleteInitializeElement(element, url) {
const select = autocomplete(element, options, [source(url)]);
select.on('autocomplete:selected', ({ target }, suggestion) => {
fire(target, 'autocomplete:select', suggestion);
select.autocomplete.setVal(suggestion.label);
});
element.dataset.autocompleteInitialized = true;
}
|
Fix champ address on repetitions
|
Fix champ address on repetitions
|
JavaScript
|
agpl-3.0
|
sgmap/tps,sgmap/tps,sgmap/tps
|
add4e0ae8afeb3726cd4fe901a882b0635cf33ff
|
src/index.js
|
src/index.js
|
import React from 'react';
export let IntercomAPI = window.Intercom || function() { console.warn('Intercome not initialized yet') };
export default class Intercom extends React.Component {
static propTypes = {
appID: React.PropTypes.string.isRequired
}
static displayName = 'Intercom'
constructor(props) {
super(props);
if (typeof window.Intercom === "function" || !props.appID) {
return;
}
(function(w, d, id, s, x) {
function i() {
i.c(arguments);
}
i.q = [];
i.c = function(args) {
i.q.push(args);
};
w.Intercom = i;
s = d.createElement('script');
s.onload = function() { IntercomAPI = window.Intercom };
s.async = 1;
s.src = 'https://widget.intercom.io/widget/' + id;
x = d.getElementsByTagName('script')[0];
x.parentNode.insertBefore(s, x);
})(window, document, props.appID);
window.intercomSettings = props;
if (typeof window.Intercom === 'function') {
window.Intercom('boot', props);
}
}
componentWillReceiveProps(nextProps) {
window.intercomSettings = nextProps;
window.Intercom('update');
}
shouldComponentUpdate() {
return false;
}
componentWillUnmount() {
window.Intercom('shudown');
}
render() {
return false;
}
}
|
import React from 'react';
export let IntercomAPI = window.Intercom || function() { console.warn('Intercome not initialized yet') };
export default class Intercom extends React.Component {
static propTypes = {
appID: React.PropTypes.string.isRequired
}
static displayName = 'Intercom'
constructor(props) {
super(props);
if (typeof window.Intercom === "function" || !props.appID) {
return;
}
(function(w, d, id, s, x) {
function i() {
i.c(arguments);
}
i.q = [];
i.c = function(args) {
i.q.push(args);
};
w.Intercom = i;
s = d.createElement('script');
s.onload = function() { IntercomAPI = window.Intercom };
s.async = 1;
s.src = 'https://widget.intercom.io/widget/' + id;
x = d.getElementsByTagName('script')[0];
x.parentNode.insertBefore(s, x);
})(window, document, props.appID);
window.intercomSettings = props;
if (typeof window.Intercom === 'function') {
window.Intercom('boot', props);
}
}
componentWillReceiveProps(nextProps) {
window.intercomSettings = nextProps;
window.Intercom('update');
}
shouldComponentUpdate() {
return false;
}
componentWillUnmount() {
window.Intercom('shutdown');
}
render() {
return false;
}
}
|
Fix spelling error with shutdown
|
Fix spelling error with shutdown
|
JavaScript
|
mit
|
nhagen/react-intercom
|
3f3c77c0f159d058d091df03cf2561b707307c3b
|
server/middleware/checkUserExistence.js
|
server/middleware/checkUserExistence.js
|
const logger = require('logfilename')(__filename);
const { User, PendingUser } = require('../models');
module.exports = (req, res, next) => {
const username = req.body.username || req.body.email;
const usernameField = req.body.username ? 'username' : 'email';
req.usernameField = usernameField;
logger.info('Checking for existence of user: ', username);
PendingUser
.findByUsernameOrEmail(username)
.then(
user => {
if (!user) {
return User
.findByUsernameOrEmail(username)
.then(
verifiedUser => {
if (!verifiedUser) {
logger.warn('User %s does not exist. Moving on...', username);
return next();
}
logger.info('User %s exists (verified).', username);
req.user = verifiedUser;
return next();
},
error => next(error)
);
}
logger.info('User %s exists (unverified).', username);
req.user = user;
return next();
},
error => next(error)
);
};
|
const logger = require('logfilename')(__filename);
const { User, PendingUser } = require('../models');
module.exports = (req, res, next) => {
const { username, email } = req.body;
logger.info('Checking for existence of user: ', username);
/**
* Check whether a user exists in either User model or PendingUser model.
* The order of the parameters is important.
*
* @method runPromises
* @param {Array} promises Array of [findByUsername, findByEmail] promises.
* The order is important.
* @return {Promise} true|false depending on whether a user was found in
* either model.
*/
const runPromises = promises => Promise.all(promises)
.then(resolved => {
const [fromUsername, fromEmail] = resolved;
if (fromUsername) {
logger.info('User %s exists (unverified).', username);
req.usernameField = 'username';
req.user = fromUsername;
return Promise.resolve(true);
} else if (fromEmail) {
logger.info('User %s exists (unverified).', email);
req.usernameField = 'email';
req.user = fromEmail;
return Promise.resolve(true);
}
return Promise.resolve(false);
});
return runPromises([
PendingUser.findByUsername(username),
PendingUser.findByEmail(email)
]).then(exists => {
if (exists) {
return next();
}
return runPromises([
User.findByUsername(username),
User.findByEmail(email)
]).then(exists => { // eslint-disable-line no-shadow
if (exists) {
return next();
}
logger.warn('User %s does not exist. Moving on...', username);
return next();
});
});
};
|
Fix bug with who we were checking if a user exists
|
Fix bug with who we were checking if a user exists
|
JavaScript
|
mit
|
Waiyaki/provisioning-scheduler,Waiyaki/provisioning-scheduler,Waiyaki/provisioning-scheduler
|
ff777c17169fc950a8bf4af026aada5df206716d
|
src/index.js
|
src/index.js
|
import React from 'react';
import ReactDOM from 'react-dom';
/**
* @param {ReactClass} Target The component that defines `onOutsideEvent` handler.
* @param {String[]} supportedEvents A list of valid DOM event names. Default: ['mousedown'].
* @return {ReactClass}
*/
export default (Target, supportedEvents = ['mousedown']) => {
return class ReactOutsideEvent extends React.Component {
componentDidMount = () => {
if (!this.refs.target.onOutsideEvent) {
throw new Error('Component does not define "onOutsideEvent" method.');
}
supportedEvents.forEach((eventName) => {
window.addEventListener(eventName, this.handleEvent, false);
});
};
componentWillUnmount = () => {
supportedEvents.forEach((eventName) => {
window.removeEventListener(eventName, this.handleEvent, false);
});
};
handleEvent = (event) => {
let isInside,
isOutside,
target,
targetElement;
target = this.refs.target;
targetElement = ReactDOM.findDOMNode(target);
if (targetElement != undefined && !targetElement.contains(event.target)) {
target.onOutsideEvent(event);
}
};
render() {
return <Target ref='target' {... this.props} />;
}
};
};
|
import React from 'react';
import ReactDOM from 'react-dom';
/**
* @param {ReactClass} Target The component that defines `onOutsideEvent` handler.
* @param {String[]} supportedEvents A list of valid DOM event names. Default: ['mousedown'].
* @return {ReactClass}
*/
export default (Target, supportedEvents = ['mousedown']) => {
return class ReactOutsideEvent extends React.Component {
componentDidMount() {
if (!this.refs.target.onOutsideEvent) {
throw new Error('Component does not define "onOutsideEvent" method.');
}
supportedEvents.forEach((eventName) => {
window.addEventListener(eventName, this.handleEvent, false);
});
}
componentWillUnmount() {
supportedEvents.forEach((eventName) => {
window.removeEventListener(eventName, this.handleEvent, false);
});
}
handleEvent = (event) => {
let isInside,
isOutside,
target,
targetElement;
target = this.refs.target;
targetElement = ReactDOM.findDOMNode(target);
if (targetElement != undefined && !targetElement.contains(event.target)) {
target.onOutsideEvent(event);
}
};
render() {
return <Target ref='target' {... this.props} />;
}
};
};
|
Put React lifecycle hooks on the prototype
|
Put React lifecycle hooks on the prototype
|
JavaScript
|
bsd-3-clause
|
gajus/react-outside-event,gajus/react-outside-event
|
b97996be23de374f0e47b42c0518c05f6250cf41
|
scripts/minify.js
|
scripts/minify.js
|
var minify = require('html-minifier');
var fs = require('fs');
var html = fs.readFileSync('build/frontend.vulcan.html').toString();
var minifiedHtml = minify.minify(html, {
customAttrAssign: [/\$=/],
"removeComments": true,
"removeCommentsFromCDATA": true,
"removeCDATASectionsFromCDATA": true,
"collapseWhitespace": true,
"collapseBooleanAttributes": true,
"removeScriptTypeAttributes": true,
"removeStyleLinkTypeAttributes": true,
"minifyJS": true,
});
fs.writeFileSync('build/frontend.html', minifiedHtml);
|
var minify = require('html-minifier');
var fs = require('fs');
var html = fs.readFileSync('build/frontend.vulcan.html').toString();
var minifiedHtml = minify.minify(html, {
customAttrAssign: [/\$=/],
"removeComments": true,
"removeCommentsFromCDATA": true,
"removeCDATASectionsFromCDATA": true,
"collapseWhitespace": true,
"removeScriptTypeAttributes": true,
"removeStyleLinkTypeAttributes": true,
"minifyJS": true,
});
fs.writeFileSync('build/frontend.html', minifiedHtml);
|
Disable a minifier option that broke stuff
|
Disable a minifier option that broke stuff
|
JavaScript
|
apache-2.0
|
sdague/home-assistant-polymer,sdague/home-assistant-polymer
|
f57d340b0c484175c7c10fb7478377fa2f69a58f
|
core/app/assets/javascripts/backbone/views/fact_relation_view.js
|
core/app/assets/javascripts/backbone/views/fact_relation_view.js
|
window.FactRelationView = Backbone.View.extend({
tagName: "li",
className: "fact-relation",
events: {
"click .relation-actions>.weakening": "disbelieveFactRelation",
"click .relation-actions>.supporting": "believeFactRelation"
},
initialize: function() {
this.useTemplate('fact_relations','fact_relation');
this.model.bind('destroy', this.remove, this);
this.model.bind('change', this.render, this);
},
remove: function() {
$(this.el).fadeOut('fast', function() {
$(this.el).remove();
});
},
render: function() {
$(this.el).html(Mustache.to_html(this.tmpl, this.model.toJSON(), this.partials)).factlink();
return this;
},
disbelieveFactRelation: function() {
this.model.disbelieve();
},
believeFactRelation: function() {
this.model.believe();
},
highlight: function() {
// TODO: Joel, could you specify some highlighting here? <3 <3
// Tried to do it, but don't know on which element I should set the
// styles :( <3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3
}
});
|
window.FactRelationView = Backbone.View.extend({
tagName: "li",
className: "fact-relation",
events: {
"click .relation-actions>.weakening": "disbelieveFactRelation",
"click .relation-actions>.supporting": "believeFactRelation"
},
initialize: function() {
this.useTemplate('fact_relations','fact_relation');
this.model.bind('destroy', this.remove, this);
this.model.bind('change', this.render, this);
},
remove: function() {
$(this.el).fadeOut('fast', function() {
$(this.el).remove();
});
},
render: function() {
$(this.el).html(Mustache.to_html(this.tmpl, this.model.toJSON(), this.partials)).factlink();
return this;
},
disbelieveFactRelation: function() {
this.model.disbelieve();
},
believeFactRelation: function() {
this.model.believe();
},
highlight: function() {
// TODO: Joel, could you specify some highlighting here? <3 <3
// Tried to do it, but don't know on which element I should set the
// styles :( <3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3
// Color fade out in JS required a jQuery plugin? Only giving new background color now.
$(this.el).addClass('highlighted');
}
});
|
Set highlighted background color on the newly added evidence
|
Set highlighted background color on the newly added evidence
|
JavaScript
|
mit
|
Factlink/factlink-core,daukantas/factlink-core,daukantas/factlink-core,Factlink/factlink-core,Factlink/factlink-core,Factlink/factlink-core,daukantas/factlink-core,daukantas/factlink-core
|
ae19ea22af4c7dd62768c23e128ef5dbb2729c61
|
52-in-52.js
|
52-in-52.js
|
var app = require('express').createServer();
var sys = require('sys');
var client = require("./lib/redis-client").createClient();
var books = require("./books");
app.listen(8124);
app.get('/', function(req, res){
res.send('hello world');
});
// List All Users
app.get('/users', function(req, res){
var userlist = "<h1>User List</h1><br />"
users.listUsers(
client,
function(name) {userlist+=String(name+"<br />")},
function() {res.send(userlist)}
);
});
// List All Books
app.get('/books', function(req, res){
var booklist = "<h1>Book List</h1><br />"
books.listBooks(client,
function(title) {booklist+=String(title+"<br />")},
function() {res.send(booklist)}
);
});
|
var app = require('express').createServer();
var sys = require('sys');
var books = require("./books");
var users = require("./users");
var client = require("./lib/redis-client").createClient();
app.listen(8124);
app.get('/', function(req, res){
res.send('hello world');
});
// List All Users
app.get('/users', function(req, res){
var userlist = "<h1>User List</h1><br />"
users.listUsers(
client,
function(name) {userlist+=String(name+"<br />")},
function() {res.send(userlist)}
);
});
// List All Books
app.get('/books', function(req, res){
var booklist = "<h1>Book List</h1><br />"
books.listBooks(client,
function(title) {booklist+=String(title+"<br />")},
function() {res.send(booklist)}
);
});
|
Add Users library to main script.
|
Add Users library to main script.
|
JavaScript
|
bsd-3-clause
|
scsibug/read52,scsibug/read52
|
cf53357bf83b477cf577b2bc500952bda5f2a313
|
config/ember-try.js
|
config/ember-try.js
|
module.exports = {
scenarios: [
{
name: 'default',
dependencies: { }
},
{
name: 'ember-release',
dependencies: {
'ember': 'components/ember#release'
},
resolutions: {
'ember': 'release'
}
},
{
name: 'ember-beta',
dependencies: {
'ember': 'components/ember#beta'
},
resolutions: {
'ember': 'beta'
}
},
{
name: 'ember-canary',
dependencies: {
'ember': 'components/ember#canary'
},
resolutions: {
'ember': 'canary'
}
}
]
};
|
module.exports = {
scenarios: [
{
name: 'default',
dependencies: { }
},
{
name: 'ember-release',
dependencies: {
'ember': 'components/ember#release',
'ember-data': 'components/ember-data#canary'
},
resolutions: {
'ember': 'release',
'ember-data': 'canary'
}
},
{
name: 'ember-beta',
dependencies: {
'ember': 'components/ember#beta',
'ember-data': 'components/ember-data#canary'
},
resolutions: {
'ember': 'beta',
'ember-data': 'canary'
}
},
{
name: 'ember-canary',
dependencies: {
'ember': 'components/ember#canary',
'ember-data': 'components/ember-data#canary'
},
resolutions: {
'ember': 'canary',
'ember-data': 'canary'
}
}
]
};
|
Set ember-data versions in ember try config to canary to make tests pass for each scenario
|
Set ember-data versions in ember try config to canary to make tests pass for each scenario
|
JavaScript
|
mit
|
RSSchermer/ember-rl-dropdown,RSSchermer/ember-rl-dropdown
|
9296e97e12acffef1ce166affe1a1fedc3511a32
|
src/utils.js
|
src/utils.js
|
/**
* SQLite client library for Node.js applications
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/
function prepareParams(args, { offset = 0, excludeLastArg = false } = {}) {
const hasOneParam = (args.length === (offset + 1 + (excludeLastArg ? 1 : 0)));
if (hasOneParam && typeof args[offset] === 'object') {
return args[offset];
}
return Array.prototype.slice.call(args, offset, args.length - (excludeLastArg ? 1 : 0));
}
export default prepareParams;
|
/**
* SQLite client library for Node.js applications
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/
function prepareParams(args, { offset = 0, excludeLastArg = false } = {}) {
const hasOneParam = (args.length === (offset + 1 + (excludeLastArg ? 1 : 0)));
if (hasOneParam) {
return args[offset];
}
return Array.prototype.slice.call(args, offset, args.length - (excludeLastArg ? 1 : 0));
}
export default prepareParams;
|
Remove the typeof check in prepareParams()
|
Remove the typeof check in prepareParams()
It is unnecessary because node-sqlite3 supports passing a single
parameter directly in the arguments:
"There are three ways of passing bind parameters: directly in the
function's arguments, as an array, and as an object for named
parameters."
https://github.com/mapbox/node-sqlite3/wiki/API#databaserunsql-param--callback
|
JavaScript
|
mit
|
kriasoft/node-sqlite,kriasoft/node-sqlite,kriasoft/node-sqlite,lguzzon/node-sqlite
|
f49c2effcc8f857ec20b2b3666a2d697319f33d4
|
main.js
|
main.js
|
const net = require('net')
const readline = require('readline')
const { app, BrowserWindow } = require('electron')
app.commandLine.appendSwitch('--disable-http-cache')
require('electron-reload')(
`${__dirname}/renderer`,
{ electron: `${__dirname}/node_modules/.bin/electron` }
)
const Options = require('./cli/options')
const options = new Options(process.argv)
let win
let server
app.on('ready', () => {
win = new BrowserWindow({ height: 800, width: 900 })
const indexPath = `file://${__dirname}/renderer/index.html`
win.loadURL(indexPath)
win.on('closed', () => { win = null })
win.webContents.on('did-finish-load', () => {
if (server) return
server = net.createServer((socket) => {
const socketSession = readline.createInterface({ input: socket })
socketSession.on('line', (line) => {
const message = JSON.parse(line)
if (options.debug) console.log(JSON.stringify(message, null, 2))
win.webContents.send(message['type'], message)
})
socketSession.on('close', () => win.webContents.send('end'))
})
server.listen(options.port || 0, () => {
console.log('Cucumber GUI listening for events on port ' + server.address().port)
})
})
})
|
const net = require('net')
const readline = require('readline')
const { app, BrowserWindow } = require('electron')
app.commandLine.appendSwitch('--disable-http-cache')
require('electron-reload')(
`${__dirname}/renderer`,
{ electron: `${__dirname}/node_modules/.bin/electron` }
)
const Options = require('./cli/options')
const options = new Options(process.argv)
let server
app.on('ready', () => {
if (server) return
server = net.createServer((socket) => {
let win = new BrowserWindow({ height: 800, width: 900 })
const indexPath = `file://${__dirname}/renderer/index.html`
win.loadURL(indexPath)
win.on('closed', () => { win = null })
win.webContents.on('did-finish-load', () => {
const socketSession = readline.createInterface({ input: socket })
socketSession.on('line', (line) => {
const message = JSON.parse(line)
if (options.debug) console.log(JSON.stringify(message, null, 2))
win.webContents.send(message['type'], message)
})
socketSession.on('close', () => win.webContents.send('end'))
})
})
server.listen(options.port || 0, () => {
console.log('Cucumber GUI listening for events on port ' + server.address().port)
})
})
|
Support multiple concurrent test sessions
|
Support multiple concurrent test sessions
|
JavaScript
|
mit
|
mattwynne/cucumber-gui-spike,mattwynne/cucumber-gui-spike
|
dc01d723c8e1f6bb156f206c36b6aae65a8bfcfb
|
main.js
|
main.js
|
require('./src/app/global');
var app = require('app');
var BrowserWindow = require('browser-window');
var winston = require("winston");
var Proxtop = require('./src/app/proxtop');
var utils = require('./src/app/utils');
utils.createDirIfNotExists(APP_DIR);
var settings = require('./src/app/settings');
var proxApp = new Proxtop();
var mainWindow = null;
var appData = {
name: APP_NAME,
getWindow: function() { return mainWindow; },
proxtop: proxApp
};
app.on('window-all-closed', function() {
if(process.platform != 'darwin') {
proxApp.finish()
app.quit();
}
});
app.on('ready', function() {
proxApp.init().then(createWindow);
});
function createWindow() {
LOG.verbose('Opening new window');
mainWindow = new BrowserWindow({
width: 800,
height: 600,
'auto-hide-menu-bar': true
});
mainWindow.loadUrl('file://' + INDEX_LOCATION);
mainWindow.on('closed', function() {
mainWindow = null;
});
}
module.exports = appData;
|
require('./src/app/global');
var app = require('app');
var BrowserWindow = require('browser-window');
var winston = require("winston");
var utils = require('./src/app/utils');
utils.createDirIfNotExists(APP_DIR);
var Proxtop = require('./src/app/proxtop');
var settings = require('./src/app/settings');
var proxApp = new Proxtop();
var mainWindow = null;
var appData = {
name: APP_NAME,
getWindow: function() { return mainWindow; },
proxtop: proxApp
};
app.on('window-all-closed', function() {
if(process.platform != 'darwin') {
proxApp.finish();
app.quit();
}
});
app.on('ready', function() {
proxApp.init().then(createWindow);
});
function createWindow() {
LOG.verbose('Opening new window');
mainWindow = new BrowserWindow({
width: 800,
height: 600,
'auto-hide-menu-bar': true
});
mainWindow.loadUrl('file://' + INDEX_LOCATION);
mainWindow.on('closed', function() {
mainWindow = null;
});
}
module.exports = appData;
|
Create app dir before initializing internals.
|
Create app dir before initializing internals.
|
JavaScript
|
mit
|
kumpelblase2/proxtop,kumpelblase2/proxtop,kumpelblase2/proxtop,kumpelblase2/proxtop
|
cf13d0003b4da44f51686619df68ab126af05e91
|
node_modules/time-uuid/node_modules/microtime-x/lib/microtime.js
|
node_modules/time-uuid/node_modules/microtime-x/lib/microtime.js
|
'use strict';
var isCallable = require('es5-ext/lib/Object/is-callable')
, name, now, round, dateNow;
if ((typeof performance !== 'undefined') && performance) {
if (isCallable(performance.now)) {
name = 'now';
} else if (isCallable(performance.mozNow)) {
name = 'mozNow';
} else if (isCallable(performance.msNow)) {
name = 'msNow';
} else if (isCallable(performance.oNow)) {
name = 'oNow';
} else if (isCallable(performance.webkitNow)) {
name = 'webkitNow';
}
if (name) {
round = Math.round;
dateNow = Date.now;
now = function () {
return round((now() + performance[name]() % 1) * 1000);
};
}
}
if (!now && (typeof process !== 'undefined') && process &&
(process.title === 'node')) {
try { now = (require)('microtime').now; } catch (e) {}
}
if (!now) {
dateNow = Date.now;
now = function () { return dateNow() * 1000; };
}
module.exports = now;
|
'use strict';
var isCallable = require('es5-ext/lib/Object/is-callable')
, name, now, round, dateNow;
if ((typeof performance !== 'undefined') && performance) {
if (isCallable(performance.now)) {
name = 'now';
} else if (isCallable(performance.mozNow)) {
name = 'mozNow';
} else if (isCallable(performance.msNow)) {
name = 'msNow';
} else if (isCallable(performance.oNow)) {
name = 'oNow';
} else if (isCallable(performance.webkitNow)) {
name = 'webkitNow';
}
if (name) {
round = Math.round;
dateNow = Date.now;
now = function () {
return round((dateNow() + performance[name]() % 1) * 1000);
};
}
}
if (!now && (typeof process !== 'undefined') && process &&
(process.title === 'node')) {
try { now = (require)('microtime').now; } catch (e) {}
}
if (!now) {
dateNow = Date.now;
now = function () { return dateNow() * 1000; };
}
module.exports = now;
|
Fix var reference (caused infinite loop)
|
Fix var reference (caused infinite loop)
|
JavaScript
|
mit
|
medikoo/dbjs
|
1d73157c2c99ebadb50e42f2742df9ec035ef1a7
|
test/cli.js
|
test/cli.js
|
import test from 'blue-tape';
import request from 'superagent';
import mocker from 'superagent-mocker';
import cli from '../src/cli';
import mockProcess from './process';
const mock = mocker(request);
test('should post the input and succeed', assert => {
assert.timeoutAfter(5000); // 5 seconds
const processMocker = mockProcess({
input: {
dependencies: [],
},
env: {
TRAVIS: 'true',
TRAVIS_REPO_SLUG: 'tester/project',
TRAVIS_BRANCH: 'test',
TRAVIS_PULL_REQUEST: 'false',
DEPCHECK_TOKEN: 'project-token',
},
});
mock.post('https://depcheck.tk/github/tester/project', () => null);
return cli(processMocker)
.then(() => assert.equal(processMocker.exit.value, 0))
.then(() => assert.equal(processMocker.stdout.value, 'Post web report succeed.'))
.then(() => assert.equal(processMocker.stderr.value, ''))
.catch(error => assert.fail(error))
.then(() => mock.clearRoutes());
});
|
import test from 'blue-tape';
import request from 'superagent';
import mocker from 'superagent-mocker';
import cli from '../src/cli';
import mockProcess from './process';
const mock = mocker(request);
const env = {
TRAVIS: 'true',
TRAVIS_REPO_SLUG: 'tester/project',
TRAVIS_BRANCH: 'test',
TRAVIS_PULL_REQUEST: 'false',
DEPCHECK_TOKEN: 'project-token',
};
test('should post the input and succeed', assert => {
assert.timeoutAfter(5000); // 5 seconds
const processMocker = mockProcess({ env });
mock.post('https://depcheck.tk/github/tester/project', () => null);
return cli(processMocker)
.then(() => assert.equal(processMocker.exit.value, 0))
.then(() => assert.equal(processMocker.stdout.value, 'Post web report succeed.'))
.then(() => assert.equal(processMocker.stderr.value, ''))
.catch(error => assert.fail(error))
.then(() => mock.clearRoutes());
});
test('should log error and exit with -1 when request failed', assert => {
assert.timeoutAfter(5000); // 5 seconds
const processMocker = mockProcess({ env });
mock.post('https://depcheck.tk/github/tester/project', () => {
throw { // eslint-disable-line no-throw-literal
response: {
body: 'error-body',
},
};
});
return cli(processMocker)
.then(() => assert.equal(processMocker.exit.value, -1))
.then(() => assert.equal(processMocker.stdout.value, ''))
.then(() => assert.equal(processMocker.stderr.value, "'error-body'"))
.catch(error => assert.fail(error))
.then(() => mock.clearRoutes());
});
|
Add test case about request failure.
|
Add test case about request failure.
- Extract the `env` environment variable to a separated object.
|
JavaScript
|
mit
|
depcheck/depcheck-web
|
ae7f863f4d809d60f368dc5b555536c9b25db37f
|
json-format.js
|
json-format.js
|
var EOL = '\n';
var compile = require('./utils/json/compiler');
module.exports = function(serializers) {
var f = compile(serializers || {});
return function(record) {
return f(record) + EOL;
};
};
|
var EOL = '\n';
var f = require('./utils/json/index');
module.exports = function createJsonFormat(serializers) {
var s = serializers || {};
return function jsonFormat(record) {
return f(record, s) + EOL;
};
};
|
Use new json format function
|
Use new json format function
|
JavaScript
|
mit
|
btd/huzzah
|
2ee22016312b3fb0ce7e4ce60deb825ed84a19a1
|
src/components/ChipsArray.spec.js
|
src/components/ChipsArray.spec.js
|
// @format
import { shallow, mount } from 'enzyme'
import React from 'react'
import Chip from 'material-ui/Chip'
import { ChipsArray } from './ChipsArray'
describe('ChipsArray', () => {
it('renders ChipsArray without crash', () => {
const classes = {
chip: {},
row: {},
}
const chipData = [{ label: 'l1', key: 1 }, { label: 'l2', key: 2 }]
const wrapper = mount(<ChipsArray classes={classes} chipData={chipData} />)
expect(wrapper.find(Chip)).toHaveLength(2)
})
it('handles onRequest Delete', () => {
const classes = {
chip: {},
row: {},
}
const chipData = [{ label: 'l1', key: 1 }, { label: 'l2', key: 2 }]
const handleRequestDelete = jest.fn()
const wrapper = mount(
<ChipsArray
classes={classes}
chipData={chipData}
handleRequestDelete={handleRequestDelete}
/>
)
expect(wrapper.find(Chip)).toHaveLength(2)
wrapper
.find('pure(Cancel)')
.first()
.simulate('click')
expect(handleRequestDelete).toHaveBeenCalledWith(chipData[0])
})
})
|
// @format
import { shallow, mount } from 'enzyme'
import React from 'react'
import Chip from 'material-ui/Chip'
import { ChipsArray } from './ChipsArray'
describe('ChipsArray', () => {
it('renders ChipsArray without crash', () => {
const classes = {
chip: {},
row: {},
}
const chipData = [{ usename: 'user1', id: 1 }, { username: 'user2', id: 2 }]
const wrapper = mount(<ChipsArray classes={classes} chipData={chipData} />)
expect(wrapper.find(Chip)).toHaveLength(2)
})
it('handles onRequest Delete', () => {
const classes = {
chip: {},
row: {},
}
const chipData = [{ usename: 'user1', id: 1 }, { username: 'user2', id: 2 }]
const handleRequestDelete = jest.fn()
const wrapper = mount(
<ChipsArray
classes={classes}
chipData={chipData}
handleRequestDelete={handleRequestDelete}
/>
)
expect(wrapper.find(Chip)).toHaveLength(2)
wrapper
.find('pure(Cancel)')
.first()
.simulate('click')
expect(handleRequestDelete).toHaveBeenCalledWith(chipData[0])
})
})
|
Fix incorrect props to ChipsArray during test
|
Fix incorrect props to ChipsArray during test
|
JavaScript
|
mit
|
shirasudon/chat,shirasudon/chat
|
535c7bc47ea61a9aaf5f2d4c2fd577136c551005
|
src/components/style-sheet.js
|
src/components/style-sheet.js
|
/* @flow */
import React, {Component} from 'react';
import StyleKeeper from '../style-keeper';
export default class StyleSheet extends Component {
static contextTypes = {
_radiumStyleKeeper: React.PropTypes.instanceOf(StyleKeeper)
};
constructor() {
super(...arguments);
this.state = this._getCSSState();
this._onChange = this._onChange.bind(this);
}
componentDidMount() {
this._subscription = this.context._radiumStyleKeeper.subscribe(
this._onChange
);
this._onChange();
}
componentWillUnmount() {
this._isMounted = true;
if (this._subscription) {
this._subscription.remove();
}
}
componentWillUnmount() {
this._isMounted = false;
}
_getCSSState(): {css: string} {
return {css: this.context._radiumStyleKeeper.getCSS()};
}
_onChange() {
setTimeout(() => {
this._isMounted && this.setState(this._getCSSState());
}, 0);
}
render(): ReactElement {
return (
<style dangerouslySetInnerHTML={{__html: this.state.css}} />
);
}
}
|
/* @flow */
import React, {Component} from 'react';
import StyleKeeper from '../style-keeper';
export default class StyleSheet extends Component {
static contextTypes = {
_radiumStyleKeeper: React.PropTypes.instanceOf(StyleKeeper)
};
constructor() {
super(...arguments);
this.state = this._getCSSState();
this._onChange = this._onChange.bind(this);
}
componentDidMount() {
this._isMounted = true;
this._subscription = this.context._radiumStyleKeeper.subscribe(
this._onChange
);
this._onChange();
}
componentWillUnmount() {
this._isMounted = false;
if (this._subscription) {
this._subscription.remove();
}
}
_getCSSState(): {css: string} {
return {css: this.context._radiumStyleKeeper.getCSS()};
}
_onChange() {
setTimeout(() => {
this._isMounted && this.setState(this._getCSSState());
}, 0);
}
render(): ReactElement {
return (
<style dangerouslySetInnerHTML={{__html: this.state.css}} />
);
}
}
|
Remove duplicate declaration of componentWillUnmount
|
Remove duplicate declaration of componentWillUnmount
Remove duplicate declaration of componentWillUnmount and move `this._isMounted = true` inside componentDidMount
|
JavaScript
|
mit
|
MicheleBertoli/radium,FormidableLabs/radium,nfl/radium
|
19e10aa90241f3b02cd8ace1f5060dc7560eb2bf
|
app/js/resource-controller.js
|
app/js/resource-controller.js
|
'use strict';
(function() {
var app = angular.module('idleTown');
app.controller('ResourceController', ['resourceService', function(resourceService) {
this.resources = resourceService.resources;
}]);
})();
|
'use strict';
(function() {
var app = angular.module('idleTown');
app.controller('ResourceController', ['resourceService', function(resourceService) {
this.resources = resourceService.resources;
this.giveResource = function(resource, amt) {
resourceService.addResource(resourceService.indexMap[resource.name], amt);
}
}]);
})();
|
Add resource giving button for debugging
|
Add resource giving button for debugging
|
JavaScript
|
mit
|
SoggyNoose/IdleTown
|
7592465c9f970e90d174b85796a8379db88236cc
|
test/init.js
|
test/init.js
|
var assert = require("chai").assert;
var Init = require("../lib/init");
var fs = require("fs");
var path = require('path');
describe('init', function() {
var config;
before("Create a sandbox", function(done) {
this.timeout(5000);
Init.sandbox(function(err, result) {
if (err) return done(err);
config = result;
done();
});
});
it('copies example configuration', function(done) {
assert.isTrue(fs.existsSync(path.join(config.working_directory, "app")), "app directory not created successfully");
assert.isTrue(fs.existsSync(path.join(config.working_directory, "contracts")), "contracts directory not created successfully");
assert.isTrue(fs.existsSync(path.join(config.working_directory, "test")), "tests directory not created successfully");
done();
});
});
|
var assert = require("chai").assert;
var Init = require("../lib/init");
var fs = require("fs");
var path = require('path');
describe('init', function() {
var config;
before("Create a sandbox", function(done) {
this.timeout(5000);
Init.sandbox(function(err, result) {
if (err) return done(err);
config = result;
done();
});
});
it('copies example configuration', function(done) {
assert.isTrue(fs.existsSync(path.join(config.working_directory, "contracts")), "contracts directory not created successfully");
assert.isTrue(fs.existsSync(path.join(config.working_directory, "test")), "tests directory not created successfully");
done();
});
});
|
Remove test that checks for an application directory.
|
Remove test that checks for an application directory.
|
JavaScript
|
mit
|
DigixGlobal/truffle,prashantpawar/truffle
|
6562ee96a48f49d80f4b66ade10b6b17c982f8c7
|
test/psbt.js
|
test/psbt.js
|
const { describe, it, beforeEach } = require('mocha')
const assert = require('assert')
const ECPair = require('../src/ecpair')
const Psbt = require('..').Psbt
const fixtures = require('./fixtures/psbt')
describe(`Psbt`, () => {
// constants
const keyPair = ECPair.fromPrivateKey(Buffer.from('0000000000000000000000000000000000000000000000000000000000000001', 'hex'))
describe('signInput', () => {
fixtures.signInput.checks.forEach(f => {
it(f.description, () => {
const psbtThatShouldsign = Psbt.fromBase64(f.shouldSign.psbt)
assert.doesNotThrow(() => {
psbtThatShouldsign.signInput(f.shouldSign.inputToCheck, keyPair)
})
const psbtThatShouldThrow = Psbt.fromBase64(f.shouldThrow.psbt)
assert.throws(() => {
psbtThatShouldThrow.signInput(f.shouldThrow.inputToCheck, keyPair)
}, {message: f.shouldThrow.errorMessage})
})
})
})
})
|
const { describe, it } = require('mocha')
const assert = require('assert')
const ECPair = require('../src/ecpair')
const Psbt = require('..').Psbt
const fixtures = require('./fixtures/psbt')
describe(`Psbt`, () => {
// constants
const keyPair = ECPair.fromPrivateKey(Buffer.from('0000000000000000000000000000000000000000000000000000000000000001', 'hex'))
describe('signInput', () => {
fixtures.signInput.checks.forEach(f => {
it(f.description, () => {
const psbtThatShouldsign = Psbt.fromBase64(f.shouldSign.psbt)
assert.doesNotThrow(() => {
psbtThatShouldsign.signInput(f.shouldSign.inputToCheck, keyPair)
})
const psbtThatShouldThrow = Psbt.fromBase64(f.shouldThrow.psbt)
assert.throws(() => {
psbtThatShouldThrow.signInput(f.shouldThrow.inputToCheck, keyPair)
}, {message: f.shouldThrow.errorMessage})
})
})
})
})
|
Remove redundant import from test
|
Remove redundant import from test
|
JavaScript
|
mit
|
bitcoinjs/bitcoinjs-lib,BitGo/bitcoinjs-lib,visvirial/bitcoinjs-lib,bitcoinjs/bitcoinjs-lib,visvirial/bitcoinjs-lib,BitGo/bitcoinjs-lib,junderw/bitcoinjs-lib,junderw/bitcoinjs-lib
|
a1d44c8f42825ccc39c05ed56825e3197e7b889d
|
client/templates/bets/create.js
|
client/templates/bets/create.js
|
var createBetNotification = function(bet){
var bet = Bets.findOne({ _id: bet });
BetNotifications.insert({
toNotify: bet.bettors[1],
betBy: bet.bettors[0]
});
}
Template.createBetForm.events({
"submit .create-bet": function(event) {
var status = "open",
title = event.target.betTitle.value;
wager = event.target.betWager.value;
user = Meteor.user(),
defender_requested = event.target.defender.value;
defender = Meteor.users.findOne({ username: defender_requested });
var bet = Bets.insert({
bettors: [ user.username, defender.username ],
status: status,
title: title,
wager: wager
});
createBetNotification(bet);
}
});
|
var createBetNotification = function(bet){
var bet = Bets.findOne({ _id: bet });
BetNotifications.insert({
toNotify: bet.bettors[1],
betBy: bet.bettors[0]
});
}
Template.createBetForm.events({
"submit .create-bet" : function(event){
var status = "open",
title = event.target.betTitle.value;
wager = event.target.betWager.value;
user = Meteor.user(),
defender_requested = event.target.defender.value;
defender = Meteor.users.findOne({ username: defender_requested });
var bet = Bets.insert({
bettors: [ user.username, defender.username ],
status: status,
title: title,
wager: wager
});
createBetNotification(bet);
}
});
|
Fix spacing in chat js
|
Fix spacing in chat js
|
JavaScript
|
mit
|
nmmascia/webet,nmmascia/webet
|
7918c31d4ef9a9eac70c606f576f682f78303052
|
test/test.js
|
test/test.js
|
var request = require("request");
var assert = require('assert');
var origin = "http://localhost:3000/"
var http = require('http');
var app = require('../app');
var cheerio = require('cheerio');
var server = http.createServer(app);
server.listen("3000");
describe("App", function() {
describe("GET /", function() {
it("returns status code 200", function(done) {
var links = getLinks(origin);
server.close();
});
});
});
function getLinks(page) {
request.get(page, function (err, res, body) {
if (err) throw err;
$ = cheerio.load(body);
var links = $('nav a');
var urls = [page];
for (var i = 0; i < links.length; i++) {
urls.push(page + $(links[i]).attr('href').substr(1));
}
return urls;
});
}
|
var request = require("request");
var assert = require('assert');
var origin = "http://localhost:3000/"
var http = require('http');
var app = require('../app');
var cheerio = require('cheerio');
var server = http.createServer(app);
server.listen("3000");
describe("App", function() {
describe("GET /", function() {
it("returns status code 200", function(done) {
request.get(origin, function(err, res) {
assert.equal(200, res.statusCode);
server.close();
done();
});
});
});
});
|
Revert "Added methods to get links"
|
Revert "Added methods to get links"
This reverts commit b38f74d23e23a1d1301a803e83ed0e6f442de558.
|
JavaScript
|
bsd-3-clause
|
aXises/portfolio-2,aXises/portfolio-2,aXises/portfolio-2
|
4e226f2ca91b750d9bd4004cf9d534f7ec98f52b
|
test/supported-features.spec.js
|
test/supported-features.spec.js
|
'use strict';
var chai = require('chai');
var assert = chai.assert;
var caniuse = require('../lib/api.js');
describe('Supported Features', function () {
it('window.atob',
function (done) {
var opts = {
files: __dirname + '/fixtures/window/atob.js',
browsers: {
InternetExplorer: '>= 6'
}
};
caniuse(opts)
.then(function (badTokens) {
assert(badTokens.length === 1);
var badFile = badTokens[0];
assert(badFile.filename === __dirname + '/fixtures/window/atob.js');
assert(badFile.unsupportedTokens.length === 1);
assert(badFile.unsupportedTokens[0].token === 'atob');
done();
})
});
});
|
'use strict';
var chai = require('chai');
var assert = chai.assert;
var caniuse = require('../lib/api.js');
describe('Supported Features', function () {
it('window.atob', function (done) {
var opts = {
files: __dirname + '/fixtures/window/atob.js',
browsers: {
InternetExplorer: '>= 6'
}
};
caniuse(opts)
.then(function (badTokens) {
assert(badTokens.length === 1);
var badFile = badTokens[0];
assert(badFile.filename === __dirname + '/fixtures/window/atob.js');
assert(badFile.unsupportedTokens.length === 1);
assert(badFile.unsupportedTokens[0].token === 'atob');
done();
});
});
it('window.btoa', function (done) {
var opts = {
files: __dirname + '/fixtures/window/btoa.js',
browsers: {
InternetExplorer: '>= 6'
}
};
caniuse(opts)
.then(function (badTokens) {
assert(badTokens.length === 1);
var badFile = badTokens[0];
assert(badFile.filename === __dirname + '/fixtures/window/btoa.js');
assert(badFile.unsupportedTokens.length === 1);
assert(badFile.unsupportedTokens[0].token === 'btoa');
done();
});
});
});
|
Add official support for btoa
|
Add official support for btoa
|
JavaScript
|
mit
|
caniuse-js/caniuse-js
|
d0cd967c82abe60b8a8882e951cb3768fa7e7529
|
src/shared/common/alias.js
|
src/shared/common/alias.js
|
'use strict';
var affix = require('./affix');
/**
* Creates an alias for the chapter.
* @param {!{title: ?string}} series
* @param {!{number: number, volume: number}} chapter
* @param {string=} extension
* @return {?string}
*/
module.exports = function (series, chapter, extension) {
var name = invalidate(series.title);
if (!name) return undefined;
var number = '#' + affix(stripSuffix(chapter.number.toFixed(4)), 3);
var prefix = name + '/' + name + ' ';
var suffix = number + '.' + (extension || 'cbz');
if (isNaN(chapter.volume)) return prefix + suffix;
return prefix + 'V' + affix(String(chapter.volume), 2) + ' ' + suffix;
};
/**
* Invalidates the value.
* @param {string} value
* @return {string}
*/
function invalidate(value) {
return value.replace(/["<>\|:\*\?\\\/]/g, '');
}
/**
* Strips a suffix from the zero-padded value.
* @param {string} value
* @return {string}
*/
function stripSuffix(value) {
return value.replace(/\.0+$/g, '');
}
|
'use strict';
var affix = require('./affix');
/**
* Creates an alias for the chapter.
* @param {!{title: ?string}} series
* @param {!{number: number, volume: number}} chapter
* @param {string=} extension
* @return {?string}
*/
module.exports = function (series, chapter, extension) {
var name = invalidate(series.title);
if (!name) return undefined;
var number = '#' + affix(stripSuffix(chapter.number.toFixed(4)), 3);
var prefix = name + '/' + name + ' ';
var suffix = number + '.' + (extension || 'cbz');
if (isNaN(chapter.volume)) return prefix + suffix;
return prefix + 'V' + affix(String(chapter.volume), 2) + ' ' + suffix;
};
/**
* Invalidates the value.
* @param {string} value
* @return {string}
*/
function invalidate(value) {
return value.replace(/["<>\|:\*\?\\\/]/g, '');
}
/**
* Strips a suffix from the zero-padded value.
* @param {string} value
* @return {string}
*/
function stripSuffix(value) {
return value.replace(/0+$/g, '');
}
|
Fix broken suffix on chapters with a dot.
|
Fix broken suffix on chapters with a dot.
|
JavaScript
|
mit
|
kenpeter/mangarack.js,kenpeter/mangarack.js
|
f5d0f140f8042cbaeb9bc4aba515889e07ebc148
|
core/background/scrobblers/librefm.js
|
core/background/scrobblers/librefm.js
|
'use strict';
/**
* Module for all communication with libre.fm
*/
define([
'scrobblers/baseScrobbler'
], function (BaseScrobbler) {
var LibreFM = new BaseScrobbler({
label: 'Libre.FM',
storage: 'LibreFM',
apiUrl: 'https://libre.fm/2.0/',
apiKey: 'test',
apiSecret: 'test',
authUrl: 'http://www.libre.fm/api/auth/'
});
return LibreFM;
});
|
'use strict';
/**
* Module for all communication with libre.fm
*/
define([
'scrobblers/baseScrobbler'
], function (BaseScrobbler) {
var LibreFM = new BaseScrobbler({
label: 'Libre.FM',
storage: 'LibreFM',
apiUrl: 'https://libre.fm/2.0/',
apiKey: 'test',
apiSecret: 'test',
authUrl: 'http://www.libre.fm/api/auth/'
});
LibreFM.doRequest = function (method, params, signed, okCb, errCb) {
var self = this;
params.api_key = this.apiKey;
if (signed) {
params.api_sig = this.generateSign(params);
}
var paramPairs = [];
for (var key in params) {
if (params.hasOwnProperty(key)) {
paramPairs.push(key + '=' + encodeURIComponent(params[key]));
}
}
var url = this.apiUrl + '?' + paramPairs.join('&');
var internalOkCb = function (xmlDoc, status) {
if (self.enableLogging) {
console.info(self.label + ' response to ' + method + ' ' + url + ' : ' + status + '\n' + (new XMLSerializer()).serializeToString(xmlDoc));
}
okCb.apply(this, arguments);
};
var internalErrCb = function (jqXHR, status, response) {
if (self.enableLogging) {
console.error(self.label + ' response to ' + url + ' : ' + status + '\n' + response);
}
errCb.apply(this, arguments);
};
if (method === 'GET') {
$.get(url)
.done(internalOkCb)
.fail(internalErrCb);
} else if (method === 'POST') {
$.post(url, $.param(params))
.done(internalOkCb)
.fail(internalErrCb);
} else {
console.error('Unknown method: ' + method);
}
}.bind(LibreFM);
return LibreFM;
});
|
Fix up libre.fm doRequest due to $.param() encode
|
Fix up libre.fm doRequest due to $.param() encode
|
JavaScript
|
mit
|
carpet-berlin/web-scrobbler,inverse/web-scrobbler,fakelbst/Chrome-Last.fm-Scrobbler,inverse/web-scrobbler,galeksandrp/web-scrobbler,alexesprit/web-scrobbler,david-sabata/web-scrobbler,fakelbst/Chrome-Last.fm-Scrobbler,alexesprit/web-scrobbler,david-sabata/web-scrobbler,galeksandrp/web-scrobbler,Paszt/web-scrobbler,Paszt/web-scrobbler,carpet-berlin/web-scrobbler
|
484630a148beaa475506fdbae87fce2fdf8814f6
|
src/baseStyles.js
|
src/baseStyles.js
|
'use strict';
let styles = {
overlay(isOpen) {
return {
position: 'fixed',
zIndex: 1,
width: '100%',
height: '100%',
background: 'rgba(0, 0, 0, 0.3)',
opacity: isOpen ? 1 : 0,
transform: isOpen ? '' : 'translate3d(-100%, 0, 0)',
transition: isOpen ? 'opacity 0.3s' : 'opacity 0.3s, transform 0s 0.3s'
};
},
menuWrap(isOpen, width, right) {
return {
position: 'fixed',
right: right ? 0 : 'inherit',
zIndex: 2,
width,
height: '100%',
transform: isOpen ? '' : right ? 'translate3d(100%, 0, 0)' : 'translate3d(-100%, 0, 0)',
transition: 'all 0.5s'
};
},
menu() {
return {
height: '100%',
boxSizing: 'border-box',
overflow: 'auto'
};
},
itemList() {
return {
height: '100%'
};
},
item() {
return {
display: 'block',
outline: 'none'
};
}
};
export default styles;
|
'use strict';
let styles = {
overlay(isOpen) {
return {
position: 'fixed',
zIndex: 1,
width: '100%',
height: '100%',
background: 'rgba(0, 0, 0, 0.3)',
opacity: isOpen ? 1 : 0,
transform: isOpen ? '' : 'translate3d(100%, 0, 0)',
transition: isOpen ? 'opacity 0.3s' : 'opacity 0.3s, transform 0s 0.3s'
};
},
menuWrap(isOpen, width, right) {
return {
position: 'fixed',
right: right ? 0 : 'inherit',
zIndex: 2,
width,
height: '100%',
transform: isOpen ? '' : right ? 'translate3d(100%, 0, 0)' : 'translate3d(-100%, 0, 0)',
transition: 'all 0.5s'
};
},
menu() {
return {
height: '100%',
boxSizing: 'border-box',
overflow: 'auto'
};
},
itemList() {
return {
height: '100%'
};
},
item() {
return {
display: 'block',
outline: 'none'
};
}
};
export default styles;
|
Move overlay 100% when offscreen rather than -100%
|
Move overlay 100% when offscreen rather than -100%
|
JavaScript
|
mit
|
negomi/react-burger-menu,negomi/react-burger-menu
|
a5a9e58b418ff5453dc795bf8db14e18cc7872ae
|
src/routes/devices/publish.js
|
src/routes/devices/publish.js
|
import _ from 'lodash'
import spark from 'spark'
const debug = require('debug')('sentry:routes:devices:publish')
const Membership = require('mongoose').model('Membership')
export default async (req, res) => {
const accessToken = req.currentAccount.particleAccessToken
spark.login({ accessToken })
debug('logged into Particle')
const memberships = await Membership.where({}).sort('name')
debug('memberships', memberships)
const csv = memberships.map((m) => {
const token = m.accessToken
const status = 1
const message = 'Hello'
return `${token}\t${status}\t${message}`
})
debug('csv', csv)
const chunks = _.chunk(csv, 10)
debug('chunks', chunks)
// Clear out existing members
await spark.publishEvent('sentry/wipe-members')
// Buffer the list of members so the device doesn't
// crash.
await Promise.all(chunks.map(async (chunk) => {
return await spark.publishEvent('sentry/append-members', chunk.join('\n'))
}))
req.flash('success', `Updating all devices with ${memberships.length} memberships`)
res.redirect('/devices')
}
|
import _ from 'lodash'
import spark from 'spark'
const debug = require('debug')('sentry:routes:devices:publish')
const Membership = require('mongoose').model('Membership')
export default async (req, res) => {
const accessToken = req.currentAccount.particleAccessToken
spark.login({ accessToken })
debug('logged into Particle')
const memberships = await Membership.where({}).sort('name')
debug('memberships', memberships)
const csv = memberships.map((m) => {
const token = m.accessToken
const status = 1
const line1 = ' Welcome in '
const line2 = m.name
return `${token}\t${status}\t${line1}\t${line2}`
})
debug('csv', csv)
const chunks = _.chunk(csv, 10)
debug('chunks', chunks)
// Clear out existing members
await spark.publishEvent('sentry/wipe-members')
// Buffer the list of members so the device doesn't
// crash.
await Promise.all(chunks.map(async (chunk) => {
return await spark.publishEvent('sentry/append-members', chunk.join('\n'))
}))
req.flash('success', `Updating all devices with ${memberships.length} memberships`)
res.redirect('/devices')
}
|
Add second line of message display.
|
Add second line of message display.
|
JavaScript
|
mit
|
danawoodman/sentry,danawoodman/sentry,danawoodman/sentry,danawoodman/sentry
|
f5acccaac3a6269b35a7e7448b42967225538411
|
source/cookies.js
|
source/cookies.js
|
(function(w, d){
var identificator = 'fucking-eu-cookies';
var config = <%= JSON.stringify({
version: pkg.version,
l18n: l18n
}, null, '\t') %>;
function shutdownAlert() {
var message = config.l18n.shutdownNotice + " (" + identificator + " v" + config.version + ")";
if (console) {
console.error(message);
}
throw new Error(message);
}
shutdownAlert();
})(window, window.document);
|
(function(w, d){
var identificator = 'fucking-eu-cookies';
var config = <%= JSON.stringify({
version: pkg.version,
l18n: l18n
}, null, '\t') %>;
function shutdownAlert() {
d[identificator] = true;
var message = config.l18n.shutdownNotice + " (" + identificator + " v" + config.version + ")";
if (console) {
console.error(message);
}
throw new Error(message);
}
shutdownAlert();
})(window, window.document);
|
Mark document to recognize panel
|
Mark document to recognize panel
|
JavaScript
|
mit
|
jakubboucek/fucking-eu-cookies,jakubboucek/fucking-eu-cookies,jakubboucek/fucking-eu-cookies
|
daf4a39b5077e24cf207e30e5fbde13f07a6825b
|
mingle.static/static.bin.js
|
mingle.static/static.bin.js
|
/*
___ usage ___ en_US ___
mingle static [address:port, address:port...]
options:
-b, --bind <address:port> address and port to bind to
--help display help message
___ $ ___ en_US ___
bind is required:
the `--bind` argument is a required argument
___ . ___
*/
require('arguable')(module, require('cadence')(function (async, program) {
var http = require('http')
var Shuttle = require('prolific.shuttle')
var Static = require('./http.js')
var logger = require('prolific.logger').createLogger('mingle.static')
var shuttle = Shuttle.shuttle(program, logger)
program.helpIf(program.ultimate.help)
program.required('bind')
program.validate(require('arguable/bindable'), 'bind')
var bind = program.ultimate.bind
var mingle = new Static(program.argv)
var dispatcher = mingle.dispatcher.createWrappedDispatcher()
var server = http.createServer(dispatcher)
server.listen(bind.port, bind.address, async())
program.on('shutdown', server.close.bind(server))
program.on('shutdown', shuttle.close.bind(shuttle))
}))
|
/*
___ usage ___ en_US ___
mingle static [address:port, address:port...]
options:
-b, --bind <address:port> address and port to bind to
--help display help message
___ $ ___ en_US ___
bind is required:
the `--bind` argument is a required argument
___ . ___
*/
require('arguable')(module, require('cadence')(function (async, program) {
var http = require('http')
var Shuttle = require('prolific.shuttle')
var Static = require('./http.js')
var logger = require('prolific.logger').createLogger('mingle.static')
var shuttle = Shuttle.shuttle(program, logger)
program.helpIf(program.ultimate.help)
program.required('bind')
program.validate(require('arguable/bindable'), 'bind')
var bind = program.ultimate.bind
var mingle = new Static(program.argv)
var dispatcher = mingle.dispatcher.createWrappedDispatcher()
var server = http.createServer(dispatcher)
server.listen(bind.port, bind.address, async())
program.on('shutdown', server.close.bind(server))
program.on('shutdown', shuttle.close.bind(shuttle))
logger.info('started', { parameters: program.ultimate })
}))
|
Add a logging message to indicate start.
|
Add a logging message to indicate start.
|
JavaScript
|
mit
|
bigeasy/mingle
|
cb37d223652f2a58a8c2393eaf5b1cead672031a
|
js/run-three.js
|
js/run-three.js
|
( function() {
var runMaker = new RunMaker();
var fileDropArea = document.getElementById( 'drop_zone' );
fileDropArea.addEventListener( 'drop', dropFile, false );
fileDropArea.addEventListener( 'dragover', cancel, false );
fileDropArea.addEventListener( 'dragenter', cancel, false );
fileDropArea.addEventListener( 'dragexit', cancel, false );
function dropFile( evt ) {
evt.stopPropagation();
evt.preventDefault();
var files = evt.dataTransfer.files;
if( files.length ) {
go( files[ 0 ] );
}
}
function go( file ) {
runMaker.makeRun( file );
fileDropArea.classList.add( 'dropped' );
}
function cancel( evt ) {
evt.preventDefault();
}
} )();
|
( function() {
var runMaker = new RunMaker();
var fileDropArea = document.getElementById( 'drop_zone' );
fileDropArea.addEventListener( 'drop', dropFile, false );
fileDropArea.addEventListener( 'dragover', cancel, false );
fileDropArea.addEventListener( 'dragenter', cancel, false );
fileDropArea.addEventListener( 'dragexit', cancel, false );
function dropFile( evt ) {
evt.stopPropagation();
evt.preventDefault();
var files = evt.dataTransfer.files;
if( files.length ) {
var extension = files[ 0 ].name.split( '.' ).pop().toLowerCase();
if( extension === 'gpx' ) {
go( files[ 0 ] );
} else {
alert( 'GPX file please!' );
}
}
}
function go( file ) {
runMaker.makeRun( file );
fileDropArea.classList.add( 'dropped' );
}
function cancel( evt ) {
evt.preventDefault();
}
} )();
|
Check dropped file is a GPX file
|
Check dropped file is a GPX file
|
JavaScript
|
mit
|
CharlesHouston/run-three,CharlesHouston/run-three
|
8387abb850183b7d95dbaa678a5b9f655f9a770d
|
.eslintrc.js
|
.eslintrc.js
|
module.exports = {
"env": {
"es6": true,
"node": true
},
"extends": "airbnb-base",
"parserOptions": {
"sourceType": "module"
},
"rules": {
"indent": [
"error", 4,
{ "SwitchCase": 1 }
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
],
"no-console": "off",
"linebreak-style": "off",
"max-len": [
"warn", 120, 4,
{ ignoreComments: true }
],
"quote-props": [
"warn",
"consistent-as-needed"
],
"no-cond-assign": [
"off",
"except-parens"
],
"radix": "off",
"space-infix-ops": "off",
"no-unused-vars": [
"warn",
{
"vars": "local",
"args": "none",
"argsIgnorePattern": "next"
}
],
"default-case": "error",
"no-else-return": "off",
"no-param-reassign": "off",
"quotes": "off",
"space-before-function-paren": [
"error",
{
"anonymous": "never",
"named": "never",
"asyncArrow": "ignore"
}
],
eqeqeq: ["error", "smart"]
}
};
|
module.exports = {
"env": {
"es6": true,
"node": true
},
"extends": "airbnb-base",
"parserOptions": {
"sourceType": "module"
},
"rules": {
"indent": [
"error", 2,
{ "SwitchCase": 1 }
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
],
"no-console": "off",
"linebreak-style": "off",
"max-len": [
"warn", 120, 2,
{ ignoreComments: true }
],
"quote-props": [
"warn",
"consistent-as-needed"
],
"no-cond-assign": [
"off",
"except-parens"
],
"radix": "off",
"space-infix-ops": "off",
"no-unused-vars": [
"warn",
{
"vars": "local",
"args": "none",
"argsIgnorePattern": "next"
}
],
"default-case": "error",
"no-else-return": "off",
"no-param-reassign": "off",
"quotes": "off",
"space-before-function-paren": [
"error",
{
"anonymous": "never",
"named": "never",
"asyncArrow": "ignore"
}
],
eqeqeq: ["error", "smart"]
}
};
|
Change eslint indentation style to 2 spaces
|
Change eslint indentation style to 2 spaces
|
JavaScript
|
mit
|
nus-mtp/sashimi-note,nus-mtp/sashimi-note,nus-mtp/sashimi-note
|
96d6f8d8110bc2ea8d32a5e205b705f4933f1e48
|
load_models.js
|
load_models.js
|
// Require this file to load all the models into the
// interactive note console
process.env.NODE_ENV = 'development'
require('coffee-script')
o = require('./models/organization')
b = require('./models/badge')
u = require('./models/user')
module.exports = {
Badge: b,
Organization: o,
User: u
}
|
// Require this file to load all the models into the
// interactive note console
process.env.NODE_ENV = 'development'
require('coffee-script')
global.Organization = require('./models/organization')
global.Badge = require('./models/badge')
global.User = require('./models/user')
|
Add the models to the global namespace when loaded to the shell
|
Add the models to the global namespace when loaded to the shell
|
JavaScript
|
mit
|
EverFi/Sash,EverFi/Sash,EverFi/Sash
|
97b921fd5713537984469fcc36306ddc7633dceb
|
gulp_tasks/vulcanize.babel.js
|
gulp_tasks/vulcanize.babel.js
|
'use strict';
import cache from 'gulp-cached';
import gulp from 'gulp';
import remember from 'gulp-remember';
import size from 'gulp-size';
import vulcanize from 'gulp-vulcanize';
import {config, browserSync} from './_config.babel.js';
let sourceFiles = `${config.path.source.elements}/elements.html`;
sourceFiles = sourceFiles.concat(config.files.source.elements);
gulp.task('vulcanize', () => {
return gulp.src(`${config.path.source.elements}/elements.html`)
.pipe(vulcanize({
stripComments: true,
inlineCss: true,
inlineScripts: true
}))
.pipe(gulp.dest(config.path.destination.elements))
.pipe(size({title: 'vulcanize'}));
});
gulp.task('vulcanize:watch', ['browser-sync'], () => {
let watcher = gulp.watch(sourceFiles, ['vulcanize']);
watcher.on('change', (event) => {
browserSync.reload();
if (event.type === 'deleted') { // if a file is deleted, forget about it
delete cache.caches.vulcanize[event.path];
remember.forget('vulcanize', event.path);
}
});
});
|
'use strict';
import cache from 'gulp-cached';
import debug from 'gulp-debug';
import gulp from 'gulp';
import plumber from 'gulp-plumber';
import remember from 'gulp-remember';
import size from 'gulp-size';
import vulcanize from 'gulp-vulcanize';
import {config, browserSync} from './_config.babel.js';
import reportError from './_report-error.babel.js';
let sourceFiles = [
`${config.path.source.elements}/elements.html`
];
sourceFiles = sourceFiles.concat(config.files.source.elements);
gulp.task('vulcanize', () => {
return gulp.src(`${config.path.source.elements}/elements.html`)
.pipe(plumber({
errorHandler: reportError
}))
.pipe(cache('vulcanize')) // only pass through changed files
.pipe(debug({
title: 'vulcanize:'
}))
.pipe(vulcanize({
stripComments: true,
inlineCss: true,
inlineScripts: true
}))
.pipe(gulp.dest(config.path.destination.elements))
.pipe(remember('vulcanize')) // add back all files to the stream
.pipe(size({title: 'vulcanize'}))
.pipe(plumber.stop())
.on('error', reportError);
});
gulp.task('vulcanize:watch', ['browser-sync'], () => {
let watcher = gulp.watch(sourceFiles, ['vulcanize']);
watcher.on('change', (event) => {
browserSync.reload();
if (event.type === 'deleted') { // if a file is deleted, forget about it
delete cache.caches.vulcanize[event.path];
remember.forget('vulcanize', event.path);
}
});
});
|
Fix Vulcanize task to watch all elements
|
Fix Vulcanize task to watch all elements
|
JavaScript
|
bsd-3-clause
|
cookadlib/www.cookadlib.com,cookadlib/www.cookadlib.com,cookadlib/www.cookadlib.com
|
728c6edc4d2c9b0a3a66a7f4f526ff1332193b6e
|
src/db/dbsetup.js
|
src/db/dbsetup.js
|
import Knex from 'knex';
import dotenv from 'dotenv';
dotenv.config()
const dbs = {
get public() {
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get#smart_self-overwriting_lazy_getters
delete this.public;
return this.public = Knex({
client: 'mysql2',
useNullAsDefault: true,
connection: {
host : process.env.MYSQL_HOST || '127.0.0.1',
user : process.env.MYSQL_USER || '',
password : process.env.MYSQL_PASSWORD || '',
database : process.env.MYSQL_DATABASE || 'testldapi'
},
});
},
get private() {
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get#smart_self-overwriting_lazy_getters
delete this.private;
return this.private = Knex({
client: 'mysql2',
useNullAsDefault: true,
connection: {
host : process.env.MYSQL_HOST || '127.0.0.1',
user : process.env.MYSQL_USER || '',
password : process.env.MYSQL_PASSWORD || '',
database : process.env.MYSQL_DATABASE_PRIVATE || process.env.MYSQL_DATABASE_PVT || (process.env.MYSQL_DATABASE ? `${process.env.MYSQL_DATABASE}pvt` : 'testldapi')
},
});
}
}
export { dbs };
|
import Knex from 'knex';
import dotenv from 'dotenv';
dotenv.config()
const dbs = {
get public() {
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get#smart_self-overwriting_lazy_getters
delete this.public;
return this.public = Knex({
client: 'mysql2',
useNullAsDefault: true,
connection: {
host : process.env.MYSQL_HOST || '127.0.0.1',
user : process.env.MYSQL_USER || '',
password : process.env.MYSQL_PASSWORD || '',
database : process.env.MYSQL_DATABASE || 'testldapi'
},
});
},
get private() {
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get#smart_self-overwriting_lazy_getters
delete this.private;
return this.private = Knex({
client: 'mysql2',
useNullAsDefault: true,
connection: {
host : process.env.MYSQL_HOST || '127.0.0.1',
user : process.env.MYSQL_USER || '',
password : process.env.MYSQL_PASSWORD_PRIVATE || process.env.MYSQL_PASSWORD_PVT || process.env.MYSQL_PASSWORD || '',
database : process.env.MYSQL_DATABASE_PRIVATE || process.env.MYSQL_DATABASE_PVT || (process.env.MYSQL_DATABASE ? `${process.env.MYSQL_DATABASE}pvt` : 'testldapi')
},
});
}
}
export { dbs };
|
Allow different DB password for private instance
|
Allow different DB password for private instance
Now the private instance password can be set with the
MYSQL_PASSWORD_PRIVATE or MYSQL_PASSWORD_PVT environment variables. If
neither of those are set, it defaults to the same password as the public
database (MYSQL_PASSWORD environment variable).
|
JavaScript
|
mit
|
sillsdev/web-languagedepot-api,sillsdev/web-languagedepot-api,sillsdev/web-languagedepot-api,sillsdev/web-languagedepot-api
|
c80f75443ac858462b4fed6c7e5617d1ae0b9826
|
generators/app/index.js
|
generators/app/index.js
|
var generators = require('yeoman-generator');
module.exports = generators.Base.extend({
constructor: function () {
generators.Base.apply(this, arguments);
},
prompting: function () {
var done = this.async();
this.prompt({
type : 'input',
name : 'name',
message : 'Your Rjanko project name',
default : this.appname
}, function (answers) {
this.log(answers.name);
done();
}.bind(this));
},
writing: function () {
var vars = { title: this.appname };
this.copy('.babelrc');
this.copy('nginx.dev.conf');
this.template('package.json', vars);
this.copy('Procfile.dev');
this.copy('webpack.config.client.js');
this.copy('webpack.config.js');
this.copy('webpack.config.server.js');
this.copy('src/client.js');
this.copy('src/client.styl');
this.copy('src/server.js');
},
install: function() {
this.npmInstall();
}
});
|
var generators = require('yeoman-generator');
module.exports = generators.Base.extend({
constructor: function () {
generators.Base.apply(this, arguments);
},
prompting: function () {
var done = this.async();
this.prompt({
type : 'input',
name : 'name',
message : 'Your Rjanko project name',
default : this.appname
}, function (answers) {
this.log(answers.name);
done();
}.bind(this));
},
writing: function () {
var vars = { title: this.appname };
this.copy('.babelrc');
this.copy('nginx.dev.conf');
this.template('package.json', vars);
this.copy('Procfile.dev');
this.copy('webpack.config.client.js');
this.copy('webpack.config.js');
this.copy('webpack.config.server.js');
this.copy('src/client.js');
this.copy('src/models.js');
this.copy('src/modelsDb.js');
this.copy('src/client.styl');
this.copy('src/server.js');
},
install: function() {
this.npmInstall();
}
});
|
Add test models to generator.
|
Add test models to generator.
|
JavaScript
|
mit
|
kompot/generator-rjanko,kompot/generator-rjanko
|
b2d86a3cfcca0d8b0974169fede63ed872b92fde
|
packages/ember-metal/tests/run_loop/run_bind_test.js
|
packages/ember-metal/tests/run_loop/run_bind_test.js
|
import run from 'ember-metal/run_loop';
QUnit.module('system/run_loop/run_bind_test');
test('Ember.run.bind builds a run-loop wrapped callback handler', function() {
expect(3);
var obj = {
value: 0,
increment: function(increment) {
ok(run.currentRunLoop, 'expected a run-loop');
return this.value += increment;
}
};
var proxiedFunction = run.bind(obj, obj.increment, 1);
equal(proxiedFunction(), 1);
equal(obj.value, 1);
});
test('Ember.run.bind keeps the async callback arguments', function() {
var asyncCallback = function(increment, increment2, increment3) {
ok(run.currentRunLoop, 'expected a run-loop');
equal(increment, 1);
equal(increment2, 2);
equal(increment3, 3);
};
var asyncFunction = function(fn) {
fn(2, 3);
};
asyncFunction(run.bind(asyncCallback, asyncCallback, 1));
});
|
import run from 'ember-metal/run_loop';
QUnit.module('system/run_loop/run_bind_test');
test('Ember.run.bind builds a run-loop wrapped callback handler', function() {
expect(3);
var obj = {
value: 0,
increment: function(increment) {
ok(run.currentRunLoop, 'expected a run-loop');
return this.value += increment;
}
};
var proxiedFunction = run.bind(obj, obj.increment, 1);
equal(proxiedFunction(), 1);
equal(obj.value, 1);
});
test('Ember.run.bind keeps the async callback arguments', function() {
expect(4);
var asyncCallback = function(increment, increment2, increment3) {
ok(run.currentRunLoop, 'expected a run-loop');
equal(increment, 1);
equal(increment2, 2);
equal(increment3, 3);
};
var asyncFunction = function(fn) {
fn(2, 3);
};
asyncFunction(run.bind(asyncCallback, asyncCallback, 1));
});
|
Include number of expected assertions
|
Include number of expected assertions
Without specifying the number of expected assertions, the callback might
never be evaluated, and the test might pass, acting as a false positive.
|
JavaScript
|
mit
|
chadhietala/ember.js,mixonic/ember.js,jmurphyau/ember.js,kigsmtua/ember.js,seanjohnson08/ember.js,visualjeff/ember.js,Patsy-issa/ember.js,soulcutter/ember.js,cjc343/ember.js,sly7-7/ember.js,cesarizu/ember.js,njagadeesh/ember.js,practicefusion/ember.js,cowboyd/ember.js,Zagorakiss/ember.js,marcioj/ember.js,toddjordan/ember.js,SaladFork/ember.js,qaiken/ember.js,eliotsykes/ember.js,thejameskyle/ember.js,amk221/ember.js,yuhualingfeng/ember.js,selvagsz/ember.js,xcskier56/ember.js,mmpestorich/ember.js,cyberkoi/ember.js,kennethdavidbuck/ember.js,nvoron23/ember.js,danielgynn/ember.js,Turbo87/ember.js,wecc/ember.js,kiwiupover/ember.js,nightire/ember.js,seanpdoyle/ember.js,practicefusion/ember.js,lsthornt/ember.js,JesseQin/ember.js,asakusuma/ember.js,tofanelli/ember.js,howtolearntocode/ember.js,ThiagoGarciaAlves/ember.js,kiwiupover/ember.js,kublaj/ember.js,ubuntuvim/ember.js,abulrim/ember.js,cyberkoi/ember.js,Krasnyanskiy/ember.js,cibernox/ember.js,miguelcobain/ember.js,miguelcobain/ember.js,jonathanKingston/ember.js,Leooo/ember.js,jayphelps/ember.js,green-arrow/ember.js,johanneswuerbach/ember.js,Trendy/ember.js,udhayam/ember.js,kublaj/ember.js,code0100fun/ember.js,zenefits/ember.js,vitch/ember.js,jaswilli/ember.js,kellyselden/ember.js,danielgynn/ember.js,rodrigo-morais/ember.js,tsing80/ember.js,Kuzirashi/ember.js,sivakumar-kailasam/ember.js,lazybensch/ember.js,greyhwndz/ember.js,johnnyshields/ember.js,selvagsz/ember.js,Krasnyanskiy/ember.js,jcope2013/ember.js,qaiken/ember.js,gfvcastro/ember.js,davidpett/ember.js,cdl/ember.js,cowboyd/ember.js,rot26/ember.js,kigsmtua/ember.js,simudream/ember.js,mike-north/ember.js,rubenrp81/ember.js,Trendy/ember.js,Krasnyanskiy/ember.js,olivierchatry/ember.js,KevinTCoughlin/ember.js,twokul/ember.js,Eric-Guo/ember.js,udhayam/ember.js,blimmer/ember.js,jherdman/ember.js,elwayman02/ember.js,ef4/ember.js,ubuntuvim/ember.js,lsthornt/ember.js,seanpdoyle/ember.js,fpauser/ember.js,howtolearntocode/ember.js,HeroicEric/ember.js,workmanw/ember.js,BrianSipple/ember.js,jonathanKingston/ember.js,Gaurav0/ember.js,wecc/ember.js,trek/ember.js,wycats/ember.js,delftswa2016/ember.js,opichals/ember.js,gdi2290/ember.js,TriumphantAkash/ember.js,loadimpact/ember.js,xcambar/ember.js,johnnyshields/ember.js,anilmaurya/ember.js,abulrim/ember.js,jerel/ember.js,Turbo87/ember.js,GavinJoyce/ember.js,pangratz/ember.js,jonathanKingston/ember.js,abulrim/ember.js,asakusuma/ember.js,SaladFork/ember.js,visualjeff/ember.js,emberjs/ember.js,xtian/ember.js,rfsv/ember.js,adatapost/ember.js,marcioj/ember.js,wecc/ember.js,rot26/ember.js,jbrown/ember.js,xiujunma/ember.js,jherdman/ember.js,xcambar/ember.js,jerel/ember.js,Robdel12/ember.js,jaswilli/ember.js,bantic/ember.js,udhayam/ember.js,okuryu/ember.js,cbou/ember.js,nipunas/ember.js,yonjah/ember.js,xcskier56/ember.js,Trendy/ember.js,ryanlabouve/ember.js,alexdiliberto/ember.js,cdl/ember.js,kmiyashiro/ember.js,intercom/ember.js,szines/ember.js,williamsbdev/ember.js,nickiaconis/ember.js,cgvarela/ember.js,danielgynn/ember.js,Patsy-issa/ember.js,toddjordan/ember.js,knownasilya/ember.js,wycats/ember.js,rfsv/ember.js,qaiken/ember.js,opichals/ember.js,williamsbdev/ember.js,benstoltz/ember.js,bantic/ember.js,pixelhandler/ember.js,rubenrp81/ember.js,ianstarz/ember.js,sandstrom/ember.js,elwayman02/ember.js,toddjordan/ember.js,elwayman02/ember.js,szines/ember.js,trek/ember.js,rodrigo-morais/ember.js,jplwood/ember.js,code0100fun/ember.js,artfuldodger/ember.js,tildeio/ember.js,kellyselden/ember.js,XrXr/ember.js,fxkr/ember.js,jcope2013/ember.js,jish/ember.js,olivierchatry/ember.js,yuhualingfeng/ember.js,yonjah/ember.js,soulcutter/ember.js,davidpett/ember.js,faizaanshamsi/ember.js,cbou/ember.js,NLincoln/ember.js,bmac/ember.js,practicefusion/ember.js,bekzod/ember.js,cdl/ember.js,pixelhandler/ember.js,artfuldodger/ember.js,mitchlloyd/ember.js,MatrixZ/ember.js,amk221/ember.js,kanongil/ember.js,HipsterBrown/ember.js,raytiley/ember.js,practicefusion/ember.js,brzpegasus/ember.js,Serabe/ember.js,tianxiangbing/ember.js,ryanlabouve/ember.js,nipunas/ember.js,KevinTCoughlin/ember.js,jackiewung/ember.js,visualjeff/ember.js,olivierchatry/ember.js,okuryu/ember.js,furkanayhan/ember.js,swarmbox/ember.js,kaeufl/ember.js,opichals/ember.js,adatapost/ember.js,rot26/ember.js,jplwood/ember.js,Gaurav0/ember.js,lazybensch/ember.js,okuryu/ember.js,cowboyd/ember.js,mrjavascript/ember.js,kennethdavidbuck/ember.js,ridixcr/ember.js,mike-north/ember.js,faizaanshamsi/ember.js,csantero/ember.js,acburdine/ember.js,dgeb/ember.js,Patsy-issa/ember.js,skeate/ember.js,johnnyshields/ember.js,Leooo/ember.js,rot26/ember.js,BrianSipple/ember.js,asakusuma/ember.js,lan0/ember.js,Leooo/ember.js,Turbo87/ember.js,kanongil/ember.js,mmpestorich/ember.js,mrjavascript/ember.js,anilmaurya/ember.js,JKGisMe/ember.js,fpauser/ember.js,pangratz/ember.js,xiujunma/ember.js,fpauser/ember.js,duggiefresh/ember.js,kigsmtua/ember.js,nruth/ember.js,anilmaurya/ember.js,bekzod/ember.js,seanjohnson08/ember.js,nruth/ember.js,SaladFork/ember.js,fouzelddin/ember.js,fouzelddin/ember.js,mfeckie/ember.js,szines/ember.js,ianstarz/ember.js,rlugojr/ember.js,karthiick/ember.js,rfsv/ember.js,balinterdi/ember.js,pangratz/ember.js,howmuchcomputer/ember.js,csantero/ember.js,Robdel12/ember.js,cibernox/ember.js,nightire/ember.js,jackiewung/ember.js,runspired/ember.js,sly7-7/ember.js,trentmwillis/ember.js,alexdiliberto/ember.js,blimmer/ember.js,brzpegasus/ember.js,latlontude/ember.js,tianxiangbing/ember.js,GavinJoyce/ember.js,jplwood/ember.js,olivierchatry/ember.js,raytiley/ember.js,tildeio/ember.js,chadhietala/ember.js,greyhwndz/ember.js,cesarizu/ember.js,duggiefresh/ember.js,jackiewung/ember.js,Vassi/ember.js,jmurphyau/ember.js,ianstarz/ember.js,tsing80/ember.js,swarmbox/ember.js,alexdiliberto/ember.js,rubenrp81/ember.js,vitch/ember.js,topaxi/ember.js,runspired/ember.js,GavinJoyce/ember.js,tofanelli/ember.js,kigsmtua/ember.js,EricSchank/ember.js,dgeb/ember.js,marijaselakovic/ember.js,topaxi/ember.js,thejameskyle/ember.js,XrXr/ember.js,kidaa/ember.js,bmac/ember.js,bekzod/ember.js,fxkr/ember.js,jish/ember.js,trentmwillis/ember.js,jish/ember.js,marcioj/ember.js,xcskier56/ember.js,mallikarjunayaddala/ember.js,GavinJoyce/ember.js,tofanelli/ember.js,chadhietala/ember.js,jbrown/ember.js,schreiaj/ember.js,Robdel12/ember.js,Serabe/ember.js,cyjia/ember.js,koriroys/ember.js,JKGisMe/ember.js,mfeckie/ember.js,nickiaconis/ember.js,mitchlloyd/ember.js,tricknotes/ember.js,martndemus/ember.js,cjc343/ember.js,nipunas/ember.js,claimsmall/ember.js,tsing80/ember.js,toddjordan/ember.js,rlugojr/ember.js,jayphelps/ember.js,cgvarela/ember.js,howmuchcomputer/ember.js,cjc343/ember.js,jaswilli/ember.js,ubuntuvim/ember.js,SaladFork/ember.js,elwayman02/ember.js,seanpdoyle/ember.js,raycohen/ember.js,kmiyashiro/ember.js,yonjah/ember.js,johnnyshields/ember.js,raytiley/ember.js,swarmbox/ember.js,thoov/ember.js,Serabe/ember.js,paddyobrien/ember.js,EricSchank/ember.js,gfvcastro/ember.js,tricknotes/ember.js,givanse/ember.js,bekzod/ember.js,sivakumar-kailasam/ember.js,Robdel12/ember.js,jayphelps/ember.js,jerel/ember.js,HipsterBrown/ember.js,VictorChaun/ember.js,paddyobrien/ember.js,femi-saliu/ember.js,simudream/ember.js,Leooo/ember.js,ryanlabouve/ember.js,seanpdoyle/ember.js,JesseQin/ember.js,KevinTCoughlin/ember.js,njagadeesh/ember.js,max-konin/ember.js,lan0/ember.js,xiujunma/ember.js,simudream/ember.js,lsthornt/ember.js,rfsv/ember.js,csantero/ember.js,tricknotes/ember.js,mfeckie/ember.js,tiegz/ember.js,green-arrow/ember.js,thoov/ember.js,kaeufl/ember.js,stefanpenner/ember.js,quaertym/ember.js,williamsbdev/ember.js,adatapost/ember.js,loadimpact/ember.js,Eric-Guo/ember.js,xtian/ember.js,nicklv/ember.js,yaymukund/ember.js,xtian/ember.js,paddyobrien/ember.js,claimsmall/ember.js,kmiyashiro/ember.js,acburdine/ember.js,Gaurav0/ember.js,ridixcr/ember.js,XrXr/ember.js,HipsterBrown/ember.js,femi-saliu/ember.js,jish/ember.js,latlontude/ember.js,intercom/ember.js,rwjblue/ember.js,jamesarosen/ember.js,greyhwndz/ember.js,jmurphyau/ember.js,csantero/ember.js,kidaa/ember.js,nathanhammond/ember.js,balinterdi/ember.js,tianxiangbing/ember.js,Zagorakiss/ember.js,gdi2290/ember.js,Gaurav0/ember.js,givanse/ember.js,seanjohnson08/ember.js,selvagsz/ember.js,workmanw/ember.js,raycohen/ember.js,johanneswuerbach/ember.js,balinterdi/ember.js,dgeb/ember.js,delftswa2016/ember.js,emberjs/ember.js,furkanayhan/ember.js,mallikarjunayaddala/ember.js,seanjohnson08/ember.js,skeate/ember.js,schreiaj/ember.js,tianxiangbing/ember.js,kennethdavidbuck/ember.js,yaymukund/ember.js,sharma1nitish/ember.js,patricksrobertson/ember.js,jcope2013/ember.js,cyjia/ember.js,joeruello/ember.js,antigremlin/ember.js,faizaanshamsi/ember.js,EricSchank/ember.js,Kuzirashi/ember.js,johanneswuerbach/ember.js,miguelcobain/ember.js,Zagorakiss/ember.js,ubuntuvim/ember.js,Eric-Guo/ember.js,nightire/ember.js,nicklv/ember.js,rwjblue/ember.js,delftswa2016/ember.js,chadhietala/ember.js,cibernox/ember.js,femi-saliu/ember.js,ThiagoGarciaAlves/ember.js,lan0/ember.js,kennethdavidbuck/ember.js,nicklv/ember.js,acburdine/ember.js,kublaj/ember.js,jamesarosen/ember.js,xcambar/ember.js,rlugojr/ember.js,joeruello/ember.js,jplwood/ember.js,tricknotes/ember.js,eliotsykes/ember.js,tsing80/ember.js,kwight/ember.js,jmurphyau/ember.js,givanse/ember.js,intercom/ember.js,zenefits/ember.js,MatrixZ/ember.js,nvoron23/ember.js,yaymukund/ember.js,topaxi/ember.js,tiegz/ember.js,fouzelddin/ember.js,selvagsz/ember.js,marijaselakovic/ember.js,aihua/ember.js,duggiefresh/ember.js,HeroicEric/ember.js,jcope2013/ember.js,opichals/ember.js,jasonmit/ember.js,Turbo87/ember.js,xtian/ember.js,runspired/ember.js,loadimpact/ember.js,cgvarela/ember.js,trentmwillis/ember.js,antigremlin/ember.js,VictorChaun/ember.js,yonjah/ember.js,tiegz/ember.js,davidpett/ember.js,wecc/ember.js,lsthornt/ember.js,joeruello/ember.js,koriroys/ember.js,vikram7/ember.js,martndemus/ember.js,trentmwillis/ember.js,davidpett/ember.js,HeroicEric/ember.js,rwjblue/ember.js,Kuzirashi/ember.js,mitchlloyd/ember.js,omurbilgili/ember.js,JesseQin/ember.js,jerel/ember.js,ryanlabouve/ember.js,intercom/ember.js,koriroys/ember.js,latlontude/ember.js,boztek/ember.js,mdehoog/ember.js,ridixcr/ember.js,howtolearntocode/ember.js,twokul/ember.js,joeruello/ember.js,swarmbox/ember.js,zenefits/ember.js,ef4/ember.js,tofanelli/ember.js,sandstrom/ember.js,cbou/ember.js,skeate/ember.js,HipsterBrown/ember.js,sharma1nitish/ember.js,benstoltz/ember.js,jamesarosen/ember.js,MatrixZ/ember.js,sly7-7/ember.js,marijaselakovic/ember.js,JesseQin/ember.js,twokul/ember.js,cesarizu/ember.js,tildeio/ember.js,jbrown/ember.js,Trendy/ember.js,brzpegasus/ember.js,williamsbdev/ember.js,pixelhandler/ember.js,TriumphantAkash/ember.js,jasonmit/ember.js,sharma1nitish/ember.js,kaeufl/ember.js,jherdman/ember.js,blimmer/ember.js,kwight/ember.js,HeroicEric/ember.js,patricksrobertson/ember.js,nicklv/ember.js,workmanw/ember.js,kublaj/ember.js,kwight/ember.js,green-arrow/ember.js,kiwiupover/ember.js,stefanpenner/ember.js,alexdiliberto/ember.js,nathanhammond/ember.js,knownasilya/ember.js,omurbilgili/ember.js,xcambar/ember.js,furkanayhan/ember.js,vikram7/ember.js,gfvcastro/ember.js,howmuchcomputer/ember.js,antigremlin/ember.js,kmiyashiro/ember.js,trek/ember.js,abulrim/ember.js,TriumphantAkash/ember.js,jayphelps/ember.js,pangratz/ember.js,rodrigo-morais/ember.js,simudream/ember.js,martndemus/ember.js,claimsmall/ember.js,givanse/ember.js,max-konin/ember.js,howmuchcomputer/ember.js,BrianSipple/ember.js,zenefits/ember.js,udhayam/ember.js,skeate/ember.js,runspired/ember.js,benstoltz/ember.js,cdl/ember.js,schreiaj/ember.js,gdi2290/ember.js,thejameskyle/ember.js,mallikarjunayaddala/ember.js,jamesarosen/ember.js,cyberkoi/ember.js,mixonic/ember.js,nvoron23/ember.js,patricksrobertson/ember.js,blimmer/ember.js,nruth/ember.js,nathanhammond/ember.js,Vassi/ember.js,delftswa2016/ember.js,jasonmit/ember.js,JKGisMe/ember.js,howtolearntocode/ember.js,ef4/ember.js,njagadeesh/ember.js,nvoron23/ember.js,cbou/ember.js,ianstarz/ember.js,trek/ember.js,claimsmall/ember.js,gfvcastro/ember.js,emberjs/ember.js,adatapost/ember.js,yuhualingfeng/ember.js,greyhwndz/ember.js,xcskier56/ember.js,fxkr/ember.js,quaertym/ember.js,raytiley/ember.js,faizaanshamsi/ember.js,XrXr/ember.js,mrjavascript/ember.js,kidaa/ember.js,code0100fun/ember.js,ThiagoGarciaAlves/ember.js,Eric-Guo/ember.js,NLincoln/ember.js,sandstrom/ember.js,NLincoln/ember.js,boztek/ember.js,amk221/ember.js,soulcutter/ember.js,thoov/ember.js,quaertym/ember.js,mdehoog/ember.js,pixelhandler/ember.js,kaeufl/ember.js,jaswilli/ember.js,nathanhammond/ember.js,cibernox/ember.js,aihua/ember.js,cyberkoi/ember.js,yaymukund/ember.js,sivakumar-kailasam/ember.js,brzpegasus/ember.js,mike-north/ember.js,bantic/ember.js,furkanayhan/ember.js,omurbilgili/ember.js,bmac/ember.js,max-konin/ember.js,jasonmit/ember.js,schreiaj/ember.js,aihua/ember.js,kellyselden/ember.js,lazybensch/ember.js,knownasilya/ember.js,johanneswuerbach/ember.js,ef4/ember.js,asakusuma/ember.js,martndemus/ember.js,rubenrp81/ember.js,mdehoog/ember.js,aihua/ember.js,workmanw/ember.js,mmpestorich/ember.js,max-konin/ember.js,njagadeesh/ember.js,sivakumar-kailasam/ember.js,soulcutter/ember.js,cowboyd/ember.js,loadimpact/ember.js,NLincoln/ember.js,boztek/ember.js,koriroys/ember.js,rlugojr/ember.js,marcioj/ember.js,kellyselden/ember.js,marijaselakovic/ember.js,benstoltz/ember.js,nickiaconis/ember.js,raycohen/ember.js,green-arrow/ember.js,ThiagoGarciaAlves/ember.js,thejameskyle/ember.js,code0100fun/ember.js,VictorChaun/ember.js,jonathanKingston/ember.js,topaxi/ember.js,vikram7/ember.js,lan0/ember.js,kanongil/ember.js,thoov/ember.js,rodrigo-morais/ember.js,Vassi/ember.js,kanongil/ember.js,duggiefresh/ember.js,Patsy-issa/ember.js,MatrixZ/ember.js,bantic/ember.js,qaiken/ember.js,stefanpenner/ember.js,VictorChaun/ember.js,eliotsykes/ember.js,twokul/ember.js,kwight/ember.js,tiegz/ember.js,ridixcr/ember.js,miguelcobain/ember.js,visualjeff/ember.js,cyjia/ember.js,bmac/ember.js,sivakumar-kailasam/ember.js,mike-north/ember.js,boztek/ember.js,Zagorakiss/ember.js,quaertym/ember.js,cyjia/ember.js,cjc343/ember.js,karthiick/ember.js,anilmaurya/ember.js,BrianSipple/ember.js,cesarizu/ember.js,patricksrobertson/ember.js,omurbilgili/ember.js,xiujunma/ember.js,rwjblue/ember.js,artfuldodger/ember.js,vikram7/ember.js,nruth/ember.js,fouzelddin/ember.js,artfuldodger/ember.js,jasonmit/ember.js,TriumphantAkash/ember.js,mixonic/ember.js,EricSchank/ember.js,mitchlloyd/ember.js,karthiick/ember.js,eliotsykes/ember.js,wycats/ember.js,nickiaconis/ember.js,dgeb/ember.js,KevinTCoughlin/ember.js,fpauser/ember.js,wycats/ember.js,nipunas/ember.js,kidaa/ember.js,jackiewung/ember.js,vitch/ember.js,nightire/ember.js,fxkr/ember.js,danielgynn/ember.js,antigremlin/ember.js,Vassi/ember.js,Serabe/ember.js,szines/ember.js,amk221/ember.js,mdehoog/ember.js,jherdman/ember.js,JKGisMe/ember.js,cgvarela/ember.js,acburdine/ember.js,karthiick/ember.js,lazybensch/ember.js,sharma1nitish/ember.js,Kuzirashi/ember.js,mrjavascript/ember.js,mfeckie/ember.js,yuhualingfeng/ember.js,femi-saliu/ember.js,mallikarjunayaddala/ember.js,Krasnyanskiy/ember.js
|
fc8798354ad72998eb1e496c630c51bb175a2a98
|
app/account/views/cards-list.js
|
app/account/views/cards-list.js
|
module.exports = Zeppelin.CollectionView.extend({
tagName: 'ol',
className: 'cards-list list-unstyled clearfix',
subscriptions: {
'cardsList:layout': 'triggerLayout'
},
itemView: function(model) {
return require('account/views/' + model.get('type'));
},
collection: function() {
return App.Cards;
},
initialize: function() {
this.$parent = $('div.content');
_.bindAll(this, ['layout']);
},
onRenderItems: function() {
this.wall = new freewall(this.$list);
this.triggerLayout();
},
onAppendItem: function() {
if (!this.isFirstCollectionRender()) this.layout();
},
triggerLayout: function() {
_.delay(this.layout, 10);
},
layout: function() {
this.wall.reset({
delay: 0,
cellW: 222,
cellH: 222,
animate: false,
selector: 'li.card',
onResize: _.bind(function() {
this.wall.fitWidth();
}, this)
});
this.wall.fitWidth(this.$parent.width());
},
onUnplug: function() {
this.wall.destroy();
}
});
|
module.exports = Zeppelin.CollectionView.extend({
tagName: 'ol',
className: 'cards-list list-unstyled clearfix',
subscriptions: {
'cardsList:layout': 'triggerLayout'
},
itemView: function(model) {
return require('account/views/' + model.get('type'));
},
collection: function() {
return App.Cards;
},
initialize: function() {
this.$parent = $('div.content');
_.bindAll(this, ['layout']);
},
onRenderItems: function() {
this.wall = new freewall(this.$list);
this.triggerLayout();
},
onAppendItem: function() {
if (!this.isFirstCollectionRender()) this.layout();
},
triggerLayout: function() {
_.delay(this.layout, 10);
},
layout: function() {
this.wall.reset({
delay: 0,
cellW: 222,
cellH: 222,
animate: false,
selector: 'li.card',
onResize: _.bind(function() {
this.wall.fitWidth();
}, this)
});
this.wall.fitWidth(this.$parent.width());
}
});
|
Remove freewall plugin destroy() call.
|
Remove freewall plugin destroy() call.
|
JavaScript
|
agpl-3.0
|
jessamynsmith/boards-web,GetBlimp/boards-web,jessamynsmith/boards-web
|
1a794ad9b64c769d5021529723aa985a4d79d435
|
lib/node_modules/@stdlib/math/generics/random/sample/lib/index.js
|
lib/node_modules/@stdlib/math/generics/random/sample/lib/index.js
|
'use strict';
/**
* Sample elements from an array-like object.
*
* @module @stdlib/math/generics/random/sample
*
* @example
* var sample = require( '@stdlib/math/generics/random/sample' );
*
* var out = sample( 'abc' );
* // returns e.g. [ 'a', 'a', 'b' ]
* out = sample( [ 3, 6, 9 ] );
* // returns e.g. [ 3, 9, 6 ]
*
* bool = out.length === 3;
* // returns true
*
* var mysample = sample.factory( 323 );
* out = mysample( [ 3, 6, 9 ], {
* 'size': 10
* });
* // returns [ 3, 9, 3, 3, 3, 6, 3, 3, 3, 6 ]
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-read-only-property' );
var sample = require( './sample.js' );
var factory = require( './factory.js' );
// METHODS //
setReadOnly( sample, 'factory', factory );
// EXPORTS //
module.exports = sample;
|
'use strict';
/**
* Sample elements from an array-like object.
*
* @module @stdlib/math/generics/random/sample
*
* @example
* var sample = require( '@stdlib/math/generics/random/sample' );
*
* var out = sample( 'abc' );
* // e.g., returns [ 'a', 'a', 'b' ]
*
* out = sample( [ 3, 6, 9 ] );
* // e.g., returns [ 3, 9, 6 ]
*
* var bool = ( out.length === 3 );
* // returns true
*
* @example
* var sample = require( '@stdlib/math/generics/random/sample' );
*
* var mysample = sample.factory( 323 );
* var out = mysample( [ 3, 6, 9 ], {
* 'size': 10
* });
* // returns [ 3, 9, 3, 3, 3, 6, 3, 3, 3, 6 ]
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-read-only-property' );
var sample = require( './sample.js' );
var factory = require( './factory.js' );
// METHODS //
setReadOnly( sample, 'factory', factory );
// EXPORTS //
module.exports = sample;
|
Update return value annotations and update example
|
Update return value annotations and update example
|
JavaScript
|
apache-2.0
|
stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib
|
8eff032390c49e17fab892d03591bf6b53bdca3d
|
test/all.js
|
test/all.js
|
/*global require: false */
require('babel-polyfill');
// This needs refactor. Might want to return mutationVector methods in exports,
// and call widget.*.add elsewhere, so we can test the methods w/o widgets.
//require('./mutationVector');
require('./exonLayout');
require('./refGeneExons');
require('./plotDenseMatrix');
require('./plotMutationVector');
require('./heatmapColors');
require('./scale');
require('./underscore_ext');
require('./fieldFetch');
require('./compactData');
require('./parsePos');
require('./permuteCase');
require('./lcs');
require('./stripeHeight');
require('./findIntrons');
require('./layoutPlot');
//require('./matrix-test');
require('./Legend');
require('./drawHeatmap');
|
/*global require: false */
require('babel-polyfill');
// This needs refactor. Might want to return mutationVector methods in exports,
// and call widget.*.add elsewhere, so we can test the methods w/o widgets.
//require('./mutationVector');
require('./exonLayout');
require('./refGeneExons');
require('./plotDenseMatrix');
require('./plotMutationVector');
require('./heatmapColors');
require('./scale');
require('./underscore_ext');
// this is unreliable in CI
//require('./fieldFetch');
require('./compactData');
require('./parsePos');
require('./permuteCase');
require('./lcs');
require('./stripeHeight');
require('./findIntrons');
require('./layoutPlot');
//require('./matrix-test');
require('./Legend');
require('./drawHeatmap');
|
Disable field fetch unit test
|
Disable field fetch unit test
|
JavaScript
|
apache-2.0
|
ucscXena/ucsc-xena-client,acthp/ucsc-xena-client,ucscXena/ucsc-xena-client,acthp/ucsc-xena-client,ucscXena/ucsc-xena-client,ucscXena/ucsc-xena-client,acthp/ucsc-xena-client,ucscXena/ucsc-xena-client
|
e4b37ad85b8432adcc354f886be1112289a5b53e
|
test/api/routes/feedRoute.test.js
|
test/api/routes/feedRoute.test.js
|
/**
* Copyright (c) 2013-2015 Memba Sarl. All rights reserved.
* Sources at https://github.com/Memba
*/
/* jshint node: true, expr: true */
/* globals describe: false, before: false, it: false */
'use strict';
var request = require('supertest'),
//We cannot define app like this because the server is already running
//app = request('../../../webapp/server');
config = require('../../../webapp/config'),
app = config.get('uris:webapp:root');
describe('routes/feedRoute', function() {
it('it should return an english feed', function(done) {
request(app)
.get('/en/index.rss')
.expect(200)
.expect('Content-Type', /rss/)
.end(done);
});
it('it should return a french feed', function(done) {
request(app)
.get('/fr/index.rss')
.expect(200)
.expect('Content-Type', /rss/)
.end(done);
});
});
|
/**
* Copyright (c) 2013-2015 Memba Sarl. All rights reserved.
* Sources at https://github.com/Memba
*/
/* jshint node: true, expr: true */
/* globals describe: false, before: false, it: false */
'use strict';
var request = require('supertest'),
util = require('util'),
//We cannot define app like this because the server is already running
//app = request('../../../webapp/server');
config = require('../../../webapp/config'),
app = config.get('uris:webapp:root');
describe('routes/feedRoute', function() {
it('it should return an english feed', function(done) {
request(app)
.get(util.format(config.get('uris:webapp:feed'), 'en'))
.expect(200)
.expect('Content-Type', /rss/)
.end(done);
});
it('it should return a french feed', function(done) {
request(app)
.get(util.format(config.get('uris:webapp:feed'), 'fr'))
.expect(200)
.expect('Content-Type', /rss/)
.end(done);
});
});
|
Use config to build paths
|
Use config to build paths
|
JavaScript
|
agpl-3.0
|
Memba/Memba-Blog,Memba/Memba-Blog,Memba/Memba-Blog
|
a02b5d4068f61dd9577239bb221bde7fedbdfb16
|
lib/botUtils.js
|
lib/botUtils.js
|
/*
* Copyright (c) 2014-2020 Bjoern Kimminich.
* SPDX-License-Identifier: MIT
*/
const models = require('../models/index')
const fuzz = require('fuzzball')
async function productPrice (query, user) {
const [products] = await models.sequelize.query('SELECT * FROM Products')
const queriedProducts = products
.filter((product) => fuzz.partial_ratio(query, product.name) > 75)
.map((product) => `${product.name}: ${product.price}`)
return {
action: 'response',
body: queriedProducts.length > 0 ? queriedProducts.join(`
`) : 'Sorry I couldn\'t find any products with that name'
}
}
function testFunction (query, user) {
return {
action: 'response',
body: '3be2e438b7f3d04c89d7749f727bb3bd'
}
}
module.exports = {
productPrice,
testFunction
}
|
/*
* Copyright (c) 2014-2020 Bjoern Kimminich.
* SPDX-License-Identifier: MIT
*/
const models = require('../models/index')
const fuzz = require('fuzzball')
async function productPrice (query, user) {
const [products] = await models.sequelize.query('SELECT * FROM Products')
const queriedProducts = products
.filter((product) => fuzz.partial_ratio(query, product.name) > 75)
.map((product) => `${product.name}: ${product.price}¤`)
return {
action: 'response',
body: queriedProducts.length > 0 ? queriedProducts.join(`
`) : 'Sorry I couldn\'t find any products with that name'
}
}
function testFunction (query, user) {
return {
action: 'response',
body: '3be2e438b7f3d04c89d7749f727bb3bd'
}
}
module.exports = {
productPrice,
testFunction
}
|
Add currency symbol to price information response
|
Add currency symbol to price information response
|
JavaScript
|
mit
|
bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop
|
11e47eb87016b2ca09591bf3b37920ad2b672b63
|
test/core/list_metadata_parser.js
|
test/core/list_metadata_parser.js
|
require('../initialize-globals').load();
var listMetadataParser = require('../../lib/core/list_metadata_parser');
describe('# list_metadata_parser', function() {
describe("##createListMetadatasOptions", function() {
it('GET', function() {
var meta = {
top: 10,
skip: 23,
sortFieldName: "colA",
sortDesc: true
};
var param = listMetadataParser.createMetadataOptions(meta);
param.should.be.a.string;
for(m in meta){
param.indexOf(m).should.not.be.equal(-1);
}
});
});
});
|
require('../initialize-globals').load();
var listMetadataParser = require('../../lib/core/list_metadata_parser');
describe('# list_metadata_parser', function() {
describe("##createListMetadatasOptions", function() {
it('GET', function() {
var meta = {
top: 10,
skip: 23,
sortFieldName: "colA",
sortDesc: true
};
var ajaxOptions = listMetadataParser.load({
criteria: {
name: "pierre",
age: 27
},
metadata: meta
}, {
url: "http://test.com"
});
console.log("ajaxOptions", ajaxOptions);
ajaxOptions.url.should.be.a.string;
for (var m in meta) {
ajaxOptions.url.indexOf(m).should.not.be.equal(-1);
}
});
});
});
|
Update the test on the list metadata parser..
|
[test] Update the test on the list metadata parser..
|
JavaScript
|
mit
|
Jerom138/focus,KleeGroup/focus-core,Jerom138/focus,Jerom138/focus
|
b64369b91ee8415c934250674fb4c5e5d39c3617
|
lib/basic-auth-parser.js
|
lib/basic-auth-parser.js
|
module.exports = function parse(auth) {
var result = {}, parts, decoded, credentials;
parts = auth.split(' ');
result.scheme = parts[0];
if (result.scheme !== 'Basic') {
return result;
}
decoded = new Buffer(parts[1], 'base64').toString('utf8');
credentials = decoded && decoded.split(":");
result.username = credentials[0];
result.password = credentials[1];
return result;
};
|
module.exports = function parse(auth) {
if (!auth || typeof auth !== 'string') {
throw new Error('No or wrong argument');
}
var result = {}, parts, decoded, credentials;
parts = auth.split(' ');
result.scheme = parts[0];
if (result.scheme !== 'Basic') {
return result;
}
decoded = new Buffer(parts[1], 'base64').toString('utf8');
credentials = decoded && decoded.split(":");
result.username = credentials[0];
result.password = credentials[1];
return result;
};
|
Throw an error if no or wrong argument is provided
|
[api] Throw an error if no or wrong argument is provided
Fixes #1.
|
JavaScript
|
mit
|
mmalecki/basic-auth-parser
|
4dd519ee8697a699b79d3f7dbaae29c2dc4b6b84
|
tasks/options/autoprefixer.js
|
tasks/options/autoprefixer.js
|
module.exports = {
options: {
// Options we might want to enable in the future.
diff: false,
map: false
},
multiple_files: {
// Prefix all CSS files found in `src/static/css` and overwrite.
expand: true,
src: 'demo/static/css/main.css'
},
};
|
module.exports = {
options: {
// Options we might want to enable in the future.
diff: false,
map: false
},
main: {
// Prefix all properties found in `main.css` and overwrite.
expand: true,
src: 'demo/static/css/main.css'
},
};
|
Fix Autoprefixer target name and comment
|
Fix Autoprefixer target name and comment
|
JavaScript
|
cc0-1.0
|
cfpb/cf-grunt-config,ascott1/cf-grunt-config,Scotchester/cf-grunt-config
|
c0102233fb7528891569113e73d7af9f33a07b7c
|
modules/messages/validator.js
|
modules/messages/validator.js
|
var Promise = require('bluebird'),
mongoose = Promise.promisifyAll(require('mongoose')),
Message = mongoose.model('Message'),
UserUtils = require('utils/users'),
MessageUtils = require('utils/messages'),
GroupMessage = mongoose.model('GroupMessage');
module.exports = {
one : One,
get : Get,
validateOwners : ValidateOwners
};
function One(request,reply) {
var msgId = request.params.id,
user = request.auth.credentials;
MessageUtils.exists(msgId,user)
.then(function(msg){
reply.data = msg;
reply.next();
})
.catch(function(e) {
reply.next(e);
});
}
function Get(request,reply) {
UserUtils.exists(request.params.from)
.then(function(){
return UserUtils.exists(request.params.to);
})
.then(function(){
reply.next();
})
.catch(function(e){
reply.next(e);
});
}
function ValidateOwners(request,reply) {
var userId = request.auth.credentials.id,
from = request.params.from,
to = request.params.to;
if(userId == from) {
reply.next();
return;
}
reply.next('Not authorized to view messages');
}
|
var Promise = require('bluebird'),
mongoose = Promise.promisifyAll(require('mongoose')),
Message = mongoose.model('Message'),
UserUtils = require('utils/users'),
MessageUtils = require('utils/messages'),
GroupMessage = mongoose.model('GroupMessage');
module.exports = {
one : One,
get : Get,
validateOwners : ValidateOwners
};
function One(request,reply) {
var msgId = request.params.id,
user = request.auth.credentials;
MessageUtils.exists(msgId,user)
.then(function(msg){
reply.data = msg;
reply.next();
})
.catch(function(e) {
reply.next(e);
});
}
function Get(request,reply) {
UserUtils.exists(request.params.from)
.then(function(){
return UserUtils.exists(request.params.to);
})
.then(function(){
reply.next();
})
.catch(function(e){
reply.next(e);
});
}
function ValidateOwners(request,reply) {
var userId = request.auth.credentials.id,
from = request.params.from,
to = request.params.to;
if(userId == from || userId == to) {
reply.next();
return;
}
reply.next('Not authorized to view messages');
}
|
Check from/to for validating message ownership
|
Check from/to for validating message ownership
|
JavaScript
|
mit
|
Pranay92/lets-chat,Pranay92/collaborate
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.