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
<h1>Sparkly Corn Soup</h1> | |
<p>Recipe #1:</p> | |
<p>Here's the recipe:</p> | |
<ul> | |
<li>First you put something sparkly</li> | |
<li>Then, you put some corn</li> | |
<li>Then, you put some cinnamon</li> |
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 #^{:doc "Ignore stack traces from these patterns"}ignore-files | |
[".*\\.java" "swank-clojure\\.clj" "boot\\.clj" "unit_test\\.clj"]) | |
(defn filter-stacktrace | |
"Filters a stacktrace removing file patterns defined in ignore-files." | |
[t] | |
(let [es (to-list (. t getStackTrace)) | |
top (take-while #(not (.contains (.getClassName %) "unit_test$run_test__")) es) | |
cljs (filter (comp not nil? (memfn getFileName)) top) |
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 wrap-base | |
(:use [clojure.contrib.pprint :only (cl-format pprint)])) | |
(def *print-base* 10) | |
;;; borrowed frm cl-format | |
(defn- integral? | |
"returns true if a number is actually an integer (that is, has no fractional part)" | |
[x] | |
(cond |
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 arity) | |
(defn make-proxy-args [n] (map #(gensym (str "a" (char (+ 48 %)) "-")) (range n))) | |
(defn make-proxy-decl [old-f-sym n] | |
(let [proxy-args (make-proxy-args n)] | |
`([~@proxy-args] | |
(apply ~old-f-sym ~(apply vector proxy-args))))) |
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 outline-copy-visible (keepp) | |
"Create a copy of the visible part of the current buffer and add | |
it to the kill ring so it can be copied into other buffers or programs. | |
The copy is created in a temporary buffer and removed after use. | |
As a special case, if you have a prefix arg KEEPP, the temporary | |
buffer will not be removed but presented to you so that you can | |
continue to use it. | |
This function is derived from org-export-visible." | |
(interactive "P") | |
(let* ((file buffer-file-name) |
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
tom@monet:~/src/clj/dashboard$ lein deps | |
Downloading: org/apache/xmlrpc/xmlrc/3.1.3/xmlrc-3.1.3.pom from central | |
Downloading: org/apache/xmlrpc/xmlrc/3.1.3/xmlrc-3.1.3.pom from clojure | |
Downloading: org/apache/xmlrpc/xmlrc/3.1.3/xmlrc-3.1.3.pom from clojure-snapshots | |
Downloading: org/apache/xmlrpc/xmlrc/3.1.3/xmlrc-3.1.3.pom from clojars | |
Downloading: org/apache/xmlrpc/xmlrc/3.1.3/xmlrc-3.1.3.pom from central | |
Downloading: org/apache/xmlrpc/xmlrc/3.1.3/xmlrc-3.1.3.jar from central | |
Downloading: org/apache/xmlrpc/xmlrc/3.1.3/xmlrc-3.1.3.jar from clojure | |
Downloading: org/apache/xmlrpc/xmlrc/3.1.3/xmlrc-3.1.3.jar from clojure-snapshots | |
Downloading: org/apache/xmlrpc/xmlrc/3.1.3/xmlrc-3.1.3.jar from clojars |
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
# I want to be able to spread multiple lambda args across multiple lines, but | |
# I'm unclear on the syntax | |
# The following gives me | |
# "Error: In XXX/dashboard.coffee, Parse error on line 125: Unexpected ','" | |
# whether I put it on one line or multiple lines. | |
$("ul.topnav > li").hover( | |
( -> $(this).find("span").addClass "subhover"), | |
( -> $(this).find("span").removeClass "subhover")) |
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
(autoload 'paredit-mode "paredit" "Parenthesis editing minor mode" t) | |
(eval-after-load "clojure-mode" | |
'(progn | |
(defun clojure-paredit-hook () (paredit-mode +1)) | |
(add-hook 'clojure-mode-hook 'clojure-paredit-hook) | |
(defun clojure-indent-hook () | |
(define-clojure-indent (clone-for 1) (at 1))) | |
(add-hook 'clojure-mode-hook 'clojure-indent-hook) |
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
tom@renoir:~/src/clj/autodoc-release$ lein slamhound src/autodoc/build_html.clj | |
Warning: *debug* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherw\ | |
ise. Please either indicate ^:dynamic *debug* or change the name. | |
Warning: *swank-source-path* not declared dynamic and thus is not dynamically rebindable, but its name sug\ | |
gests otherwise. Please either indicate ^:dynamic *swank-source-path* or change the name. | |
Warning: *swank-source-path* not declared dynamic and thus is not dynamically rebindable, but its name sug\ | |
gests otherwise. Please either indicate ^:dynamic *swank-source-path* or change the name. | |
Warning: *swank-compile-path* not declared dynamic and thus is not dynamically rebindable, but its name su\ | |
ggests otherwise. Please either indicate ^:dynamic *swank-compile-path* or change the name. | |
Warning: *swank-compile-path* not declared dynamic a |
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> (deftype Foo [a b c]) | |
user.Foo | |
user> (def f (Foo. "The quick brown fox jumped over the" "lazy dog" "Friends, Romans, and Countrymen, lend me your ears")) │···· | |
#'user/f | |
user> (def e (Foo. 1 2 3)) | |
#'user/e | |
user> (defn augmented-dispatch [f] | |
(if (instance? Foo f) | |
(cl-format true | |
"~<{~;~<a ~_~w~:>, ~_~<b ~_~w~:>, ~_~<c ~_~w~:>~;}~:>" |
OlderNewer