Skip to content

Instantly share code, notes, and snippets.

View dropmeaword's full-sized avatar

Luis Rodil-Fernandez dropmeaword

  • Amsterdam, Netherlands
View GitHub Profile
@dropmeaword
dropmeaword / workshop_1.ino
Created September 14, 2016 13:50
Code for the dynamic ranging workshop
#include <Metro.h>
int minReading = 1024;
int maxReading = 0;
int ledOn = 0;
int freq = 8; // in Hz
int timeout = 0;
int lastOn = 0;
int durationOn = 20;
@dropmeaword
dropmeaword / hammerspoon_config.lua
Created April 7, 2016 10:31
My Hammerspoon configuration
-- Bring all Finder windows to front
function applicationWatcher(appName, eventType, appObject)
if (eventType == hs.application.watcher.activated) then
if (appName == "Finder") then
-- Bring all Finder windows forward when one gets activated
appObject:selectMenuItem({"Window", "Bring All to Front"})
end
end
end
local appWatcher = hs.application.watcher.new(applicationWatcher)
@dropmeaword
dropmeaword / nikki_slagboom.ino
Created January 24, 2016 16:46
Logic for Nikki Hock's installation at W139
enum state {
stWAITING,
stUP,
stDOWN,
};
int THRESHOLD = 250; // LDR sensor reading
long TIMEOUT = (5+3)*1000; // this is milliseconds so that's secs * 1000
// 8..13 are relays
@dropmeaword
dropmeaword / headless-p5.md
Last active December 22, 2022 14:16
Headless processing

Running processing without a screen

Let's say you want to run a Processing sketch on a server. Like maybe you want to generate several million PDF and JPEG images using a handful of Amazon EC2 instances.

This is called “headless” mode, and to do so, it's necessary to install what's known as a virtual frame buffer.

On Ubuntu 14.04, these are the things you need to install first:

sudo apt-get install xvfb libxrender1 libxtst6 libxi6 
@dropmeaword
dropmeaword / PF_PathFinder.pde
Created December 16, 2015 17:11 — forked from gwabster/PF_PathFinder.pde
Pathfinding in processing
import pathfinder.*;
Graph[] gs = new Graph[4];
PImage[] graphImage = new PImage[4];
int start[] = new int[4];
int end[] = new int[4];
float nodeSize[] = new float[4];
int graphNo = 0;
int algorithm;
@dropmeaword
dropmeaword / references-A1+2-trackography.md
Last active November 18, 2015 14:53
References for the Situational Awareness & Wayfinding in the Data Jungle assignments
@dropmeaword
dropmeaword / what-happens-when-we-type-g.md
Last active November 18, 2015 22:49
What happens when we go to google from the moment we type 'g'

What happens when we go to google from the moment we type 'g'?

Notes from the group discussion around this question:

  • finger movement makes key close circuit
  • goes to the OSX kernel keyboard manager
  • what do i get if I am a keylogger?
    • passwords
    • anything else I type
  • your laptop comes out of energy savings mode
  • browser looks up cache of recently accessed addresses
@dropmeaword
dropmeaword / rpi-install.md
Last active November 4, 2015 12:33
Installing Raspbian OS
@dropmeaword
dropmeaword / .bashrc_profile
Created October 28, 2015 17:15
Get color output in your terminal so that you don't go insane looking at flat text
function parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
YELLOW="\[\033[0;33m\]"
# Comment in the above and uncomment this below for a color prompt
PS1="${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w$YELLOW\$(parse_git_branch)\[\033[00m\]\$ "
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad