Skip to content

Instantly share code, notes, and snippets.

@benfarahmand
benfarahmand / gist:7532456
Last active December 28, 2015 16:59
about us css for tuvalabs
h2 {
font-size: 32px;
line-height: 36px;
font-weight: 400;
text-align: center;
}
h3 {
line-height: 27px;
font-size: 18px;
@benfarahmand
benfarahmand / multiple monitors from same processing sketch
Created November 12, 2013 20:11
architecture for multiple monitors, applets, and frames running from the same processing sketch
//This simple architecture lets you span two monitors with a single processing sketch
import java.awt.Frame;
import processing.opengl.*;
firstApplet firstApp;
secondApplet secondApp;
SecondFrame secondFrame;
FirstFrame firstFrame;
int secondFrameWidth = 640, secondFrameHeight = 480; // width and height of secondary monitor
@benfarahmand
benfarahmand / thread example
Created November 12, 2013 18:11
Threading (multithreading) in processing, source code example
ThreadedClass myThread;
int drawCounter;
void setup(){
myThread = new ThreadedClass(50); //set the thread loop to wait every 50 milliseconds
drawCounter = 0;
myThread.start();
}
void draw(){
@benfarahmand
benfarahmand / Automatic Upload to Youtube
Last active December 25, 2015 23:39
This is the code I put together to automagically upload to my youtube account.
import com.google.gdata.client.Service;
import sample.util.SimpleCommandLineParser;
import com.google.gdata.client.youtube.YouTubeService;
import com.google.gdata.data.PlainTextConstruct;
import com.google.gdata.data.TextConstruct;
import com.google.gdata.data.media.MediaFileSource;
import com.google.gdata.data.media.mediarss.MediaCategory;
import com.google.gdata.data.media.mediarss.MediaDescription;
import com.google.gdata.data.media.mediarss.MediaKeywords;
import com.google.gdata.data.media.mediarss.MediaPlayer;
import ddf.minim.analysis.*;
import ddf.minim.*;
Minim minim;
AudioPlayer jingle;
FFT fft;
AudioInput in;
float[] angle;
float[] y, x;
void setup()
@benfarahmand
benfarahmand / Image Modifier
Last active December 11, 2015 16:18
Image Modifier for tuvalabs, using processing
//image modifier will make images all the same size
PImage[] tempImages;
String rootDir = "C:/Users/Ben/Dropbox/TuvaLabs UI-UX Design/Mock-ups/Assets/Images for Personalization Page/";
ArrayList directories, names; //holds the directories for all image files to be modified
void setup(){
size(200,150);
directories = new ArrayList();
@benfarahmand
benfarahmand / gist:4612183
Last active December 11, 2015 14:08
JQuery Image Grid. Example of working code is here: http://www.ragtimelolcat.com/
var imageWidth = 800;
var imageHeight = 450;
var gridWidth = imageWidth/10;
var gridHeight = imageHeight/10;
var halfGWidth = gridWidth/2;
var halfGHeight = gridHeight/2;
$(document).mousemove(function(e){
if(e.pageX for(var i = 0; i <= imageWidth ; i = i+gridWidth){
for(var j = 0; j <= imageHeight ; j = j +gridHeight){