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 / parseXML2.js
Created Aug 22, 2019
parse MAIS Flexis XML
View parseXML2.js
#!/usr/bin/env node
//usage: $ ./index.js INPUT.txt
const fs = require('fs');
const replaceStream = require('replacestream');
const node_xml_stream = require('node-xml-stream');
const parser = new node_xml_stream();
const filename = process.argv[2];
if (!filename) return console.log('usage: ./index.js input_xml_file');
if (!fs.existsSync(filename)) return console.log('File not foud: ' + filename);
@companje
companje / parseXML.js
Created Aug 21, 2019
Parse MAIS Flexis XML
View parseXML.js
#!/usr/bin/env node
//usage: $ ./index.js INPUT.txt
const fs = require('fs');
const node_xml_stream = require('node-xml-stream');
const parser = new node_xml_stream();
const filename = process.argv[2];
if (!filename) return console.log('usage: ./index.js input_xml_file');
if (!fs.existsSync(filename)) return console.log('File not foud: ' + filename);
@companje
companje / thumbsheet.js
Last active Aug 15, 2019
Javascript contactsheet / spritesheet / thumbsheet / video thumb scrub
View thumbsheet.js
/*
CSS:
.thumb {
width: 192px;
height: 146px;
border: 1px solid black;
background-image: url(140001.jpg); //140001.jpg is a thumbsheet of 10x10
}
*/
@companje
companje / id-guid-aet.js
Last active Jul 15, 2019
Parse multiple Export XML file and output fields
View id-guid-aet.js
#!/usr/bin/env node
//usage: find ~/Documents/Export -name "*.txt" -exec node id-guid-aet.js {} ';' > id-guid-aet.csv
//or sorted: find ~/Documents/Export -name "*.txt" | sort | while IFS= read -r filename; do node id-guid.js "$filename"; done > id-guid-aet.csv
const fs = require('fs');
const node_xml_stream = require('node-xml-stream');
const parser = new node_xml_stream();
const filename = process.argv[2];
var tag,item;
@companje
companje / 0.KFair2019_FishEye_Demo.pde
Created Jul 7, 2019
2D to 3D FishEye menu experiment for Globe4D
View 0.KFair2019_FishEye_Demo.pde
PImage bg, img;
PShader fisheye;
PGraphics pg;
void settings() {
fullScreen(P3D); //borderless window native 1920x1200
}
void setup() {
surface.setSize(1200, 1200); //resize window
@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);
You can’t perform that action at this time.