This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(NSString *)hexToString:(NSString *)hex { | |
NSScanner *scan = [[NSScanner alloc] initWithString:hex]; | |
unsigned int val; | |
[scan scanHexInt:&val]; | |
char cc[4]; | |
cc[3] = (val >> 0) & 0xFF; | |
cc[2] = (val >> 8) & 0xFF; | |
cc[1] = (val >> 16) & 0xFF; | |
cc[0] = (val >> 24) & 0xFF; | |
NSString *s = [[NSString alloc] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For most of us it was our first job out of college. Living in New York, working on what we through were big important projects and figuring out what we wanted from life. A really fun time in our lives. However, the particular project we were working on had become a slog. The day to day was wearing on us and there was no leadership. You know when you feel like you're not sure what or why your doing anything and you look around at your work place wondering who's steering the ship? Well, our tech leader who wasn't particularly helpful introduces us to Will. Huge smile, scragly hair and immediately someone we looked up to. I was pretty full of myself, still am, but I remember sitting around having beers and talking and him showing me projects he worked on on the side. It didn't even occur to me that you could "jam on a passion project" after work. I was so inspired that somoene would use their talent as a coder to try and make projects just for fun that made people happy. | |
Well, within a couple weeks Will |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
soundPath = [[NSBundle mainBundle] pathForResource:@"soundtrack" ofType:@"m4a"]; | |
soundtrack = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:soundPath] error:nil]; | |
[soundtrack setVolume: 0.0]; | |
[soundtrack prepareToPlay]; | |
} | |
return self; | |
} | |
-(void)doVolumeFade { | |
if (soundtrack.volume < 0.1) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Learning Processing | |
import processing.video.*; | |
// Number of columns and rows in our system | |
int cols, rows; | |
// Variable to hold onto Capture object | |
Capture video; | |
PImage output; | |
float avg_r, avg_g, avg_b; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Learning Processing | |
import processing.video.*; | |
// Number of columns and rows in our system | |
int cols, rows; | |
// Variable to hold onto Capture object | |
Capture video; | |
PImage output; | |
float avg_r, avg_g, avg_b; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'socket' | |
require 'net/http' | |
myip = Socket::getaddrinfo(Socket.gethostname,"echo",Socket::AF_INET)[0][3] | |
def pbcopy(input) | |
str = input.to_s | |
IO.popen('pbcopy', 'w') { |f| f << str } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// AnimalRecordView.m | |
// SoundFarm | |
// | |
// Created by chrisallick on 9/11/13. | |
// Copyright (c) 2013 GSP BETA Group. All rights reserved. | |
// | |
#import "AnimalRecordView.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// MenuView.m | |
// GoodyVibrations | |
// | |
// Created by chrisallick on 3/22/13. | |
// Copyright (c) 2013 chrisallick. All rights reserved. | |
// | |
#import "MenuView.h" | |
#import "PRTween.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Borgs = function( _w, _h, _num ) { | |
var self = this; | |
this.borgs = new Array(); | |
this.create = function() { | |
for( var i = 0; i < _num; i++ ) { | |
if( i < 5 ) { | |
self.borgs.push( new Borg( getRandomInt(50, _w-50 ), getRandomInt( 50, _h-50), 10 ) ); | |
} else { | |
self.borgs.push( new Borg( getRandomInt(50, _w-50 ), getRandomInt( 50, _h-50), getRandomInt( 4000, 10000) ) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void testApp::mousePressed(int x, int y, int button) { | |
receivedImage = FALSE; | |
ofImage theScreen; //declare variable | |
theScreen.grabScreen(0,0,1024,768); //grab at 0,0 a rect of 1024x768. Equivalent to loadPixels(); | |
const ofPixelsRef pixels= theScreen.getPixelsRef(); | |
ofLog() << (int)pixels.getColor(x,y).r << ", " << (int)pixels.getColor(x,y).g << ", " << (int)pixels.getColor(x,y).b; | |
ofxOscMessage m; | |
m.setAddress("/color"); | |
m.addStringArg(ofToString((int)pixels.getColor(x,y).r) +","+ ofToString((int)pixels.getColor(x,y).g) +","+ ofToString((int)pixels.getColor(x,y).b)); |