Skip to content

Instantly share code, notes, and snippets.

View XGHeaven's full-sized avatar
🐟
Finding web future

Bradley Xu XGHeaven

🐟
Finding web future
View GitHub Profile
@XGHeaven
XGHeaven / index.js
Created April 23, 2017 18:12 — forked from sperand-io/index.js
Koa EventSource Streaming (SSE)
const PassThrough = require('stream').PassThrough;
const Router = require('koa-66');
const router = new Router();
const Koa = require('koa');
const app = new Koa();
// ...
router.get(`/json/data/:source`, ctx => {
const stream = new PassThrough();
@XGHeaven
XGHeaven / README.md
Created March 22, 2017 10:24
Install PHP7 on OS X El Capitan

Install PHP7 on OS X El Capitan

add the taps, unlink the old PHP if required and add php7

brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php
brew unlink php56
brew install php70
abbr -a g 'git'
abbr -a ga 'git add'
abbr -a gaa 'git add --all'
abbr -a gapa 'git add --patch'
abbr -a gb 'git branch'
abbr -a gba 'git branch -a'
abbr -a gbda 'git branch --merged | command grep -vE "^(\*|\s*master\s*\$)" | command xargs -n 1 git branch -d'
abbr -a gbl 'git blame -b -w'
abbr -a gbnm 'git branch --no-merged'
abbr -a gbr 'git branch --remote'
@XGHeaven
XGHeaven / style_guide.md
Created November 7, 2015 01:54 — forked from dominictarr/style_guide.md
style guide

High level style in javascript.

Opinions are like assholes, every one has got one.

This one is mine.

Punctuation: who cares?

Punctuation is a bikeshed. Put your semicolons, whitespace, and commas where you like them.