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
;; | |
;; Author: Malcolm Sparks | |
(defun closeup-parens () | |
(interactive) | |
(save-excursion | |
(replace-regexp "[ \t\n]+)" ")" nil (point-min) (point-max)) | |
(replace-regexp "([ \t\n]+" "(" nil (point-min) (point-max)) | |
(replace-regexp "[ \t\n]+}" "}" nil (point-min) (point-max)) | |
(replace-regexp "[ \t\n]+]" "]" nil (point-min) (point-max)) | |
)) |
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 mqtt-insertion.core | |
(:require [clojure.core.async :refer :all]) | |
(:import (org.eclipse.paho.client.mqttv3 | |
MqttCallback | |
MqttAsyncClient | |
MqttConnectOptions | |
MqttDeliveryToken | |
MqttException | |
MqttMessage | |
MqttTopic |
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 mqtt-insertion.core | |
(:require [clojure.core.async :refer :all]) | |
(:import (org.eclipse.paho.client.mqttv3 | |
MqttCallback | |
MqttAsyncClient | |
MqttConnectOptions | |
MqttDeliveryToken | |
MqttException | |
MqttMessage | |
MqttTopic |
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 bruce.core) | |
(defn create-hand [] | |
(->> (for [suit [:clubs :diamonds :hearts :spade] | |
rank [:ace :two :three :four :five | |
:six :seven :eight :nine :ten | |
:jack :queen :king]] | |
{:suit suit :rank rank}) | |
shuffle | |
(take 5))) |
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 funky-style [] | |
[ [:link {:href "http://fonts.googleapis.com/css?family=Bonbon|Spicy+Rice|Gloria+Hallelujah|Faster+One" :type "text/css" :rel "stylesheet"}] | |
[:style "h1 { font-family: \"Gloria Hallelujah\""]] | |
) |
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
#=(eval | |
(-> (clojure.core/read-string (slurp "/home/malcolm/src/azondi/config.clj")) | |
((partial clojure.walk/postwalk | |
(fn [x] (if-let [path (and (string? x) (second (re-matches #"\.\./azondi(.*)" x)))] | |
(str "/home/malcolm/src/azondi" path) | |
x)))) | |
;; Comment these 3 | |
#_(update-in [:jig/components] dissoc |
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 autowire-dependencies-satisfying | |
"Return a dependency map, adding dependencies between the given | |
key (of the dependant) and any components in the given system map that | |
satisfy the given protocol." | |
[dependency-map system-map dependant-key proto] | |
(merge-with merge dependency-map (normalize-dependency-map {dependant-key (vec (keep (fn [[k v]] (when (satisfies? proto v) k)) (seq system-map)))}))) |
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
### Keybase proof | |
I hereby claim: | |
* I am malcolmsparks on github. | |
* I am malcolmsparks (https://keybase.io/malcolmsparks) on keybase. | |
* I have a public key whose fingerprint is D7EA C082 D28B C792 3327 9A32 06CE E45E C93B 3AF9 | |
To claim this, I am signing this object: |
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 perf.test | |
(:require | |
[org.httpkit.client :refer (request) :rename {request http-request}] | |
[clojure.core.async :refer (chan >! <! go go-loop)] | |
[clojure.core.match :refer (match)] | |
[ring.mock.request :refer (request) :rename {request mock-request}])) | |
(defn with-profiling [p & {:keys [callback]}] | |
(let [start (System/nanoTime) | |
dur (atom nil)] |
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
(defproject alephplay "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.7.0-alpha4"] | |
[aleph "0.4.0-alpha9" :exclusions [org.clojure/clojure]]]) | |
(ns alephplay.core |
OlderNewer