Skip to content

Instantly share code, notes, and snippets.

View atduskgreg's full-sized avatar

Greg Borenstein atduskgreg

View GitHub Profile
var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
if(mutation.addedNodes.length > 0 && mutation.addedNodes[0].nodeName == "CANVAS"){
// do stuff after the sketch loaded
}
});
});
var config = { attributes: false, childList: true, characterData: false }
target = document.getElementById("myDiv")
{"origin":"DEFCON #defcon number# \\[#Exercise Term#\\] #Description#: #Force# #readiness action# #time modifier# #timeframe#.","defcon number":["1","2","3","4","5","6","7","8","9"],"Exercise Term":["COCKED PISTOL","FAST PACE","ROUND HOUSE","DOUBLE TAKE","FADE OUT","LIMP","FULLY LIMP","ENGORGED","AROUSED","DISINTERESTED","HOT TAKE","KEYNOTE","DRESS","LIMBER UP","STRETCH","WIPE","HARD CUT","SMASH CUT","FADE TO BLACK","PLUG IN","TURN ON","HARD RESET","SOFT RESET","COLD BOOT","COLD OPEN","PREAMBLE","AMBLE","PROLOGUE","EPILOGUE","DEEP CLEAN","SOCIAL ANXIETY","HAND MASSAGE","LIVE SHOW","MINIMUM VIABLE","JONY IVE","MICROSOFT BOB","NEW SHOES","GIL AMELIO","FRIENDS REBOOT","LIQUIDITY EVENT","SNAFU","DOWN ROUND","PREMIERE","ENCORE","PEEP SHOW","CURTAIN CALL","TULIP EFFECT","BLACK SWAN","RED SWAN","WHITE SWAN","APPLE PIPPIN","NEWTON","LISA","COURIER","HALF SHELL","SHORT ROUND","BLACK FACE","WHITE FACE","PILOT SHOW","NIGHTMARE GREEN"],"Description":["Nuclear war is imminent","Next step to nuclear war","Daydreaming of n

There's also a fascinating, depressing, unhappy kind of long-term issue here. And something worth connecting it back to is that this isn't the first recent story that in some fundamental way had lead as a big part of it. If people remember the death of Freddy Gray in Baltimore which was a really big story in 2015. This was a young guy and he was arrested by police and then put in a police van and appears to have been unrestrained in that van and handcuffed and shackled. They drove the van in such a way that he ended up snapping his spine and dying and it was a really terrible story. But something that was a terrible part of the backstory was that Freddie Gray had had very high levels of lead poisoning as a child. So high in fact that his family had been in lawsuits with — I don't remember if it's the developers or the city — but there were lawsuits around the amount of lead that that family was exposed to. And one thing that high levels of early lead exposure will do, as Matt said, is lead to reduced IQ, high

CUT TO: EXT. CALIFORNIA, NEWPORT BEACH - DAY
Toby and Sam are walking along the beach.
TOBY
When they ask you why you're here today, you say,
"Orange County's beachfront is national treasure."
SAM
Who are you, Charlie McCarthy?
# resize an animated GIF
if ARGV.length < 3
puts "Usage:"
puts "ruby gif_prep.rb full_size.gif <size> small_size.gif"
exit
end
full = ARGV[0]
size = ARGV[1]
@atduskgreg
atduskgreg / interactive_inpainting.pde
Created December 3, 2015 20:30
Interactive in-painting with OpenCV for Processing
import gab.opencv.*;
import org.opencv.photo.Photo;
import org.opencv.imgproc.Imgproc;
PImage src;
PGraphics canvas;
OpenCV opencv, mask;
int strokeSize = 30;
uniform sampler2D srcImg;
varying vec4 vertTexCoord;
void main() {
gl_FragColor = texture2D(srcImg, vertTexCoord.st).rgba;
}
float linearTween(float t, float startValue, float deltaT, float duration) {
return deltaT*t/duration + startValue;
}
float cubicEaseInOut(float t, float startValue, float deltaT, float duration) {
t /= duration/2;
if (t < 1) {
return deltaT/2*t*t*t + startValue;
} else {
t -= 2;
@atduskgreg
atduskgreg / PWindow.pde
Last active November 15, 2023 13:29
Example of creating a Processing sketch with multiple windows (works in Processing 3.0)
class PWindow extends PApplet {
PWindow() {
super();
PApplet.runSketch(new String[] {this.getClass().getSimpleName()}, this);
}
void settings() {
size(500, 200);
}
PGraphics pg;
PSurface surf;
MyWindow win;
void settings() {
size(320, 240);
}
void setup() {