Skip to content

Instantly share code, notes, and snippets.

View hlship's full-sized avatar

Howard M. Lewis Ship hlship

View GitHub Profile
$ lein uberjar ; java -jar target/fan-0.0.1-standalone.jar
Created /Users/hlship/workspaces/fexco/fan-suite/target/fan-0.0.1.jar
Created /Users/hlship/workspaces/fexco/fan-suite/target/fan-0.0.1-standalone.jar
17:31:35.663 [main] INFO fan.auth.main - Startup 5 nil
$ lein do clean, uberjar ; java -jar target/fan-0.0.1-standalone.jar
Compiling fan.auth.main
Compiling fan.auth.main
Created /Users/hlship/workspaces/fexco/fan-suite/target/fan-0.0.1.jar
Created /Users/hlship/workspaces/fexco/fan-suite/target/fan-0.0.1-standalone.jar
17:30:12.313 [main] INFO fan.auth.main - Startup 5 nil
~/workspaces/fexco/fan-suite
$
(defproject io.aviso/fan "0.0.1"
:aliases {"ci-build" ["with-profile" "ci-build,dev" "spec" "--reporter=xml" "--reporter=documentation" "--no-color"]}
:dependencies [[org.clojure/clojure "1.6.0"]
;; configuration
[io.aviso/tracker "0.1.0" :exclusions [org.clojure/tools.logging]]
:omit-source true
:aot :all
:profiles {:client {:name "client" :main fan.client.main}}
@hlship
hlship / feed.clj
Last active March 26, 2023 17:25
(def payment-codes-per-block 4096)
(defn create-payment-code-feed
[db]
(let [payment-code-feed (chan 10)]
(go-loop []
(let [block-id (allocate-block db)
block-start (* block-id payment-codes-per-block)]
(-> (onto-chan payment-code-feed
(->>
(defn next-payment-code
[db state]
(loop []
(let [initial @state
[[code new-state] (generate-payment-code db initial)]
(if (compare-and-set! state initial new-state)
code
(recur)))))
@hlship
hlship / gist:226c5830262ccbfab556
Created June 18, 2014 00:23
Not So Simple - Example for Threaded Conversation by Chris Conley - Updated for Version 5 (and Inform 6L02)
"Not So Simple"
Include Threaded Conversation by Chris Conley.
Section 1 - Model world
When play begins:
say "It is a long and riotous evening, full of unlikely stories and tall tales. But now most of the patrons have gone away to their rooms to sleep, or have passed out before the fire. Even the two black bitch pups are curled on the hearth-stone, snuffling through tiny wet noses, and pawing the air in sleep. Now is the time to find out whether the rumors that brought you to this neighborhood are true."
The Inn is a room. "The light is low and red. Above the fireplace hangs a map of this part of the Empire, and on the adjacent wall is the crimson and silver banner of Richard the Rose."
(defprotocol State (state [this]))
(defrecord StateImpl [state-value]
State
(state [this] state-value))
(-> (StateImpl. 42) state)
=> 42
(defprotocol State (state [this]))
(defrecord StateImpl [state-value]
State
(state [this] (:state-value this)))
(defrecord ConnectionManager [execution-mode active-connections databases]
component/Lifecycle
(start [component] ...)
(stop [component] ...))