Skip to content

Instantly share code, notes, and snippets.

Edward Cho zerokarmaleft

Block or report user

Report or block zerokarmaleft

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am zerokarmaleft on github.
  • I am zerokarmaleft (https://keybase.io/zerokarmaleft) on keybase.
  • I have a public key ASCmPSKLtqR_ZyuG3chst6HWkG8UrLmlmB_4Hbpvq4i0iQo

To claim this, I am signing this object:

View gist:0b497c7790b4ef575b44
upstream http_backend {
server localhost:3000;
keepalive 32;
}
server {
location /ralphedwards/ {
proxy_pass http://http_backend/;
proxy_http_version 1.1;
proxy_set_header Connection "";
@zerokarmaleft
zerokarmaleft / arith.clj
Last active Aug 29, 2015
TAPL with core.typed
View arith.clj
(ns arith.core
(:require [clojure.core.typed :refer [ann defalias Rec U Val Int]]
[clojure.core.match :refer [match]]))
(defalias Expr
(Rec [Expr]
(U '[(Val :zero)]
'[(Val :succ) Expr])))
(ann evaluate [Expr -> Int])
@zerokarmaleft
zerokarmaleft / core.cljs
Last active Aug 29, 2015
core.async and js-csp side-by-side
View core.cljs
(ns vending-machine.core
(:require [cljs.core.async
:refer [<! >! chan timeout]]
[figwheel.client :as figwheel
:include-macros [true]]
[om.core :as om
:include-macros true]
[sablono.core :as html
:refer-macros [html]])
(:require-macros [cljs.core.async.macros
View async_trampoline.clj
"X1. A drinks dispenser has two buttons labelled ORANGE and
LEMON. The actions of pressing the two buttons are /set-orange/ and
/set-lemon/. The actions of dispensing a drink are /orange/ and
/lemon/. The choice of drink that will be dispensed is made by
pressing the corresponding button. Before any button is pressed, no
drink will be dispensed."
(declare orange lemon)
(def c (chan))
@zerokarmaleft
zerokarmaleft / strangeloop.org
Last active Aug 29, 2015
if I were going... :(
View strangeloop.org

Wednesday

Workshops

  • Program Synthesis using miniKanren
@zerokarmaleft
zerokarmaleft / memoization.py
Created Sep 10, 2014
Memoization is a performance optimization, not a means to achieve referential transparency
View memoization.py
# Memoization doesn't get you all the way there. While a memoized
# function might exhibit referential transparency *at two successive
# callsites*, your program as a whole will not exhibit that
# property. An example with destructive updates of a mutable data
# structure, an inherently effectful operation:
phonebook = {}
# assuming this function is augmented with memoization
View montecarlo.js
var Lazy = require('lazy.js');
function isHeads(x) { return x >= 0.5; }
function isTails(x) { return x < 0.5; }
function toss(n) {
var successes = Lazy.generate(function() { return Math.random(); })
.take(n)
.filter(isHeads)
.size();
View Main.hs
{-# LANGUAGE DeriveGeneric
, FlexibleInstances
, OverloadedStrings
, ScopedTypeVariables
, TypeSynonymInstances #-}
module Main where
import Control.Monad
import Data.Aeson.Types
View Main.hs
{-# LANGUAGE OverloadedStrings, ScopedTypeVariables, DeriveGeneric #-}
module Main where
import Data.Aeson.Types
import qualified Data.ByteString.Lazy as BSL
import qualified Data.ByteString.UTF8 as UTF8
import GHC.Generics
import Network.Riak
You can’t perform that action at this time.