Here is an essay version of my class notes from Class 1 of CS183: Startup. Errors and omissions are my own. Credit for good stuff is Peter’s entirely.
CS183: Startup—Notes Essay—The Challenge of the Future
Purpose and Preamble
Here is an essay version of my class notes from Class 1 of CS183: Startup. Errors and omissions are my own. Credit for good stuff is Peter’s entirely.
CS183: Startup—Notes Essay—The Challenge of the Future
Purpose and Preamble
// NOTE: I previously suggested doing this through Grunt, but had plenty of problems with | |
// my set up. Grunt did some weird things with scope, and I ended up using nodemon. This | |
// setup is now using Gulp. It works exactly how I expect it to and is WAY more concise. | |
var gulp = require('gulp'), | |
spawn = require('child_process').spawn, | |
node; | |
/** | |
* $ gulp server | |
* description: launch the server. If there's a server already running, kill it. |
'use strict'; | |
module.exports = function CustomError(message, extra) { | |
Error.captureStackTrace(this, this.constructor); | |
this.name = this.constructor.name; | |
this.message = message; | |
this.extra = extra; | |
}; | |
require('util').inherits(module.exports, Error); |
// ------------ | |
// counterStore.js | |
// ------------ | |
import { | |
INCREMENT_COUNTER, | |
DECREMENT_COUNTER | |
} from '../constants/ActionTypes'; | |
const initialState = { counter: 0 }; |
// koa-passport-authenticate.js | |
'use strict' | |
const _ = require('lodash') | |
const passport = require('koa-passport') | |
'use strict' | |
// Middleware wrapper for koa passport to have proper error handling on authenticate. |
Proposal for a lightning talk at the Reactive 2016.
Keep calm and like/retweet it on Twitter and star this Gist to vote on this talk.
I work at Grammarly. We like React and happily use it in our applications. However, sometimes something goes wrong and bugs creep into the code. Here comes testing. It helps make us confident about the quality of our code.
/* @flow */ | |
import BrowserHistory from 'react-history/BrowserHistory' | |
import {Push, Replace} from 'react-history' | |
import React, {Component} from 'react' | |
import {StaticRouter} from 'react-router' | |
type RouterProps = { | |
onChange: (action: string, location: Object) => void, | |
pathname: string, | |
navigation?: 'PUSH' | 'REPLACE', |
Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.
This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would
const plugins = [ | |
// extract vendor and webpack's module manifest | |
new webpack.optimize.CommonsChunkPlugin({ | |
names: [ 'vendor', 'manifest' ], | |
minChunks: Infinity | |
}), | |
// extract common modules from all the chunks (requires no 'name' property) | |
new webpack.optimize.CommonsChunkPlugin({ | |
async: true, | |
children: true, |
const functions = require('firebase-functions') | |
const admin = require('firebase-admin') | |
// This is hosted using Firebase Functions to gain easier access without meddling with service key | |
admin.initializeApp(functions.config().firebase) | |
exports.verifyToken = functions.https.onRequest((req, res) => { | |
const { idToken } = req.query | |
if (!idToken) { |