Skip to content

Instantly share code, notes, and snippets.

View Raynes's full-sized avatar

Anthony Grimes Raynes

View GitHub Profile

Keybase proof

I hereby claim:

  • I am Raynes on github.
  • I am raynes (https://keybase.io/raynes) on keybase.
  • I have a public key whose fingerprint is 115E 8C72 AE1D FBFD D4D8 786B A56A 26A6 72B0 8826

To claim this, I am signing this object:

(defroutes chapter-routes
;; Example story-slug: 42-my-first-story
;; Example chapter-slug: 99-introduction
;; (util/parse-uid "42-my-first-story") -> 42
;; (util/parse-uid "99-introduction") -> 99
(GET "/chapters/:chapter-slug" [story-slug chapter-slug]
(when-let [story-uid (util/parse-uid story-slug)]
(when-let [chapter-uid (util/parse-uid chapter-slug)]
(when-let [story (db/find-story-by-uid story-uid)]
(when-let [chapter (db/find-chapter-by-uid chapter-uid)]
@Raynes
Raynes / gist:6643618
Last active December 23, 2015 13:39 — forked from bitemyapp/gist:6643575
(defn ?assoc-transform
"(?assoc-transform {:a 1} :a 2 sequential? vector) => {:a [1 2]}"
[m k v test transform]
(let [val (m k)]
(assoc m k
(if-let [okay (test val)]
v
(transform val v)))))
<html>
<head>
</head>
<body>
</body>
</html>
(defproject noir-example "0.1.0"
:description "An example of a noir project"
:dependencies [[org.clojure/clojure "1.4.0"]
[noir "1.3.0"]]
:plugins [[lein-ring "0.7.5"]]
:ring {:handler noir-example.server/handler}
:main noir-example.server)
Making install in src
/bin/sh ../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I.. -Wall -c -o icns_debug.lo icns_debug.c
/bin/sh ../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I.. -Wall -c -o icns_element.lo icns_element.c
/bin/sh ../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I.. -Wall -c -o icns_family.lo icns_family.c
/bin/sh ../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I.. -Wall -c -o icns_image.lo icns_image.c
libtool: compile: cc -DHAVE_CONFIG_H -I. -I.. -Wall -c icns_image.c -fno-common -DPIC -o .libs/icns_image.o
libtool: compile: cc -DHAVE_CONFIG_H -I. -I.. -Wall -c icns_family.c -fno-common -DPIC -o .libs/icns_family.o
libtool: compile: cc -DHAVE_CONFIG_H -I. -I.. -Wall -c icns_element.c -fno-common -DPIC -o .libs/icns_element.o
libtool: compile: cc -DHAVE_CONFIG_H -I. -I.. -Wall -c icns_debug.c -fno-common -DPIC -o .libs/icns_debug.o
brew: superenv removed: -Wall
$(document).ready(function(){
$("#signin").click(function(event) {
alert("SIGN THE FUCK IN.")
})
});
(defn ^{:skip-wiki true} route->name
"Parses a set of route args into the keyword name for the route"
[route]
(cond
(keyword? route) route
(fn? route) (keyword (:name (meta route)))
:else (let [res (first (parse-route [{} [route]] 'compojure.core/GET))]
(keyword (:fn-name res)))))
<Raynes> amalloy: Also, my pastebin currently has 4clojure's favicon. :p Because the browser had it cached from my testing a few days ago.
[22:26]
<amalloy> Raynes: just rm -rf ~, that should take care of the cached favicon
[22:27]
<Raynes> omg rly im tots gunna tr that
<Raynes> amalloy: omgwtf u delted my home [22:44]
<amalloy> Raynes: i should totally have done like a sudo mv ~raynes /tmp/lol-stole-it
refheap.models.paste> (binding [session/*noir-session* (atom {})] (paste {:description "A paste." :language "Haskell" :contents "main = putStrLn \"Hello, World!\""}))
{:paste-id 6, :user "anonymous", :description "A paste.", :language "Haskell", :contents "<div class=\"highlight\"><pre><span class=\"nf\">main</span> <span class=\"ow\">=</span> <span class=\"n\">putStrLn</span> <span class=\"s\">&quot;Hello, World!&quot;</span>\n</pre></div>\n", :_id #<ObjectId 4ef6675cd6c4de4c8a84efed>}