This file contains hidden or 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 targeting-criteria | |
| (context "/accounts/:account-id" [account-id] | |
| (GET "/targeting_criteria" [] "") | |
| (GET "/targeting_criteria/:id" [id] id) | |
| (POST "/targeting_criteria/:id" [id] id) | |
| (PUT "/targeting_criteria/:id" [id] id) | |
| (DELETE "/targeting_criteria/:id" [id] id) | |
| (GET "/targeting_criteria/tailored_audiences" []) |
This file contains hidden or 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 handle-player-movement | |
| [key-handler] | |
| (let [coords (atom [0 0])] | |
| (.addEventListener key-handler goog.events.KEY | |
| (fn [e] | |
| (let [dir (case (.-keyCode e) | |
| KeyCodes.UP :up | |
| KeyCodes.DOWN :down | |
| KeyCodes.RIGHT :right | |
| KeyCodes.LEFT :left)] |
This file contains hidden or 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 move (fn [coords e] | |
| (case (.-keyCode e) | |
| KeyCodes.UP :up | |
| KeyCodes.DOWN :down | |
| KeyCodes.RIGHT :right | |
| KeyCodes.LEFT :left))) | |
| (defmethod move :up | |
| [[x y] e] | |
| [x (inc y)]) |
This file contains hidden or 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 move | |
| [[x y] e] | |
| (case (.-keyCode e) | |
| KeyCodes.UP [x (inc y)] | |
| KeyCodes.DOWN ... | |
| KeyCodes.RIGHT ... | |
| KeyCodes.LEFT ...))) | |
| (defn handle-player-movement | |
| [key-handler] |
This file contains hidden or 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
| (deftype ConcatVec [meta cnt cnt-a cnt-b a b ^:mutable __hash] | |
| ISequential | |
| Object | |
| (toString [coll] | |
| (pr-str* coll)) | |
| IWithMeta | |
| (-with-meta [coll meta] (ConcatVec. meta cnt cnt-a cnt-b a b __hash)) | |
| IMeta |
This file contains hidden or 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
| static NSString *readToken (PushbackReader *rdr) { | |
| NSMutableString *sb = [NSMutableString string]; | |
| unichar ch = [rdr read]; | |
| for (;;) { | |
| if (!ch || isWhitespace(ch)) | |
| return [NSString stringWithString:sb]; | |
| [sb appendFormat:@"%C", ch]; | |
| ch = [rdr read]; | |
| } | |
| return nil; |
This file contains hidden or 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
| data JSValue = JSString String | |
| | JSNumber Double | |
| | JSBool Bool | |
| | JSNull | |
| | JSObject [(String, JSValue)] | |
| | JSArray [JSValue] | |
| deriving (Eq, Ord, Show) | |
| getString :: JSValue -> Maybe String | |
| getString (JSString str) = Just str |
This file contains hidden or 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
| (deftemplate index | |
| (io/resource "public/html/index.html") | |
| [] | |
| [[:script (enlive/attr= :src "../js/main.js")]] | |
| (enlive/before (enlive/html [:script {:src "../js/out/goog/base.js"}])) | |
| [:body] | |
| (enlive/append (enlive/html [:script "goog.require(\"ag_console.start\")"]))) |
This file contains hidden or 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
| (defmethod native-size clojure.lang.BigInt | |
| "Determine the number of bits necessary to represent an integer of arbitrary precision." | |
| [n] | |
| (count (take-while pos? (iterate #(quot % 2) n)))) |
This file contains hidden or 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
| (defprotocol Typeable) | |
| (defprotocol Read) | |
| (defprotocol Show) | |
| (defprotocol Ord) | |
| (defprotocol Enumerable) | |
| (defprotocol Bounded) | |
| (defprotocol Eq) | |
| (deftype Bool [true?] | |
| Typeable |