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
(def google-font-url | |
"http://fonts.googleapis.com/css") | |
(def google-font-style | |
{:thin "100" | |
:thin-italic "100italic" | |
:light "300" | |
:light-italic "300italic" | |
:normal "400" | |
:normal-italic "400italic" |
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 dafuq.main | |
(:use-macros [secretary.macros :only [defroute]]) | |
(:require [goog.events :as events] | |
[secretary.core :as secretary]) | |
(:import goog.History)) | |
(defroute "/users/:id" {:keys [id]} | |
(.log js/console (str "USER: " id))) | |
(defroute "/" {:as params} |
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
DOC_PATH = "./Closure.docset/Contents/Resources/Documents" | |
DB_PATH = "./Closure.docset/Contents/Resources/docSet.dsidx" | |
CLOSURE_GIT_URL = "https://code.google.com/p/closure-library.docs/" | |
ICON_URL = "http://docs.closure-library.googlecode.com/git/static/images/16px.png" | |
# Setup | |
puts "Setting up..." | |
system("mkdir -p #{DOC_PATH}") | |
puts "Downloading documentation..." |
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
(defmacro defstyles [name & styles] | |
`(def ~name ~styles)) | |
(defmacro defstylesheet [name & body] | |
`(def ~name | |
(garden.core/css ~@body))) | |
(defstyles base | |
[:* :*:after :*:before | |
^:prefix {:box-sizing "border-box"}]) |
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 griddle.core | |
(:refer-clojure :exclude [+ - * /]) | |
(:require [clojure.java.io :as io] | |
[garden.arithmetic :refer [+ - * /]] | |
[garden.repl] | |
[garden.core :refer [css]] | |
[garden.stylesheet :refer [at-media]] | |
[garden.units :refer [px em em-div percent]] | |
[garden.def :refer [defstyles defstylesheet defrule defcssfn]])) |
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 watch-file [file] | |
(let [mtime-chan (chan 1) | |
mtime (fs/mod-time file)] | |
(go (loop [old-mtime mtime new-mtime (inc mtime)] | |
(when (not= old-mtime new-mtime) | |
(put! mtime-chan new-mtime)) | |
(recur new-mtime (fs/mod-time file)))) | |
mtime-chan)) |
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
(defun cider-eval-expression-at-point-in-repl () | |
(interactive) | |
(let ((form (cider-defun-at-point))) | |
;; Strip excess whitespace | |
(while (string-match "\\`\s+\\|\n+\\'" form) | |
(setq form (replace-match "" t t form))) | |
(set-buffer (cider-find-or-create-repl-buffer)) | |
(goto-char (point-max)) | |
(insert form) | |
(cider-repl-return))) |
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 ingredient.core | |
(:require [clojure.browser.repl] | |
[om.core :as om :include-macros true] | |
[sablono.core :as html :refer [html] :include-macros true] | |
[cljs.core.async :refer [put! chan close! sliding-buffer]]) | |
(:require-macros [cljs.core.async.macros :refer [go]])) | |
(enable-console-print!) | |
(def app-state |
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 do-tests [] | |
(when (seq @cemerick.cljs.test/registered-tests) | |
(cemerick.cljs.test/run-tests) | |
(reset! cemerick.cljs.test/registered-tests {}))) |
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 foo.core | |
(:refer-clojure :exclude [slurp])) | |
(defmacro slurp [file] | |
(clojure.core/slurp file)) | |
;; In CLJS | |
(ns bar.core | |
(:require [foo.core :include-macros true :refer [slurp]])) |