Skip to content

Instantly share code, notes, and snippets.

View monkstone's full-sized avatar

Martin Prout monkstone

View GitHub Profile
@monkstone
monkstone / TestOs.java
Created June 3, 2018 07:15
Java Test For Operating Systems
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
public class TestOs {
private static boolean isWindows = false;
@monkstone
monkstone / installer.rb
Last active September 2, 2018 06:33
Add arm folder
# frozen_string_literal: false
require 'yaml'
VERSION = '3.4'.freeze # processing version
HOME = ENV['HOME']
# Abstract Installer class
class Installer
attr_reader :os, :sketch, :gem_root, :confd
def initialize(root, os)
@os = os
@monkstone
monkstone / .gemrc
Last active May 31, 2018 10:05
JRubyArt on the PI
---
gem: --no-document
@monkstone
monkstone / picreate_dependencies.sh
Last active November 14, 2018 07:06
Download and extract and install jruby for raspberrypi
JRUBY_URL="https://repo1.maven.org/maven2/org/jruby/jruby-dist/9.2.4.0/jruby-dist-9.2.4.0-bin.tar.gz"
printf "Downloading JRuby from:-\n%s\n" "$JRUBY_URL"
wget "$JRUBY_URL"
printf "Change directory to /opt\n"
CURRENT=$PWD
cd "/opt"
sudo tar xzvf "${CURRENT}/jruby-dist-9.2.4.0-bin.tar.gz"
sudo update-alternatives --install /usr/bin/jruby jruby /opt/jruby-9.2.4.0/bin/jruby 50
sudo update-alternatives --install /usr/bin/jirb jirb /opt/jruby-9.2.4.0/bin/jirb 50
sudo update-alternatives --install /usr/bin/jgem jgem /opt/jruby-9.2.4.0/bin/jgem 50
import processing.core.*;
import java.nio.ByteBuffer;
import com.jogamp.opengl.GL2;
import com.thomasdiewald.pixelflow.java.DwPixelFlow;
import com.thomasdiewald.pixelflow.java.dwgl.DwGLTexture;
import com.thomasdiewald.pixelflow.java.imageprocessing.DwShadertoy;
public class Shadertoy_VoronoiDistances extends PApplet {
@monkstone
monkstone / data.yml
Last active November 27, 2017 21:22
Reading and Writing YAML with jruby-complete.jar
---
bubbles:
- xpos: 20
ypos: 50
diameter: 200
emotion: happy
- xpos: 80
ypos: 60
diameter: 210
emotion: sad
@monkstone
monkstone / environment.txt
Created November 1, 2017 20:23
Error Report
java 9
Java(TM) SE Runtime Environment (build 9+181)
Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)
Linux tux-PC-2163 4.10.0-38-generic #42~16.04.1-Ubuntu SMP Tue Oct 10 16:32:20 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
jruby 9.2.0.0-SNAPSHOT (2.4.1) 2017-10-31 94484f7 Java HotSpot(TM) 64-Bit Server VM 9+181 on 9+181 +jit [linux-x86_64]
require 'propane'
require 'fileutils'
require 'digest/sha1'
require 'active_support/all'
require 'erb'
require 'fileutils'
class Generator < Propane::App
def self.get_class_name
self.name.to_s
end
require 'propane'
class MyApp < Propane::App
def self.code
@code
end
def self.path
@path
end
#!/usr/bin/env jruby
require 'propane'
class MyApp < Propane::App
def self.run code,path
@@code = code
@@path = path
MyApp.new
end