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 clojure.gdx.myscreen | |
(:import (com.badlogic.gdx Gdx Screen) | |
(com.badlogic.gdx.scenes.scene2d Stage) | |
(com.badlogic.gdx.scenes.scene2d.ui Label Label$LabelStyle) | |
(com.badlogic.gdx.graphics Color) | |
(com.badlogic.gdx.graphics.g2d BitmapFont) | |
(com.badlogic.gdx.graphics.g2d SpriteBatch))) | |
(declare ^Stage stage) |
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 home-api-map | |
[] | |
{ :banner (model/pick :banner {:where {:slug "home"}}) | |
:intro-headline (model/pick :headline {:where {:slug "intro"}}) | |
:intro-slides (model/gather :slides {:where {:slug "intro"} :include {:slides {}}}) | |
:intro-highlights (model/gather :highlight {:where {:slug "intro"}}) | |
:tenants (model/gather :tenant) | |
:partners (model/gather :neighborhood-partner) | |
:whats-here-headline (model/pick :headline {:where {:slug "whats-here"}}) | |
:project-highlights (model/gather :project-highlights {:include {:highlights {}}}) |
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
#!/bin/bash | |
rm -rf alldeps/ | |
for i in $(lein classpath | tr : '\n' | grep "\.jar$") | |
do DIR=alldeps/$(basename $i .jar) | |
mkdir -p $DIR | |
pushd $DIR | |
unzip $i | |
popd |
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 best | |
[f [h & t]] | |
(reduce #(if (f %1 %2) %1 %2) h t)) | |
(defn most | |
[f [h & t :as coll]] | |
(if (seq coll) | |
(reduce (fn [[wins wins-score] x] | |
(let [x-score (f x)] | |
(if (> wins-score x-score) |
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 now-plus [n] | |
"Returns current time plus `n` minutes as string" | |
(let [f (SimpleDateFormat. "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")] | |
(.setTimeZone f (TimeZone/getTimeZone "GMT" )) | |
(.format f (Date. (+ (System/currentTimeMillis) (* n 60 1000)))))) |
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 driver | |
(:require type)) | |
(defn reproduce | |
[] | |
(println (= type.Type (class (type/->Type))))) |
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
{["e" "i"] 1864658105, | |
["c" "e"] 366389557, | |
["w" "e"] 693805971, | |
["v" "w"] 311238704, | |
["o" "v"] 1348289060, | |
["g" "o"] 1895243578, | |
["a" "t"] 443334995, | |
["h" "h"] 21807643, | |
["t" "m"] 797779624, | |
["l" "h"] 1961272944, |
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
Clojure 1.7.0 | |
user=> (require '[clojure.core.async :as > :refer [chan go go-loop thread <! >! <!! >!!]]) | |
nil | |
user=> (def requests (chan)) | |
#'user/requests | |
user=> (def results (chan)) | |
#'user/results | |
user=> (go-loop [result "\n\ninit\n\n"] (println "got" (subs result 0 (min (count result) 10))) (recur (<! results))) | |
#object[clojure.core.async.impl.channels.ManyToManyChannel 0x45273d40 "clojure.core.async.impl.channels.ManyToManyChannel@45273d40"] | |
user=> got |
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 client (:require [world :refer [map->World]])) | |
(map->World {}) |
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
$ rlwrap java -cp bench.jar clojure.main | |
Clojure 1.7.0 | |
user=> (deftype T [] Object (finalize [this] (println "gone"))) | |
user.T | |
user=> (let [t (T.)] (type t)) | |
user.T | |
user=> (reduce +' (range 999999999)) | |
gone |
OlderNewer