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
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
<?php
$mivast=39;
$mizig=210;
$miadt=39;
$miaet=185;
$micode=1001;
$minr=5044025;
$count=236;
for ($i=$minr; $i<$minr+$count; $i++) {
@companje
companje / Earth Elevation Curve.md
Last active Mar 14, 2019
Earth Elevation Curve
View Earth Elevation Curve.md

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
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() {
//color
vec4 heightColor = texture2D(heightmap, vertTexCoord.st);
@companje
companje / len-lye.pde
Created Mar 12, 2019
Len Lye filmstrip
View len-lye.pde
import processing.video.*;
Movie mov;
int w, h;
int rows=15;
void setup() {
fullScreen();
background(0);
h = height/rows;
w = int(4/3.*h);
@companje
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
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() {
q.add("a");
q.add("b");
q.add("c");
@companje
companje / 0.TopoGame.pde
Last active Jan 3, 2019
Making progress with TopoGame
View 0.TopoGame.pde
import hypermedia.net.*;
UDP udp;
PShape sphere;
Game game;
Globe globe;
Ring ring;
PFont defaultFont;
void setup() {
@companje
companje / angleLerp.pde
Created Jan 3, 2019
interpolate 2D angles
View angleLerp.pde
//thanks to: https://gist.github.com/shaunlebron/8832585
float angleLerp(float from, float to, float t) {
float diff = (to - from) % TWO_PI;
return from + (2 * diff % TWO_PI - diff) * t;
}
@companje
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
import hypermedia.net.*;
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.