Skip to content

Instantly share code, notes, and snippets.

View gist:7339829
(defun switch-to-buffer-if-exists (nm)
(if (get-buffer nm)
(switch-to-buffer nm)
(message (format "Buffer %s does not exist" nm))))
(defun switch-to-buffer-if-exists-cmd (nm)
(lambda ()
(switch-to-buffer-if-exists nm)))
View gist:7506522
catcher(N) ->
try generate_exception(N) of
Val -> {N, normal, Val}
throw: X -> {N, caught, thrown, X};
exit:X -> {N, caught, exited, X};
error:X -> {N, caught, error, X}
View gist:7748877
at clojure.lang.RT.length(
at clojure.lang.RT.seqToArray(
at clojure.lang.ASeq.toArray(
at clojure.lang.RT.toArray(
at clojure.core$to_array.invoke(core.clj:333)
at clojure.core$format.doInvoke(core.clj:5178)
at clojure.lang.RestFn.invoke(
at clojure.core$fn__5497.invoke(core_print.clj:380)
at clojure.lang.MultiFn.invoke(
View gist:7764167
Compiling "resources/public/out/main.js" from ["cljs"]...
Compiling "resources/public/out/main.js" failed.
clojure.lang.ExceptionInfo: failed compiling file:cljs/util/reactive.cljs
core.clj:4327 clojure.core/ex-info
compiler.clj:990 cljs.compiler/compile-file
compiler.clj:1051 cljs.compiler/compile-root
closure.clj:398 cljs.closure/compile-dir
closure.clj:437 cljs.closure/eval2650[fn]
closure.clj:301 cljs.closure/eval2578[fn]
closure.clj:451 cljs.closure/eval2637[fn]
View gist:9086538
The following code
(defn do-stuff [msg]
(hmatch msg
[:dog age name] (println "got a dog with age " age " and name " name)
[:cat cute? legs] (println "got a cat that is " cute? " cute and has " legs "legs")
[other] (println "got an unrecognized animal of type " other ))
View gist:9410532
PROJECT = websocket
DEPS = cowboy erldn
dep_cowboy = pkg://cowboy master
dep_erldn = master
View gist:9426556
{application, hello_erlang, [
{description, "Hello world with Cowboy!"},
{vsn, "0.1.0"},
{modules, []},
{registered, [hello_erlang_sup]},
{applications, [
View gist:9426939
Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source] [64-bit] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V6.0 (abort with ^G)
(websocket_example@> application:stop(websocket).
=INFO REPORT==== 8-Mar-2014::02:51:11 ===
application: websocket
exited: stopped
type: permanent
View gist:9443944
=INFO REPORT==== 9-Mar-2014::03:03:41 ===
application: websocket
exited: {bad_return,
View gist:9443959
## websocket_app.erl