Skip to content

Instantly share code, notes, and snippets.

@theadam
theadam / index.js
Created November 17, 2015 03:51
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
var Router5 = require('router5').Router5;
var historyPlugin = require('router5-history');
var router = new Router5()
.addNode('one', '/home')
.addNode('two', '/about')
.addNode('three', '/contact')
.addNode('four', '/contact/:id')
@theadam
theadam / index.js
Created November 17, 2015 03:50
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
var Router5 = require('router5').Router5;
var historyPlugin = require('router5-history');
var router = new Router5()
.addNode('one', '/home')
.addNode('two', '/about')
.addNode('three', '/contact')
.addNode('four', '/contact/:id')
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/6.0.20/browser.min.js"></script>
<script src="https://wzrd.in/standalone/router5"></script>
<script src="https://wzrd.in/standalone/router5-history"></script>
</head>
<body>
<button id="one">one</button>
<button id="two">two</button>
<button id="three">three</button>
@theadam
theadam / index.html
Created November 12, 2015 18:58
xwmRON
doctype html
html
head
body
button(id='one') one
button(id='two') two
button(id='three') three
button(id='four') four
button(id='five') five
div(id='test')
@theadam
theadam / index.js
Created November 12, 2015 03:02
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
var Router5 = require('router5').Router5;
var historyPlugin = require('router5-history');
var router = new Router5()
.addNode('one', '/home')
.addNode('two', '/about')
.addNode('three', '/contact')
.addNode('four', '/contact/:id')
@theadam
theadam / index.js
Created November 12, 2015 03:00
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
var Router5 = require('router5').Router5;
var historyPlugin = require('router5-history');
var router = new Router5()
.addNode('one', '/home')
.addNode('two', '/about')
.addNode('three', '/contact')
.addNode('four', '/contact/:id')
@theadam
theadam / gist:a2cd0b713de06d3b61a9
Last active August 29, 2015 14:24
purescript lazy list
module Main where
import Control.Monad.Eff
import Debug.Trace
foreign import data Random :: !
foreign import data Lazy :: * -> *
@theadam
theadam / index.js
Created June 24, 2015 14:07
requirebin sketch
var R = require('ramda');
function memoizePromise(fn){
var cache = {};
return function(){
var key = R.toString(arguments);
if(cache.hasOwnProperty(key)){
return cache[key];
}
else{
@theadam
theadam / index.js
Created June 24, 2015 05:15
requirebin sketch
var R = require('ramda');
function memoizePromise(fn){
var cache = {};
return function(){
var key = R.toString(arguments);
if(cache.hasOwnProperty(key)){
return cache[key];
}
else{
@theadam
theadam / Simple Undo Example
Created June 10, 2015 21:32
A simple undo example
import Html exposing (Html, div, text, input, button)
import Html.Attributes exposing (value, placeholder)
import Html.Events exposing (on, targetValue, onClick)
import Signal as Signal
import StartApp
import List exposing (head, tail)
type alias Model = { text:String }
type Action = UpdateText String