Skip to content

Instantly share code, notes, and snippets.


Abe Pazos hamoid

View GitHub Profile
hamoid / ColourLover.pde
Created Feb 7, 2015
Processing function to get a random color set from ColourLovers
View ColourLover.pde
void setup() {
size(displayWidth, displayHeight);
int[] colors = getColorLove();
for(float x=0; x<width; x+=random(100)) {
rect(x, 0, width, height);
hamoid /
Last active Aug 29, 2015
Keep Markdown in sync when images are renamed
# This scripts automatically updates text files when asset files are renamed
# Given containing ![Image](/static/images/1234.jpg)
# if you rename the file 1234.jpg to awesome_jungle.jpg
# it will update to ![Image](/static/images/awesome_jungle.jpg)
# Works on Linux (untested in Mac, where sed is slightly different).
# I place the script in my images/ folder and let it run while I rename images.
hamoid / AnimatedBranchesAndLeaves.pde
Last active Aug 29, 2015
Response to code-comment on (branches and leaves)
View AnimatedBranchesAndLeaves.pde
PGraphics pg;
void setup() {
size(500, 400);
pg = createGraphics(width, height);
void draw() {
View EnergyGrid.pde
// JavaScript code by Sean Angley ported to Processing.
// Original:
//click to energize the grid
float a = 0;
float b = 0;
int dens = 8; //density - ! numbers higher than 20 may slow down your browser !
float d; // must be initiazed after size();
float e = 180; //energy
View tumblr_pjs.js
/*Swiped from
* This code searches for all the <script type="application/processing" target="canvasid">
* in your page and loads each script in the target canvas with the proper id.
* It is useful to smooth the process of adding Processing code in your page and starting
* the Processing.js engine.
if (window.addEventListener) {
window.addEventListener("load", function() {
var scripts = document.getElementsByTagName("script");
var canvasArray ="canvas"));
hamoid / multiple_frame_rates.pde
Created May 3, 2013
In Processing, frameRate() sets the global frame rate. It does not allow to set independent frame rates for different objects. To achieve that, you can avoid drawing every object on every frame, effectively reducing the frame rate for some objects. You can learn more about the modulo operation (%), if statements and other concepts used in this p…
View multiple_frame_rates.pde
void setup() {
// Global frame rate is 30 fps
// 1 second = 30 frames
void draw() {
// Change the background once every 30 frames
// 30 frames is 1 second, so that means
// change the background at 1 fps
if(frameCount % 30 == 0) {
hamoid / youtubeCoveringPage.html
Last active Dec 16, 2015
A YouTube video below, a layer covering the whole page above
View youtubeCoveringPage.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>Layer covering video</title>
<style type="text/css">
html, body {
padding: 0px;
#overlay {