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
Onyx code walkthrough 2/14/2016 | |
with Michael, Gardner, Bridget | |
* onyx.peer.min-peers-test | |
- most basic test | |
- every test needs onyx.api last - loads all defmethods | |
- min-peers need = # tasks | |
- put channels in atoms | |
- so fresh channels every time you reload | |
- onyx-id - us UUID so there are not collisions in 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
;; funny little macro to make interop bit less painful | |
(set! *warn-on-reflection* true) | |
(defmacro set-with! [obj [sym prop] & body] | |
`(let [obj# ~obj | |
~sym (. obj# ~prop)] | |
(set! (. obj# ~prop) (do ~@body)))) | |
;; use: ---------------------------------------- |
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 quaternion-exploration | |
(:import [UnityEngine Quaternion Vector3]) | |
(:use arcadia.core | |
arcadia.hydrate | |
clojure.repl | |
clojure.pprint)) | |
;; like emacs. kind of. | |
(defn kill! [x] | |
(let [spec (dehydrate x)] |
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
;; my first version taking advantage of the new shuffle generator introduced in 0.6... | |
(defn sublist1 | |
[coll] | |
(-> (gen/tuple (gen/shuffle coll) (gen/choose 0 (count coll))) | |
(gen/bind (fn [[coll* how-many]] | |
(gen/return (take how-many coll*)))))) | |
;; version inspired by http://roberto-aloi.com/erlang/notes-on-erlang-quickcheck/ | |
;; sublist(L0) -> | |
;; ?LET(L, [{E, eqc_gen:bool()} || E <- L0], [X || {X, true} <- L]). |
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 chords.core | |
(:refer-clojure :exclude [==]) | |
(:require [clojure.core.logic :refer :all] | |
[clojure.core.logic.fd :as fd] | |
[clojure.core.logic.pldb :as pldb] | |
[fipp.edn :refer (pprint) :rename {pprint fipp}])) | |
(pldb/db-rel note-name ^:index p) | |
(pldb/db-rel octave ^:index p) | |
(pldb/db-rel note ^:index p1 ^:index p2) |
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
; [org.clojure/tools.trace "0.7.5"] | |
(require '[clojure.tools.trace :as trace] | |
'[clojure.repl :as repl]) | |
(defmacro spit-to | |
"Dump diagnostics to a file" | |
[f & body] | |
`(spit ~f |
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
;;; TODO - drag-enter and -exit events : Right now, a component doesn't receive events for other components | |
;;; If a component responds to drag-over, it won't "revert" state until the drag ends. | |
;; NOTE - compiles with om 0.1.7. Needs updating to 0.2+ | |
(ns omdnd.ux | |
(:require-macros | |
[cljs.core.async.macros :refer [go alt!]] | |
) |
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 runes24.components.canvas | |
(:require [clojure.string :as str] | |
[cljs.core.async :as async] | |
[om.core :as om :include-macros true] | |
[sablono.core :as html :refer [html] :include-macros true] | |
[shodan.console :as console] | |
[runes24.components.meaning-rune :refer [meaning-rune]] | |
[runes24.utils :as utils] | |
)) |