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
/* Appirater English */ | |
kAppiraterMessageKey = "If you enjoy using %@, would you mind taking a moment to rate it? Thanks for your support! \n\n"; | |
kAppiraterTitleKey = "Rate %@"; | |
kAppiraterNoTextKey = "No, Thanks"; | |
kAppiraterYesTextKey = "Yes, Rate %@"; | |
kAppiraterReminderTextKey = "Remind me later"; |
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
(defmulti depth-comp (fn [a b] [(type a) (type b)])) | |
(defmethod depth-comp [::Point ::Edge] [p e] | |
(< (min-depth p) (min-depth e))) | |
(defmethod depth-comp [::Edge ::Point] [e p] | |
(< (min-depth p) (min-depth e))) |
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
(defrecord Node [id x y]) | |
(defrecord Point [node depth]) | |
(defrecord Edge [node-a node-b depth-a depth-b]) | |
(defrecord Face [nodes depths]) | |
(defprotocol TikZRenderer | |
(render [_] "TikZ representation.")) | |
(extend-protocol TikZRenderer | |
Node |
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 *node-counter*) | |
(defn next-id [] | |
(swap! *node-counter* inc)) | |
(defmacro with-counter [ & body] | |
`(binding [*node-counter* ~(atom 0)] | |
~@body)) |
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 geometry.shapes.cube | |
(:use [geometry :only (create-geometry with-geometry add-vertex add-face generate-edges-from-faces)] )) | |
(defn create [] | |
(let [shape (create-geometry)] | |
(with-geometry shape | |
(let [a (add-vertex 0 0 0) | |
b (add-vertex 3 0 0) | |
c (add-vertex 3 3 0) | |
d (add-vertex 0 3 0) |
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
Process: Interface Builder [44140] | |
Path: /Developer/Applications/Interface Builder.app/Contents/MacOS/Interface Builder | |
Identifier: com.apple.InterfaceBuilder3 | |
Version: 3.2.4 (804) | |
Build Info: InterfaceBuilder-8040000~4 | |
Code Type: X86-64 (Native) | |
Parent Process: launchd [79] | |
Date/Time: 2010-11-06 18:27:09.123 +0100 | |
OS Version: Mac OS X 10.6.4 (10F3061) |
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 -< [x & forms] (vec (for [form forms] `(-> ~x ~@form)))) | |
(defmacro -<< [x & forms] (vec (for [form forms] `(->> ~x ~@form)))) | |
(defmacro >- [form fn] `(apply ~fn ~form)) | |
(-> | |
(map | |
(fn [x] | |
(-> | |
(map #(-> | |
(-< (-> % inc load-sample-character (scale :height *H*)) |
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 my-amap | |
"Maps an expression across an array a, using an index named idx, and | |
return value named ret, initialized to a clone of a, then setting | |
each element of ret to the evaluation of expr, returning the new | |
array ret." | |
{:added "1.0"} | |
[a idx ret expr] | |
`(let [a# ~a | |
~ret (aclone a#)] | |
(loop [~idx (int 0)] |
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
;; | |
;; MobileOrg on iPad using Dropbox | |
;; | |
;; Settings basically copied from the screen cast, they differ | |
;; on the `org-mobile-inbox-for-pull` var wrt. the instructions | |
;; on the website. | |
;; - If MobileOrg is already linked to Dropbox. Unlink and delete | |
;; the ~/Dropbox/MobileOrg folder. |
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 & comp) | |
(def p partial) | |
(def $ apply) | |
(def kws (map (& keyword str) (seq "abcdefghijklmnopqrstuvwxyz"))) | |
(defn items [] | |
(for [i (range 10000)] | |
($ merge (for [kw kws] {kw i})))) | |
(def head ($ merge (for [kw kws] {kw []}))) |