Skip to content

Instantly share code, notes, and snippets.

View timsgardner's full-sized avatar

Tims Gardner timsgardner

  • Arcadia Technologies
  • Brooklyn, NY
View GitHub Profile
@timsgardner
timsgardner / hum
Created September 28, 2016 02:48
hummer
bla
@timsgardner
timsgardner / seascape.clj
Created September 4, 2016 01:35
towards seascape
(ns seascape.core
(:refer-clojure :exclude [aget])
(:use ;;arcadia.hydrate
arcadia.core
arcadia.linear
gamma-tools.core
;;[loop-nv.loop-nv :only [loop-nv recur-nv]]
)
(:require [gamma.api :as g]
;; [arcadia.updater :as updr]
@timsgardner
timsgardner / packages-debug.clj
Created September 3, 2016 20:36
packages debug
(def dependencies-log
(atom []))
(defn dependencies
[[group artifact version :as coord]]
(swap! dependencies-log conj coord)
(let [pom (pom-url group artifact version)]
(->> (download-string pom)
read-xml
make-map
@timsgardner
timsgardner / arcadia-setup.el
Last active September 7, 2016 03:09
arcadia emacs stopgap setup
;; requires: inf-clojure package
;; Some of this logic is half-assed stuff that struck me as a good
;; idea at the time. Tweak away. Really the only thing that matters is
;; aiming inf-clojure (the best lightweight clojure thing IMO) at the
;; node repl client.
(defun custom-on-clojure ()
(paredit-mode)
(inf-clojure-minor-mode) ;; this is aggressive
{:repl/injections (do (use 'clojure.repl) (use 'clojure.pprint))
:dependencies [[net.timsg/gamma-tools "0.1.0-SNAPSHOT"]]}
@timsgardner
timsgardner / simpler.clj
Created July 28, 2016 20:50
nothing to see here
;; ============================================================
;; embarrassingly, the following totally works
(def result (atom []))
(defn readr [prompt exit-code]
(let [input (clojure.main/repl-read prompt exit-code)]
(if (= input :tl)
exit-code
input)))
@timsgardner
timsgardner / println-async.clj
Created July 25, 2016 23:55
println doesn't work from other threads
;; seems to me this should work from the repl; it doesn't.
(let [out *out*]
(Thread.
(gen-delegate ThreadStart []
(binding [*out* out]
(println "hi")))))
@timsgardner
timsgardner / workshop-worked-code.clj
Created July 17, 2016 22:14
worked workshop code
(if true
1
0)
(use 'aracadia.core)
(def our-sphere
(create-primitive :sphere))
@timsgardner
timsgardner / arcadia_install.md
Last active July 17, 2016 19:43
arcadia installation

Open Unity. Make a new Unity project.

cd to that project's directory.

cd into Assets.

Exit Unity (not vitally necessary but a bit more stable).

git clone [email protected]:arcadia-unity/Arcadia.git

@timsgardner
timsgardner / RaycastHelper.cs
Created July 16, 2016 16:12
raycast helper
using UnityEngine;
using System.Collections;
public class RayCastHelper {
public static RaycastHit[] raycast(Ray ray) {
RaycastHit[] hits = new RaycastHit[0];
RaycastHit hit;
if (Physics.Raycast(ray, out hit)) {
hits = new RaycastHit[1];
hits[0] = hit;