Skip to content

Instantly share code, notes, and snippets.

View monkstone's full-sized avatar

Martin Prout monkstone

View GitHub Profile
@monkstone
monkstone / picrate13_install.sh
Last active September 26, 2021 07:55
Auto Installer for picrate-2.5.0
#!/usr/bin/env bash
# Bash Script to install PiCrate and dependencies on Raspbian Buster
# JAVA_PATH="/opt/jdk13"
# JAVA_PATH="/usr/lib/jvm/java-8-openjdk-armhf"
JAVA_PATH="/usr/lib/jvm/java-11-openjdk-armhf"
JRUBY_VERSION="9.0.0.0"
MRI="2.5.0"
JRUBY_PATH="/opt/jruby-${JRUBY_VERSION}"
GEM="${HOME}/.gem/ruby/${MRI}"
GEMRC="${HOME}/.gemrc"
@monkstone
monkstone / picrate2_install.sh
Last active September 25, 2021 15:00
Installer file for picrate-2.0
#!/usr/bin/env bash
# Bash Script to install PiCrate and dependencies on Raspbian Buster
JAVA_PATH="/usr/lib/jvm/java-11-openjdk-armhf"
JRUBY_VERSION="9.3.0.0
MRI_RUBY="2.6.0"
JRUBY_PATH="/opt/jruby-${JRUBY_VERSION}"
GEM_RC="${HOME}/.gemrc"
GEM="${HOME}/.gem/ruby/${MRI_RUBY}"
JDK_PROFILE="/etc/profile.d/jdk_home.sh"
JDK_STRING="export JAVA_HOME=\$(readlink -f /usr/bin/javac | sed \"s:/bin/javac::\")"
@monkstone
monkstone / README.md
Created August 27, 2021 07:23
uniform_noise

UniformNoise by micycle

See source code You will need maven to build (no other dependencies)

@monkstone
monkstone / buster_install.sh
Last active June 20, 2021 09:04
Complete installer for PiCrate (on Buster Raspbian) including jdk and jruby dependencies
#!/usr/bin/env bash
# Bash Script to install PiCrate and dependencies on Raspbian Buster
# JAVA_PATH="/opt/jdk13"
JAVA_PATH="/usr/lib/jvm/java-11-openjdk-armhf"
# JAVA_PATH="/usr/lib/jvm/java-11-openjdk-armhf"
JRUBY_VERSION="9.2.19.0"
MRI_RUBY="2.5.0"
JRUBY_PATH="/opt/jruby-${JRUBY_VERSION}"
GEM="${HOME}/.gem/ruby/${MRI_RUBY}"
@monkstone
monkstone / vector_list.rb
Created May 8, 2021 06:49
Adaptor for GMP
java_import 'java.util.ArrayList'
java_import 'processing.core.PVector'
class VectorList
attr_reader :list
def initialize
@monkstone
monkstone / de_jong.rb
Created January 31, 2021 12:48
PiCrate De Jong Attractor sketch
# frozen_string_literal: true
require 'picrate'
class DeJongAttractor < Processing::App
B = -2.3
attr_reader :x, :y, :xn, :yn, :timer
def settings
size(450, 450)
@monkstone
monkstone / stochastic.rb
Created December 31, 2009 08:50
Stochastic LSystem Plants in ruby processing
########################################################
# stochastic_test.rb
#
# Lindenmayer System in ruby-processing by Martin Prout
########################################################
require 'stochastic_plant'
class Stochastic_Test < Processing::App
attr_reader :stochastic, :stochastic1, :stochastic2
@monkstone
monkstone / two_color_rule.rb
Created November 19, 2020 10:35
Wolfram Two Color Rule
class TwoColorRule
attr_reader :rule, :colors
def initialize(number:, colors:)
@colors = colors
@rule = create_rule_from_int(number)
end
def apply_rule(input)
input.each_cons(3) do |triple|
left, center, right = *triple
@monkstone
monkstone / manjaro_install.sh
Last active October 16, 2020 09:56
Installer for PiCrate on Manjaro ARM
#!/usr/bin/env bash
# Bash Script to install PiCrate and dependencies on Manjaro Arm
# anticipating JRuby-9.3.0.0 which will match MRI ruby-2.6
MRI_RUBY="2.6.0"
GEM_RC="${HOME}/.gemrc"
GEM="${HOME}/.gem/ruby/${MRI_RUBY}"
function gem_rc {
if [[ (-f ${GEM_RC}) ]]
then
@monkstone
monkstone / HET_Export.java
Created January 22, 2012 21:37
Exporting from processing sketches (using Hemesh library) directly to PovRAY mesh2
/**
* Modified to include ability to export as PovRAY mesh2 by Martin Prout 2012
*/
package wblut.hemesh.tools;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.nio.ByteBuffer;