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
(ns webrtc.app) | |
(def gum (js* "Modernizr.prefixed('getUserMedia',navigator);")) | |
(defn webrtc-ready [] | |
(let [on-success (fn [stream] (let [video (. js/document (querySelector "video")) | |
Window (.-URL js/window) | |
media (Window.createObjectURL stream)] | |
(set! (.-src video) media))) | |
on-error (fn [err] (. js/console (log (str "navigator.getUserMedia error: ") err))) |
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
(ns heart.app | |
(:require [quil.core :as q :include-macros true] | |
[quil.middleware :as m])) | |
(set! *print-length* 10) | |
(defn rotate-x [theta x y] | |
(- (* x (Math/cos theta)) | |
(* y (Math/sin theta)))) |
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
(ns sierpinski-triangle.app | |
(:require [quil.core :as q :include-macros true] | |
[quil.middleware :as m])) | |
(defn setup [] | |
(q/frame-rate 30) | |
{:corner-2 [(/ (q/height) 4) (/ (* -1 (/ (q/height) 2) (Math/sqrt 3)) 2)] | |
:corner-3 [(/ (q/height) 2) 0] | |
:triangles [[0 0 (/ (q/height) 2) (* -1 (/ (q/height) 2) (Math/sqrt 3)) (q/height) 0]] | |
:max-iterations 5}) |
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 my-map [f coll] | |
(loop [acc [] | |
c coll] | |
(if (empty? coll) | |
acc | |
(let [frst (first c) | |
rst (rest c) | |
new-val (conj acc (f frst))] | |
(if (empty? rst) | |
new-val |
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
#!/usr/bin/env ruby | |
files = File.open(ARGV.first) do|file| | |
Marshal.load(file) | |
end | |
latex = File.open(ARGV.last,'w') | |
files.each do |x| |