Skip to content

Instantly share code, notes, and snippets.

View AdmiralPotato's full-sized avatar
🐐
Probably filling databases with Goats

Admiral Potato AdmiralPotato

🐐
Probably filling databases with Goats
View GitHub Profile
@AdmiralPotato
AdmiralPotato / sketch_140131.pde
Last active August 29, 2015 13:55
A Processing Sketch for playing with Temporal Displacement Mapping. Uses a PNG image sequence containing an animation, and a greyscale "Temporal Displacement Map" PNG to control how many frames forward from the current frame any pixel should be displayed.
boolean
exportMode = false;
int
scale = 480,
numFrames = 48,
frameRate = 24,
currentFrame = 0;
float
boolean
exportMode = true;
int
size = 480,
maxFrames = 48,
currentFrame = 0,
numThings = 12,
samplesPerFrame = 32;
float
time = 0.0,
//configurable variables
boolean
exportMode = true; //set to true when exporting, false when designing
String
folderPrefix = "b";
int
fps = 24,
outputScale = 2, //set to 2 or 4 when exporting, 1 when designing
windowSize = 480 * outputScale,
//configurable variables
boolean
exportMode = false; //set to true when exporting, false when designing
String
folderPrefix = "c";
int
fps = 24,
outputScale = 1, //set to 2 or 4 when exporting, 1 when designing
windowSize = 480 * outputScale,
numFrames = 48,
//configurable variables
boolean
exportMode = true; //set to true when exporting, false when designing
String
folderPrefix = "d";
int
fps = 24,
outputScale = 2, //set to 2 or 4 when exporting, 1 when designing
windowSize = 480 * outputScale,
numFrames = 48,
@AdmiralPotato
AdmiralPotato / file_sequence_reverser.js
Created July 24, 2014 15:04
A quick node tool to copy a sequence of images from one folder to another, in reverse order. '0001.exr' -> '0048.exr', '0048.exr' -> '0001.exr'
var fs = require('fs'),
path = require('path'),
inputPath = '4',
outputPath = '4-reversed',
suffix = 'exr',
startFrame = 1,
endFrame = 48,
paddingZeroes = 4,
pad = function (num, size) {
var s = num+"";
callback([{"name":"green","hex":"40be3c","radius":132.28756555322954,"male":0.5797,"r":64,"g":190,"b":60,"color":"rgb(64,190,60)","loFi":false},{"name":"blue","hex":"2e57ce","radius":128.76334882255898,"male":0.5498,"r":46,"g":87,"b":206,"color":"rgb(46,87,206)","loFi":false},{"name":"purple","hex":"8d2eb0","radius":122.71919165313956,"male":0.5744,"r":141,"g":46,"b":176,"color":"rgb(141,46,176)","loFi":false},{"name":"pink","hex":"e95aaa","radius":88.02272433866155,"male":0.5659000000000001,"r":233,"g":90,"b":170,"color":"rgb(233,90,170)","loFi":false},{"name":"brown","hex":"895625","radius":66.76076692189807,"male":0.5817,"r":137,"g":86,"b":37,"color":"rgb(137,86,37)","loFi":false},{"name":"red","hex":"d42026","radius":62.8887907341205,"male":0.5944,"r":212,"g":32,"b":38,"color":"rgb(212,32,38)","loFi":false},{"name":"light blue","hex":"61bbe3","radius":62.489999199871974,"male":0.5720000000000001,"r":97,"g":187,"b":227,"color":"rgb(97,187,227)","loFi":false},{"name":"teal","hex":"30b69f","radius":62.393909
@AdmiralPotato
AdmiralPotato / node-read_remote_json_source.js
Created February 13, 2013 23:38
How to get a JSON response from an external server and serve it back as the response to an HTTP request
var http = require('http');
var clientResponseDataHandler = function(chunk) {
this.compiledResponseString += chunk;
}
var clientResponseEndHandler = function() {
var propertyName, httpResponse;
console.log('-----------------------------------------------------------');
console.log('END OF DATA FROM REMOTE SERVER');
for (propertyName in this) {
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Developer Defense</title>
<style>
.chair{
position: fixed;
height: 32px;
width: 32px;
@AdmiralPotato
AdmiralPotato / forceFields.js
Created May 31, 2013 01:08
First stab at a multiple force-field particle system
var n = NPos3d,
scene = new n.Scene({
globalCompositeOperation: 'lighter'
}),
particleList = [],
forceList = [];
var Particle = function(args){
var t = this;
args = args || {};