Skip to content

Instantly share code, notes, and snippets.

View liwp's full-sized avatar

Lauri Pesonen liwp

View GitHub Profile
@liwp
liwp / keybase.md
Created September 25, 2014 11:09
keybase.md

Keybase proof

I hereby claim:

  • I am liwp on github.
  • I am liwp (https://keybase.io/liwp) on keybase.
  • I have a public key whose fingerprint is 23EF 54E2 A56B 68E5 2223 5EC5 BD93 BB8A 38E7 20AF

To claim this, I am signing this object:

@liwp
liwp / core.cljs
Last active August 29, 2015 13:56
A core.cljs file for node.cljs with source-map support
(ns hello-world.core
(:require [cljs.nodejs :as nodejs]))
(defn fail []
(println "Hello world!")
(throw (js/Error. "error"))
(println "Bye world!"))
(defn -main []
(.install (js/require "source-map-support"))
@liwp
liwp / project.clj
Created February 27, 2014 20:47
A project.clj file for node.cljs with source-map support
(defproject hello-world "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/clojurescript "0.0-2173"]]
:plugins [[lein-cljsbuild "1.0.2"]]
:source-paths ["src"]
:cljsbuild {:builds [{:id "hello-world"
@liwp
liwp / project.clj
Last active August 29, 2015 13:56
Minimal project.clj file for nodecljs projects
(defproject node-demo "0.1.0-SNAPSHOT"
:description "FIXME: write this!"
:url "http://example.com/FIXME"
:dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/clojurescript "0.0-2138"]]
:plugins [[lein-cljsbuild "1.0.2"]]
:source-paths ["src"]
@liwp
liwp / core.cljs
Last active August 29, 2015 13:56
"Hello, World!" in ClojureScript on Node.js
(ns node-demo.core
(:require [cljs.nodejs :as nodejs]))
(defn -main []
(println "Hello world!"))
(set! *main-cli-fn* -main)
@liwp
liwp / gist:425255
Created June 4, 2010 10:17
functional stack implementation in clojure
(defprotocol PStack
"A stack protocol"
(push [this val] "Push an element onto the stack")
(mypop [this] "Pop an element from the top of the stack")
(top [this] "Return the element from the top of the stack"))
(deftype Stack [t h]
PStack
(push [this val]
(Stack. this val))