View toxiclibs.rb
if RUBY_PLATFORM == 'java'
require 'toxiclibs.jar'
def import_class_list(list, string)
list.each { |klass| java_import format(string, klass) }
module Simulation
include_package 'toxi.sim.automata'
include_package 'toxi.sim.dla'
View atom-k9.cson
'.platform-linux atom-text-editor, .platform-win32 atom-text-editor':
'alt-ctrl-b': 'atom-k9:run'
'alt-ctrl-shift-w': 'atom-k9:watch'
'alt-ctrl-c': 'atom-k9:close'
'.platform-darwin atom-text-editor':
'alt-cmd-b': 'atom-k9:run'
'alt-cmd-shift-w': 'atom-k9:watch'
'alt-cmd-c': 'atom-k9:close'
static public final float map(float value,
float start1, float stop1,
float start2, float stop2) {
float outgoing =
start2 + (stop2 - start2) * ((value - start1) / (stop1 - start1));
String badness = null;
if (outgoing != outgoing) {
badness = "NaN (not a number)";
} else if (outgoing == Float.NEGATIVE_INFINITY ||
View debian.txt
nvidia-352 using Administration Driver Manager
sudo update-alternatives --install /usr/bin/java java /opt/jdk{version}/bin/java 100
sudo update-alternatives --install /usr/bin/jruby jruby /opt/jruby{version}/bin/jruby 100
sudo update-alternatives --config java
sudo update-alternatives --config jruby
alias jpry="jruby -e \"require 'pry'; binding.pry\""
export JAVA_HOME="/opt/jdk1.8.0_102"
export GEM_HOME="/home/tux/.gem/ruby/2.3.0"
View config.cson
'coffee': 'coffee'
'js': 'node'
'ruby': 'jruby'
'python': 'python'
'go': 'go run'
package org.monkstone;
import java.nio.file.WatchEvent;
interface CodeListener {
public void code_event(WatchEvent<?> event);
View pixellator.rb
load_library :chooser
attr_reader :img, :data, :skip, :poster
# Sophisticated example of file chooser.
KEYS = %w(0 4 5 6 7 8 9)
def settings
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
* Return a full path to an item in the data folder as a File object.
* See the dataPath() method for more information.
public File dataFile(String where) {
// isAbsolute() could throw an access exception, but so will writing
// to the local disk using the sketch path, so this is safe here.
File why = new File(where);
if (why.isAbsolute()) return why;
View blue_marble.rb
# Earth model with bump mapping, specular texture and dynamic cloud layer.
# Adapted from the THREE.js tutorial to processing by Andres Colubri,
# translated to JRubyArt by Martin Prout:
attr_reader :earth, :clouds, :earth_shader, :cloud_shader, :earth_rotation
attr_reader :clouds_rotation, :target_angle
IMAGES = %w(earthmap1k.jpg earthcloudmap.jpg earthcloudmaptrans.jpg earthbump1k.jpg earthspec1k.jpg).freeze
TEXTURES = %i(earth cloud alpha bump spec).freeze