This file contains 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 escherize.kenning | |
(:require [selmer.parser :as parser])) | |
(defmacro ^:private env-map [] | |
`(apply zipmap [(mapv keyword (quote ~(keys &env))) (vector ~@(keys &env))])) | |
(defn ^:private resolve-kw [env kw] | |
(when-let [found-sym (or | |
(get env kw nil) | |
(try (eval (symbol kw)) |
This file contains 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
;; Middleware is a way to define a stack of operations applied to a function | |
;; call. It's a common pattern for parsing and handling http requests. A | |
;; handler function is wrapped by a middleware function. Let's narrow in on | |
;; http handling, then: | |
;; Let's call a 'handler function' a function that accepts as its input a | |
;; request, and returns a response. | |
(defn my-handler-fn [request] | |
{:status 200 :body "42"}) |
This file contains 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
{:nov-21 | |
[["9:00AM - 9:10AM" {:speaker "Welcome"}] | |
["9:10AM - 9:50AM" | |
[{:speaker "Derek Troy-West", | |
:title "Follow the Data: Product Development in Clojure", | |
:link "http://2019.clojure-conj.org/speaker-derek-troy-west/"}]] | |
["10:00AM - 10:40AM" | |
[{:speaker "Ariel Ortiz", | |
:title "The Hitchhikers Guide to Multiparadigm Programming", | |
:link "http://2019.clojure-conj.org/speaker-ariel-ortiz/"}]] |
This file contains 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 super-sratch.minstack) | |
(defprotocol Stack (push [this x]) (peek [this]) (pop [this])) | |
(defprotocol FindMin (find-min [this])) | |
(defprotocol FindMax (find-max [this])) | |
(defrecord fmm-stack [stack minstack maxstack] | |
Stack | |
(push [this x] | |
(merge this {:stack (vec (conj stack x))} |
This file contains 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 CoreGraphics | |
var display_id = CGMainDisplayID(); | |
// "BGRA" | |
print(display_id); |
This file contains 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 CoreGraphics | |
var display_id = CGMainDisplayID(); | |
print(display_id); |
This file contains 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 CoreGraphics | |
var id = CGMainDisplayID(); | |
print(id); |
This file contains 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 CoreGraphics | |
Any id = CGMainDisplayID(); | |
print(id) |