Skip to content

Instantly share code, notes, and snippets.

View macklinu's full-sized avatar

Mackie Underdown macklinu

View GitHub Profile
@macklinu
macklinu / gist:3758136
Created September 20, 2012 20:23
checkip
#!/usr/bin/env python
import subprocess
import httplib, urllib
tempfile = open('/Users/macklinu/Documents/Scripts/.externalip/temp.txt', 'r+')
currentip = subprocess.Popen(['curl', 'ifconfig.me/ip'], stdout=subprocess.PIPE).communicate()[0].replace('\n', '')
def main():
checkIP()
@macklinu
macklinu / CSV.pde
Last active October 12, 2015 07:58
CSV class Processing
//A class created for CSV parsing based on...
//for importing csv files into a 2d array
//by che-wei wang
class CSV {
String dataFile;
String lines[];
String [][] csv;
int csvWidth;
@macklinu
macklinu / MusicObject.pde
Created November 6, 2012 06:29
MusicTimeline library issue
class MusicObject {
AudioPlayer song;
AudioMetaData meta;
String artist;
String title;
String year;
String info;
PImage albumArt;
String finalImgLoc;
@macklinu
macklinu / minimMetadata.pde
Created November 7, 2012 01:39
minim metadata
import ddf.minim.*;
Minim minim;
AudioPlayer groove;
AudioMetaData meta;
void setup()
{
size(512, 256, P3D);
@macklinu
macklinu / conditional.pde
Created December 2, 2012 23:31
Processing Conditional Thing
// THIS...
if (dist(mouseX, mouseY, X2 - 35, Y2 - 35) < 10) fill(190, 190);
else fill(90, 190);
// BECOMES...
fill(dist(mouseX, mouseY, X2 - 35, Y2 - 35) < 10 ? 190 : 90, 190);
@macklinu
macklinu / index.html
Last active October 13, 2015 16:08
D3js test
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
margin: auto;
position: relative;
width: 960px;
}
@macklinu
macklinu / earthquake.json
Last active December 10, 2015 13:08
D3 Earthquake Map
[
{
"Src": "nn",
"Eqid": "00398227",
"Version": "9",
"Datetime": "Wednesday, January 2, 2013 21:55:02 UTC",
"Lat": "38.3558",
"Lon": "-118.7655",
"Magnitude": "1.9",
"Depth": "15.80",
@macklinu
macklinu / README.md
Last active December 11, 2015 09:28
Mouse Events and Cursor

A Processing.js sketch that highlights multiple things:

  • How to use a mostly transparent circle as a cursor
  • Detecting mouse events, such as hovering over a circle and taking action upon mouse clicks
// Winter Forest
// Include this line if using Processing.js
/* @pjs pauseOnBlur="true"; */
float wiggle = 0;
float angle = -1.0;
void setup() {
size(700, 250);
// Swirling Color Wheel
// p.js
//
// Just discovering how to make this effect
// thanks to HSB vs. RGB color mode
//
// Click on the sketch to switch color modes
/* @pjs pauseOnBlur="true"; */