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
| 4 Force of Will | |
| 4 Brainstorm | |
| 4 Ponder | |
| 4 Preordain | |
| 4 Show and Tell | |
| 4 Omniscience | |
| 4 Cunning Wish | |
| 2 Spell Pierce | |
| 4 Gitaxian Probe | |
| 4 Dig Through Time |
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
| # A simple way to create private constants without all the noise of ruby's 'private_constant' | |
| # | |
| # Before: | |
| # class Foo | |
| # FOO = "bar" | |
| # private_constant :FOO | |
| # end | |
| # | |
| # After: | |
| # class Foo |
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 while-> | |
| "As long as the predicate holds true, threads | |
| the expr through each form (via `->`). Once pred returns | |
| false, the current value of all forms is returned." | |
| [pred expr & forms] | |
| (let [g (gensym) | |
| pstep (fn [step] `(if (~pred ~g) (-> ~g ~step) ~g))] | |
| `(let [~g ~expr | |
| ~@(interleave (repeat g) (map pstep forms))] | |
| ~g))) |
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
| ; Postgres listen/notify in Clojure using http://impossibl.github.io/pgjdbc-ng/ | |
| ; in project.clj dependencies | |
| ; [com.impossibl.pgjdbc-ng/pgjdbc-ng "0.5"] | |
| (ns pglisten.core | |
| (:import [com.impossibl.postgres.jdbc PGDataSource] | |
| [com.impossibl.postgres.api.jdbc PGNotificationListener])) |
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
| service Calculator { | |
| i64 sum(1: i64 a, 2: i64 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
| import types | |
| # Helpers | |
| # ======= | |
| def _obj(): | |
| '''Dummy object''' | |
| return lambda: None | |
| _FILLER = _obj() |
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 example.file-size-rolling-appender | |
| "Rolling file appender." | |
| (:require [clojure.java.io :as io] | |
| [taoensso.timbre :as timbre]) | |
| (:import [java.io File] | |
| [java.text SimpleDateFormat])) | |
| ;; TODO Test port to Timbre v4 | |
| (defn- rename-old-create-new-log [^File log ^File old-log] |
OlderNewer