Skip to content

Instantly share code, notes, and snippets.

Rick Companje companje

Block or report user

Report or block companje

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
companje / AddToAlbum.js
Created May 11, 2019
AppleScript JXA - Apple Photos script for organising photos into albums.
View AddToAlbum.js
//Add this code to a new ‘Quick Action’ in ‘Automator’ and assign a keyboard shortcut to it for ideal workflow.
//by Rick Companje, May 2019
var app = Application("Photos")
app.includeStandardAdditions = true
var sel = app.selection();
if (sel.length>0) {
//show list with all album names ordered
View download-scans.php
for ($i=$minr; $i<$minr+$count; $i++) {
companje / Earth Elevation
Last active Mar 14, 2019
Earth Elevation Curve
View Earth Elevation

Earth % of the surface covered with water. Going from lowest point to highest point.

Progress Surface % covered with water
0.000 0.000
0.010 0.001
0.020 0.001
0.030 0.002
0.040 0.003
0.050 0.007
companje / (older) waterworld.glsl
Last active Mar 14, 2019
Water vs Land on Earth
View (older) waterworld.glsl
uniform sampler2D heightmap;
uniform sampler2D palette;
uniform sampler2D bordermap;
varying vec4 vertTexCoord;
uniform float progress;
void main() {
vec4 heightColor = texture2D(heightmap,;
companje / len-lye.pde
Created Mar 12, 2019
Len Lye filmstrip
View len-lye.pde
Movie mov;
int w, h;
int rows=15;
void setup() {
h = height/rows;
w = int(4/3.*h);
companje / PanZoom.pde
Last active Feb 11, 2019
Pan and Zoom with mouse in Processing using Texture Coordinates
View PanZoom.pde
//I wrote this example to explain how to Zoom and Pan with the mouse in Processing.
//It uses texture coordinates (texcoords). Enjoy!
//Rick Companje, Feb. 2019
float tx, ty;
float scale;
PImage img;
float xratio, yratio;
float minScale, maxScale;
companje / ArrayDequeTest.pde
Created Jan 21, 2019
ArrayDeque example / FIFO buffer
View ArrayDequeTest.pde
import java.util.Queue;
import java.util.ArrayDeque;
Queue<String> q = new ArrayDeque();
void setup() {
companje / 0.TopoGame.pde
Last active Jan 3, 2019
Making progress with TopoGame
View 0.TopoGame.pde
UDP udp;
PShape sphere;
Game game;
Globe globe;
Ring ring;
PFont defaultFont;
void setup() {
companje / angleLerp.pde
Created Jan 3, 2019
interpolate 2D angles
View angleLerp.pde
//thanks to:
float angleLerp(float from, float to, float t) {
float diff = (to - from) % TWO_PI;
return from + (2 * diff % TWO_PI - diff) * t;
companje / GlobeTrackballsHeli.pde
Last active Jan 3, 2019
Globe controlled by mouse and trackballs with helicopter pointing in direction of movement (for TopoGame)
View GlobeTrackballsHeli.pde
UDP udp;
Heli heli = new Heli();
Quaternion qRel = new Quaternion();
Quaternion qNow = new Quaternion();
PShape sphere;
float radius = 315;
float heading, toHeading;
void setup() {
You can’t perform that action at this time.