Skip to content

Instantly share code, notes, and snippets.

// routes.js
const routes = [
{
path: '/',
component: Home,
exact: true
},
{
path: '/gists',
component: Gists
@gabro
gabro / validation.flow.js
Last active February 24, 2020 16:38
Dynamic object validation using $ObjMap in Flow
/* @flow */
// A simplified representation of types using phantom types (so that we store the Type information both at value and type level)
class Type<T> {};
class StringT extends Type<string> {}
class NumberT extends Type<number> {}
// A schema for a User
const User = {
name: new StringT(),
@anazawa
anazawa / freebsd.sh
Last active February 21, 2017 15:11
Running KGS Protocol Translator on Jetty9
# Daemonize
vi /usr/local/etc/jetty/jetty
echo jetty_enable="YES" >> /etc/rc.conf
service jetty start
@gilesc
gilesc / twss.clj
Created April 28, 2011 01:26
twss
(require '[net.cgrand.enlive-html :as html])
(defn fetch-url [url]
(html/html-resource
(java.net.URL. url)))
(defn fetch-twss [n]
(drop-last 2
(map #(second (re-find #"\"(.+?)\"" (html/text %)))
(html/select