This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn until | |
[p] | |
(fn [rf] | |
(let [p? (volatile! false)] | |
(fn | |
([x] (rf x)) | |
([x y] | |
(if @p? | |
x | |
(do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require | |
'[clojure.java.shell :as sh] | |
'[clojure.edn :as edn]) | |
(set! *warn-on-reflection* true) | |
(defn next-version [version] | |
(when version | |
(let [[a b] (next (re-matches #"(.*?)([\d]+)" version))] | |
(when (and a b) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# i3 config file (v4) | |
# | |
# Please see http://i3wm.org/docs/userguide.html for a complete reference! | |
set $mod Mod4 | |
# Font for window titles. Will also be used by the bar unless a different font | |
# is used in the bar {} block below. | |
font pango:terminus 10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn unchunked-sequence [xform coll] | |
(->> coll | |
(clojure.lang.RT/iter) | |
(clojure.lang.TransformerIterator/create xform) | |
(clojure.lang.IteratorSeq/create))) | |
;; realizes 10 values | |
(first | |
(unchunked-sequence (comp (map #(do (prn %) %)) | |
(partition-all 10)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro ns-local | |
"Creates a locally aliased namespace matching supplied symbol" | |
[k] | |
`(alias ~k (create-ns (symbol (str *ns* "." (str ~k)))))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Build and slim Erlang | |
# Change the line below if you want to use a different version of Erlang | |
# (Keep in mind that patches may not apply cleanly) | |
erlang_version=otp_src_R14B03 | |
erlang_source_file:=$(PACKAGE_SOURCES)/$(erlang_version)/$(erlang_version).tar.gz | |
erlang_root=$(GTH_ERLANG_ROOT)/$(erlang_version) | |
target_prefix=/opt/erlang |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[translation:info] 2.7.9 (default, Mar 8 2015, 00:52:26) | |
[translation:info] [GCC 4.9.2] | |
[platform:msg] Set platform with 'host' cc=None, using cc='gcc', version='Unknown' | |
[translation:info] Translating target as defined by target | |
[platform:execute] gcc -c -O3 -pthread -fomit-frame-pointer -Wall -Wno-unused /tmp/usession-default-3/gcctest.c -o /tmp/usession-default-3/gcctest.o | |
[platform:execute] gcc -c -O3 -pthread -fomit-frame-pointer -Wall -Wno-unused /tmp/usession-default-3/gcctest.c -o /tmp/usession-default-3/gcctest.o | |
[platform:execute] gcc /tmp/usession-default-3/gcctest.o -pthread -Wl,--export-dynamic -lrt -o /tmp/usession-default-3/gcctest | |
[platform:execute] gcc -c -O3 -pthread -fomit-frame-pointer -Wall -Wno-unused /tmp/usession-default-3/platcheck_0.c -o /tmp/usession-default-3/platcheck_0.o | |
[platform:execute] gcc /tmp/usession-default-3/platcheck_0.o -pthread -Wl,--export-dynamic -lrt -o /tmp/usession-default-3/platcheck_0 | |
[platform:execute] gcc -c -O3 -pthread -fomit-frame-pointer -Wall -Wno-unuse |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn foo | |
[{:keys [x] | |
:or {x (println :set-default)}}] | |
x) | |
user> (foo {:x 1}) | |
:set-default | |
1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn put! | |
"Takes a `ch`, a `msg`, a fn that enables backpressure, one that disables it, | |
and a no-arg function which, when invoked, closes the upstream source." | |
([ch msg suspend! resume! close!] | |
(let [status (atom ::sending)] | |
(async/put! ch msg | |
(fn [result] | |
(if-not result | |
(when close! (close!)) | |
(do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns foami.core | |
"FOreign Asynchronous Mechanism Interop" | |
(:require [clojure.core.async :as async])) | |
(defn put! | |
"Takes a `ch`, a `msg`, a single arg function that when passed `true` enables backpressure | |
and when passed `false` disables it, and a no-arg function which, when invoked, closes the | |
upstream source." | |
[ch msg backpressure! close!] | |
(let [status (atom :sending)] |