NOTE I now use the conventions detailed in the SUIT framework
Used to provide structural templates.
Pattern
t-template-name
/* | |
Usage: | |
$ node async-benchmark.js -t 999999 | |
*/ | |
var parallelly = require("parallelly"); | |
var serially = require("serially"); | |
var async = require("async"); |
/** | |
* | |
* Hooking up Watchify with Google's Web Starter Kit | |
* | |
* The primary use cases for Browserify/Watchify are: | |
* - Node.js-style `require`s on the client-side | |
* - Use of npm modules on the client-side | |
* - No more new <script> tags for each new script/module | |
* | |
* 1. npm install --save-dev vinyl-source-stream browserify watchify gulp-notify |
NOTE I now use the conventions detailed in the SUIT framework
Used to provide structural templates.
Pattern
t-template-name
// NOTE: I added the .js extension to this gist so it would have syntax highlighting. This file should have NO file extension | |
{ | |
// Settings | |
"passfail" : false, // Stop on first error. | |
"maxerr" : 100, // Maximum error before stopping. | |
// Predefined globals whom JSHint will ignore. | |
"browser" : true, // Standard browser globals e.g. `window`, `document`. |
AsyncProcess = require('./async-process').AsyncProcess | |
describe('AsyncProcess', function() { | |
var asyncProcess; | |
beforeEach(function() { | |
asyncProcess = new AsyncProcess(); | |
}); | |
it('should process 42', function() { |
/*http://i-skool.co.uk/mobile-development/web-design-for-mobiles-and-tablets-viewport-sizes/*/ | |
/*At least requires the meta viewport tag with content 'width=device-width'*/ | |
@media only screen and (max-width: 1080px) and (orientation : portrait) { | |
/* PORTRAIT: | |
Windows Surface Pro*/ | |
} | |
@media only screen and (max-width: 800px) and (orientation : portrait) { | |
/* PORTRAIT: | |
Acer Iconia Tab A100 |
app.post('/login', function(req, res) { | |
console.log(res); | |
passport.authenticate('local', function(err, user, params) { | |
if (req.xhr) { | |
//thanks @jkevinburton | |
if (err) { return res.json({ error: err.message }); } | |
// e.g. in auth.js: | |
// if (!user.emailVerified) { return done(null, false, { message: 'Email is not verified. Please check your email for the link.' }); } | |
if (!user && params) { return res.json({error : params.error}); } |
##Setup your server (this would ideally be done with automated provisioning)
npm install -g forever
##Install flightplan
npm install -g flightplan
npm install flightplan --save-dev
# | |
# Wide-open CORS config for nginx | |
# | |
location / { | |
if ($request_method = 'OPTIONS') { | |
add_header 'Access-Control-Allow-Origin' '*'; | |
# |
This guide will get RethinkDB setup and running with a default configuration on OSX. There is also an option for setting RethinkDB to start at boot time on OSX, and a note on upgrading to a more recent RethinkDB version.
Install Homebrew if you don't already have it: