$ mix phoenix.new <NAME>
$ cd <NAME>
$ mix ecto.create
// if postgres errors
$ brew install postgresql
$ psql postgres
postgres=# CREATE ROLE postgres;
postgres=# ALTER ROLE postgres LOGIN;
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
button.addEventListener('click', () => { | |
Promise.resolve().then(() => console.log('P1')) | |
console.log('L1') | |
}) | |
button.addEventListener('click', () => { | |
Promise.resolve().then(() => console.log('P2')) | |
console.log('L2') | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const createStore = (reducer, state = {}) => { | |
let subs = [] | |
const store = (function * () { | |
while (true) { | |
const event = yield null | |
state = reducer(state, event) | |
subs.forEach(fn => fn(state)) | |
} | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const createStore = (state) => { | |
const noop_handler = state => state | |
state = state || {} | |
var handlers = {} | |
var subs = [] | |
const store = (function * () { | |
while (true) { | |
const { type, payload } = yield null | |
state = (handlers[type] || noop_handler)(state, ...payload) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
λf.(λx.f(xx))(λx.f(xx)) | |
ZERO = λfx.x | f -> x -> x | |
ONE = λfx.fx | f -> x -> f(x) | |
TWO = λfx.f(fx) | f -> x -> f(f(x)) | |
THREE = λfx.f(f(fx)) | f -> x -> f(f(f(x))) | |
SUCC = λnfx.nfx | n -> f -> x -> n(f)(x) | |
ADD = λmnfx.mf(nfx) || λmn.n succ m | m -> n -> f -> x -> m(n(f))(x) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import css from "./styles.css" | |
import React from "react" | |
import Counter from "../Counter" | |
import Form from "../Form" | |
import update from "../__lib__/update" | |
import unset from "../__lib__/unset" | |
import set from "../__lib__/set" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xhr from 'superagent' | |
import { Observable } from 'rx' | |
/** body | |
* @description returns the body of a supplied response | |
* @param {Object} response the response from the xhr request | |
* @return {Any} what ever the body is | |
*/ | |
function body (response) { | |
return response.body |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
env: | |
browser: true | |
node: true | |
es6: true | |
mocha: true | |
protractor: true | |
ecmaFeatures: | |
modules: true | |
jsx: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xhr from "superagent" | |
import { Observable } from "rx" | |
var id = v => v | |
var body = r => r.body | |
var r = (resolve, reject, fn=id) => | |
(err, res) => | |
!!err |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
* { margin:0; padding:0; } | |
body { background:aliceblue; } | |
</style> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/d3/3.3.10/d3.min.js"></script> | |
<script> | |
d3.select('body').append('h1').text('hello world') | |
</script> |