Skip to content

Instantly share code, notes, and snippets.

Avatar

Jeremy Ashkenas jashkenas

View GitHub Profile
View gist:16091
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"
View gist:18112
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
View gist:30510
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
View gist:30514
# 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
View gist:36642
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'
View gist:65580
# 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
View gist:65582
# 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 Feb 20, 2009
A Demonstration of Minim in Ruby-Processing
View sounder.rb
# 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"
View gist:77232
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());
View gist:77236
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) {