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
(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)] |
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
(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))))) |
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
<html> | |
<head> | |
</head> | |
<body> | |
</body> | |
</html> |
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
#include <iostream> | |
using namespace std; | |
char x[27]; | |
char c = 'a'; | |
int main() | |
{ | |
for (int i = 0; i < 26; i++) { | |
x[i] = c; |
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
(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) |
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
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 |
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
$(document).ready(function(){ | |
$("#signin").click(function(event) { | |
alert("SIGN THE FUCK IN.") | |
}) | |
}); |
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
(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))))) |
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
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\">"Hello, World!"</span>\n</pre></div>\n", :_id #<ObjectId 4ef6675cd6c4de4c8a84efed>} |
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
user> (pygmentize "clojure" "(+ 3 3)") | |
"<div class=\"highlight\"><pre><span class=\"p\">(</span><span class=\"nb\">+ </span><span class=\"mi\">3</span> <span class=\"mi\">3</span><span class=\"p\">)</span>\n</pre></div>\n" |
NewerOlder