Skip to content

Instantly share code, notes, and snippets.

View monkstone's full-sized avatar

Martin Prout monkstone

View GitHub Profile
@monkstone
monkstone / ToDo.txt
Created February 8, 2014 21:28
Areas Most in Need of Assistance for Ruby Processing
For the last 5 years or so I've been a 100% linux user, so my knowlege of other OS is somewhat rusty (previously Microsoft up to about XP, and no real Mac experience, so I've been guessing). So any input from that side of things is very welcome. For the same reason I have been necessarily been less interested in video capture open kinect etc, so any input there would also be very useful (but I should really get tooled up with arduino too).
However in the first instance I was just thinking about you adding a link to you open kinect work.
The future for ruby-processing is intimately tied to both jruby (and some interesting things are happening there jruby 9000 and jdk8 will likely bring performance improvements) and processing (and I've a feeling that processing-2.10+ has yet to bed in on the Mac?).
For more radical experiments I've created a clean fork https://github.com/monkstone/JRubyArt, where I'm experimenting with the development version of processing and jruby. Lately I've been experimenting with pry
@monkstone
monkstone / rp5.bsh
Last active August 29, 2015 13:57
JEdit for ruby-processing
/**
* rp5.bsh by monkstone 18 December 2013
* A jedit bean shell macro, to load environment, and call
* rp5 commando menu
*
* You must edit JAVA_HOME/GEM_HOME/GEM_PATH to match your system
*
*/
setenv("JAVA_HOME", "/opt/jdk1.8.0");
setenv("GEM_HOME", "/home/tux/.gem/ruby/2.0.0");
@monkstone
monkstone / Makefile
Last active August 29, 2015 14:02
A Makefile for Ruby Mode for Processing on linux (not archlinux)
TARGET=RubyMode.jar
SRC_ROOT_PATH=src
SRCDIR=$(SRC_ROOT_PATH)/processing/mode/ruby
OUTPUT_PATH=classes
DIST_PATH=~/sketchbook/modes/RubyMode/mode/
SRCS=$(wildcard $(SRCDIR)/*.java)
CLASSES=$(subst $(SRC_ROOT_PATH)/,$(OUTPUT_PATH)/,$(SRCS:%.java=%.class))
@monkstone
monkstone / code.java
Created June 6, 2014 05:59
Some snippets from my povriter code
/**
* beginRaw and endRaw should wrap what you want to ray-trace
*/
public void endRaw() {
if (this.getState(State.RECORDING)) {
parent.endRaw();
this.setState(State.RECORDED);
out.println(String.format(INFO_FORMAT, State.RECORDED));
}
@monkstone
monkstone / base.rb
Created July 12, 2014 09:49
Use require relative instead of all that __FILE__ magic
# -*- encoding : utf-8 -*-
SKETCH_PATH ||= ARGV.shift
SKETCH_ROOT ||= File.dirname(SKETCH_PATH)
require_relative '../../jruby_art'
require_relative '../../jruby_art/app'
module Processing
@monkstone
monkstone / runner.rb
Created July 17, 2014 07:52
Avoid install_jruby_complete
require 'ostruct'
require 'fileutils'
require 'rbconfig'
require_relative 'config'
require_relative 'version'
module Processing
# Utility class to handle the different commands that the 'k9' command
@monkstone
monkstone / runner.rb
Created August 26, 2014 18:51
JRubyArt alternative way of initializing jruby-complete
require 'ostruct'
require 'fileutils'
require 'rbconfig'
require_relative '../jruby_art/config'
require_relative '../jruby_art/version'
module Processing
# Utility class to handle the different commands that the 'rp5' command
@monkstone
monkstone / grey_circles.rb
Last active August 29, 2015 14:05
Modified grey circles to run without install
# grey circles : borrowed from https://github.com/quil/quil
require_relative "../lib/ribiprocessing"
class GreyCircles < Ribiprocessing::SimpleApp
def setup
size(600, 800)
frame_rate(2)
background(200)
ribiprocessing/examples$ jruby -J-Djruby.backtrace.style=raw grey_circles.rb
Picked up _JAVA_OPTIONS: -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel
grey_circles.rb:10 warning: ambiguous Java methods found, using background(int)
Exception in thread "Animation Thread" org.jruby.exceptions.RaiseException: (IOError) closed stream
at java.lang.Thread.getStackTrace(java/lang/Thread.java:1589)
at org.jruby.runtime.backtrace.TraceType$Gather.getBacktraceData(org/jruby/runtime/backtrace/TraceType.java:175)
at org.jruby.runtime.backtrace.TraceType.getBacktrace(org/jruby/runtime/backtrace/TraceType.java:39)
at org.jruby.RubyException.prepareBacktrace(org/jruby/RubyException.java:223)
at org.jruby.exceptions.RaiseException.preRaise(org/jruby/exceptions/RaiseException.java:213)
at org.jruby.exceptions.RaiseException.preRaise(org/jruby/exceptions/RaiseException.java:194)
@monkstone
monkstone / app.rb
Created October 18, 2014 14:38
Waiting for ruby-2.0 compatbility
require_relative 'helper_methods'
# The Processing module is a wrapper for JRubyArt
# Author:: Martin Prout (extends / re-implements ruby-processing)
module Processing
include_package 'processing.core' # imports the processing.core package.
include_package 'processing.event'
# This class is the base class the user should inherit from when making
# their own sketch.
#