Skip to content

Instantly share code, notes, and snippets.

View monkstone's full-sized avatar

Martin Prout monkstone

View GitHub Profile
@monkstone
monkstone / basic.rb
Last active December 20, 2015 14:19
Alternative test setup for ruby-processing uses capture_io from minitest
def setup
size(300, 300)
frame_rate(10)
end
def draw
if frame_count == 3
puts "ok"
exit
end
@monkstone
monkstone / Rakefile
Last active December 20, 2015 17:59
jruby.sh
require 'rake/clean'
require 'shellwords'
JRUBY_VERSION = "1.7.4"
PROCESSING_VERSION = "2.0.2"
CLOBBER.include("processing-#{PROCESSING_VERSION}-linux64.tgz", "jruby-complete-#{JRUBY_VERSION}.jar")
desc "download and copy to ruby-processing"
task :default => [:download, :copy_ruby, :copy]
@monkstone
monkstone / processing.desktop
Last active December 21, 2015 05:19
processing.desktop
[Desktop Entry]
Comment[en_GB]=processing ide
Comment=processing ide
Exec=ksystraycmd /usr/bin/processing
GenericName[en_GB]=Processing-2.1.1
GenericName=Processing-2.1.1
Icon=/usr/share/pixmaps/processing.xpm
MimeType=
Name[en_GB]=processing
Name=processing
@monkstone
monkstone / control_panel.rb
Last active December 21, 2015 10:58
control_panel.rb
# Here's a little library for quickly hooking up controls to sketches.
# For messing with the parameters and such.
# These controls will set instance variables on the sketches.
# You can make sliders, checkboxes, buttons, and drop-down menus.
# (optionally) pass the range and default value.
module ControlPanel
class Slider < javax.swing.JSlider
@monkstone
monkstone / app.rb
Last active December 24, 2015 12:09
Alternative app.rb to explicitly import java classes
# version without embedded or online
# 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 so on.
require 'java'
require 'ruby-processing/config'
require 'ruby-processing/helper_methods'
require 'ruby-processing/library_loader'
@monkstone
monkstone / app.rb
Created November 10, 2013 08:44
A step toward rubygems (ArchLinux would actually work)
# version without embedded or online
# 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 so on.
require 'java'
require 'ruby-processing/config'
require 'ruby-processing/helper_methods'
require 'ruby-processing/library_loader'
# the processing root defined below is uniquely dependable on Archlinux, but something similar for OSX'
@monkstone
monkstone / build.xml
Created November 11, 2013 15:23
Build file for python mode processing
<?xml version="1.0"?>
<project name="ProcessingPythonMode" default="release" basedir="./">
<!-- Based on mode template http://github.com/martinleopold/TemplateMode -->
<!-- Note: now compiles two separate jars- one for python mode, and one that's a wrapper for the processing core that can run python files -->
<!-- You'll want to change these to compile. -->
<property name="processing.base" location="/usr/share/processing" /> <!-- The directory that you unpacked Processing into. -->
<property name="processing.sketchfolder" location="/home/tux/sketchbook" /> <!-- Your sketchbook folder. -->
<property name="java.target.bootclasspath" location="/opt/jdk1.7.0_45/jre/rt.jar" /> <!-- If you're using a newer jdk -->
@monkstone
monkstone / .rp5rc
Last active July 24, 2017 02:13
YAML configuration file for ruby-processing
#RP5_HOME: "" # windoes users should set this
PROCESSING_ROOT: "/usr/share/processing" # Works for ArchLinux
#PROCESSING_ROOT: "/home/tux/processing-2.2.1" # Other linux distros with user tux
#PROCESSING_ROOT: "/Applications/Processing.app/Contents/Java" # Path for Mac
#PROCESSING_ROOT: "C:\Java\processing-2.2.1" # if you follow PhiLhos suggestion for windoes
@monkstone
monkstone / Rakefile
Created November 20, 2013 07:33
Bleeding edge jruby-complete installer for ruby-processing
require 'rake/clean'
#JRUBY_VERSION = "1.7.8"
JRUBY_VERSION = "9000.dev"
CLOBBER.include("jruby-complete-#{JRUBY_VERSION}.jar")
desc "download, and copy to ruby-processing"
task :default => [:download, :copy_ruby]
@monkstone
monkstone / .bashrc
Last active December 29, 2015 04:29
Simplify your jruby setup on linux (avoid rvm and all that other crap)
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
alias ls='ls --color=auto'
PS1='[\u@\h \W]\$ '
export GEM_HOME="${HOME}/.gem/ruby/2.0.0"