Skip to content

Instantly share code, notes, and snippets.

View quephird's full-sized avatar

danielle quephird

View GitHub Profile
@quephird
quephird / binary-tweet.clj
Created August 2, 2012 20:44
Get a hold of the content of a tweet in binary format and convert it to text
; Inspired by a tweet from the self-aware Roomba to Carin Maier
(ns binary-tweet
(:require [clojure.xml :as xml]
[clojure.string :as string]))
(defn binary-to-text [s]
(apply str
(->> s
(partition-all 8)
@quephird
quephird / stereo-viewing.clj
Created August 17, 2012 20:29
stereo viewing
; This is a transliteration of the code listed here: http://wiki.processing.org/w/Stereo_viewing
; I stumbled on it in search of a means to get a handle to the GL context that
; exposes the lower level OpenGL methods.
(ns stereo-viewing
(:import [processing.core PConstants])
(:use [quil.core] [quil.applet])
)
(def rotation (atom 0))
@quephird
quephird / function-plot.clj
Created August 19, 2012 17:50
function plot
; This is _really_ hacky; I converted Processing code from within a presentation
; here, www.dsic.upv.es/~jlinares/grafics/processing_eng_7.pdf, to Clojure/quil code.
;
; OK, now... I have a slightly more interesting function in here, the ability to
; move the plot around and be able to zoom in and out. I'm not nuts about the zoom feature since
; there are clipping issues if you zoom too far out. But it's cool.
;
; Ugh... still too many magic numbers. And apparently you can't mix AWT nor Swing with Processing.
; I have to figure out how to embed a PApplet onto a Frame and add UI widgets to that. Only then can I
; allow user input of functions, x and y ranges, and the number of plot points.
@quephird
quephird / simple-love-clone.clj
Created September 13, 2012 20:19
simple love clone
(ns simple-love-clone
(:import [processing.core PConstants])
(:use quil.core quil.applet))
(def screen-w 1920)
(def screen-h 1080)
(def initial-stroke-color [0 255 255])
(def initial-diameter 250)
(def initial-stroke 30)
@quephird
quephird / flowers-clone.clj
Created October 4, 2012 21:22
flowers-clone
(ns flowers-clone
(:import [processing.core PConstants])
(:use quil.core quil.applet))
(def screen-w 1920)
(def screen-h 1080)
(def orange [240 101 34])
(def indigo [46 49 146])
(def border-width 10)
@quephird
quephird / saved-inspiration.clj
Created October 11, 2012 04:25
saved-inspiration
(ns saved-inspiration
(:use quil.core))
(def screen-w 1920)
(def screen-h 1080)
(def swath-colors
[[249 228 85]
[246 181 65]
[255 159 64]
@quephird
quephird / filling-time-inspiration.clj
Created October 19, 2012 20:51
filling-time-inspiration
(ns filling-time-inspiration
(:use quil.core))
(def screen-w 1920)
(def screen-h 1080)
(def background-color [0 0 0])
(def ellipses-per-ring 14)
(def slices-per-ellipse 7)
@quephird
quephird / starfield.clj
Created October 24, 2012 17:17
starfield
(ns starfield
(:use quil.core))
(def screen-w 1920)
(def screen-h 1080)
(defn setup []
(smooth)
(no-fill)
(stroke-cap :square)
@quephird
quephird / sempervivium.clj
Created October 30, 2012 21:08
sempervivium
(ns sempervivium
(:use quil.core quil.applet))
(def screen-w 1000)
(def screen-h 1000)
(def rosette-count 15)
(def leaf-color [110 148 73])
(def leaf-edge-color [220 255 146])
@quephird
quephird / FunWithFieldsAndReflection.java
Created November 15, 2012 19:05
Just demonstrating you can do Ruby-ish stuff in Java too.
import java.lang.reflect.Field;
public class FunWithFieldsAndReflection {
public static void main (String[] args) {
SalesForce sf = new SalesForce();
sf.setFun(false);
sf.setGreat(false);
sf.setWellArchitected(false);
sf.setWellDocumented(false);
sf.setRecommended(false);