Skip to content

Instantly share code, notes, and snippets.

View jashkenas's full-sized avatar

Jeremy Ashkenas jashkenas

View GitHub Profile
graph "line" do
timeline :from => "jul 2008", :to => "yesterday",
:in => "months", :chunks => 120
data "List User Signups" do
time_query "select created_at from users
where (type = 'ListUser'
or converted_at is not null)
and disabled_at is null"
Wishing I had moved everything to Zenbe ... having Outlook issues (ugh). Rainy day in Midothian.
05:46 AM October 18, 2008 from mobile web
Stefanie Hahn
Discovering zenbe, a great webmail: http://www.zenbe.com
05:46 PM October 18, 2008 from Zenbe
yvesg
def display_in_an_applet
JRUBY_APPLET.setSize(@width, @height)
JRUBY_APPLET.background_color = nil
JRUBY_APPLET.double_buffered = false
JRUBY_APPLET.add self
JRUBY_APPLET.validate
# Add the callbacks to peacefully expire.
JRUBY_APPLET.on_stop { self.stop }
JRUBY_APPLET.on_destroy { self.destroy }
self.init
# Ruby-Processing is for Code Art.
# Send suggestions, ideas, and hate-mail to jashkenas [at] gmail.com
# Also, send samples and libraries.
#
# This class is a thin wrapper around Processing's PApplet.
# Most of the code here is for interfacing with Swing,
# web applets, going fullscreen, and drawing sliders.
#
# Revision 0.8
# - omygawshkenas
desc "Completely wipe and resurrect dev and test databases"
task :resurrect do
puts 'dropping and recreating dev and test dbs'
`rake db:drop RAILS_ENV=development`
`rake db:drop RAILS_ENV=test `
`rake db:create RAILS_ENV=development`
`rake db:create RAILS_ENV=test`
puts 'migrating dev back up'
`rake db:migrate`
puts 'loading reference data'
# Classes in org.jruby that were not loaded in a basic sketch
org.jruby.IErrno
org.jruby.JRubyApplet
org.jruby.JRubyClient
org.jruby.JRubyServer
org.jruby.JRubyService
org.jruby.MiniJava
org.jruby.RubyBigDecimal
org.jruby.RubyComplex
# Classes that thought that they originated in jruby-complete.jar
# that loaded in a basic Ruby-Processing sketch, but do not have
# corresponding source files.
com.kenai.constantine.Constant
com.kenai.constantine.ConstantSet
com.kenai.constantine.ConstantSet$ConstantIterator
com.kenai.constantine.Platform
com.kenai.constantine.Platform$1
com.kenai.constantine.Platform$2
@jashkenas
jashkenas / sounder.rb
Created February 20, 2009 04:15
A Demonstration of Minim in Ruby-Processing
# Sounder sounds for class
# Requires an active microphone to pick up anything
require 'ruby-processing'
class MinimTest < Processing::App
load_library "minim"
import "ddf.minim"
import "ddf.minim.analysis"
protected void registerNoArgs(RegisteredMethods meth,
String name, Object o) {
Class<?> c = o.getClass();
try {
Method method = c.getMethod(name, new Class[] {});
meth.add(o, method);
} catch (NoSuchMethodException nsme) {
die("There is no " + name + "() method in the class " +
o.getClass().getName());
public void fill(int rgb) {
public void fill(int rgb, float alpha) {
public void fill(float gray) {
public void fill(float gray, float alpha) {
public void fill(float x, float y, float z) {