Skip to content

Instantly share code, notes, and snippets.

View monkstone's full-sized avatar

Martin Prout monkstone

View GitHub Profile
@monkstone
monkstone / pentaflake.rb
Last active June 18, 2020 05:39
Fulfill Rosetta Code Pentaflake
# frozen_string_literal: true
require 'picrate'
THETA = Math::PI * 2 / 5
SCALE_FACTOR = (3 - Math.sqrt(5)) / 2
MARGIN = 20
class PentagonSketch < Processing::App
attr_reader :center, :pentagons, :radius
def settings
@monkstone
monkstone / GLSLVersions.txt
Last active June 8, 2020 08:11
Manjaro Video Driver
1.10, 1.20 and 1.0 ES, 3.0 ES
@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 / blue_marble.rb
Created April 14, 2020 09:43
Reafactored Blue Marble PiCrate
# frozen_string_literal: true
require 'picrate'
# Earth model with bump mapping, specular texture and dynamic cloud layer.
# Adapted from the THREE.js tutorial to processing by Andres Colubri,
# translated to picrate by Martin Prout:
# http://learningthreejs.com/blog/2013/09/16/how-to-make-the-earth-in-webgl/
class BlueMarble < Processing::App
attr_reader :cloud_shader, :clouds, :earth, :earth_shader, :earth_rotation
attr_reader :clouds_rotation, :target_angle
@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 / glxinfo.md
Last active March 21, 2020 15:07
glxinfo on raspberrypi

Legacy Renderer RaspberryPI 3B+

direct rendering: Yes
    GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer, 
    GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer, GLX_MESA_query_renderer, 
Extended renderer info (GLX_MESA_query_renderer):
OpenGL renderer string: llvmpipe (LLVM 9.0.1, 128 bits)
    GL_ARB_compute_shader, GL_ARB_conditional_render_inverted, 
    GL_MESA_ycbcr_texture, GL_NV_conditional_render, GL_NV_depth_clamp, 
    GL_ARB_conditional_render_inverted, GL_ARB_conservative_depth, 
@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 / more.sh
Last active November 14, 2019 19:26
More
#!/usr/bin/env bash
# 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.2.9.0"
MRI_RUBY="2.5.0"
JRUBY_PATH="/opt/jruby/${JRUBY_VERSION}"
GEM="${HOME}/.gem/ruby/${MRI_RUBY}"
function wget_jruby {
@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 / install.sh
Created November 3, 2019 14:17
Oracle jdk8 on raspberrypi
sudo update-alternatives --install /usr/bin/java java /opt/jdk1.8.0_231/jre/bin/jar 100
sudo update-alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_231/bin/javac 100
sudo update-alternatives --install /usr/bin/jar jar /opt/jdk1.8.0_231/bin/jar 100
export JAVA_HOME=/opt/jdk1.8.0_231
sudo jgem install jruby-launcher
Building native extensions. This could take a while...
Successfully installed jruby-launcher-1.1.10-java
1 gem installed