Skip to content

Instantly share code, notes, and snippets.

@silviopaganini
silviopaganini / sequentialLights.ino
Created April 11, 2012 17:08
Sequential Lights Arduino
/**
silvio paganini | s2paganini.com
@silviopaganini
**/
const int pins[] = {11, 10, 9, 6, 5, 3};
int SIZE = 6;
void setup()
{
@silviopaganini
silviopaganini / servo.ino
Created April 24, 2012 12:14
Button controlling Servo
#include <Servo.h>
Servo servo;
int btnPin = 2;
int lightPins[] = {3, 5, 6};
int serPin = 11;
int pos = 0;
void setup()
package cacilds
{
import cacilds.workers.WorkerEnterFrame;
import flash.display.Sprite;
import flash.events.Event;
import flash.system.MessageChannel;
import flash.system.Worker;
import flash.system.WorkerDomain;
/**
@silviopaganini
silviopaganini / Main.as
Created September 10, 2012 17:13
AS3 Workers
Main.as
function init() : void
{
// Set the Workers Manager the swf bytes
Workr.bytesMain = loaderInfo.bytes;
// initiate the singleton
workr = Workr.getInstance();
@silviopaganini
silviopaganini / chineseShare.coffee
Created January 9, 2013 12:39
Share Buttons for the Chinese Market (RenRen and Weibo)
addRenRen : =>
p = []
w = 130
h = 20
lk = {url:'' || window.location.href, title:'' || document.title, description:'', image:''}
p.push(k + "=" + encodeURIComponent(v || '')) for k, v of lk
@renren = $("<iframe scrolling=\"no\" frameborder=\"0\" allowtransparency=\"true\" src=\"http://www.connect.renren.com/like/v2?#{p.join("&")}\" style='width:#{w}px; height:#{h}px;'/>")
@$el.append @renren
@silviopaganini
silviopaganini / SSAsset.js
Last active December 11, 2015 14:08
Creating a SpriteSheet Object (Div) for normal and retina devices
/*
USAGE:
img = new SSAsset(
{
fullSize : [512, 512]
x : 0,
y : 0,
width : 100,
@silviopaganini
silviopaganini / DistortImage.coffee
Created March 7, 2013 18:07
Distort Image CoffeeScript
class DistortImage
_w : null
_h : null
_hseg : null
_vseg : null
_p : null
_tri : null
_xMin : null
_xMax : null
@silviopaganini
silviopaganini / CakeFile
Created April 18, 2013 14:24
standard CakeFile
###
silvio paganini | s2paganini | @silviopaganini
Thanks to https://github.com/jashkenas
###
### -------------- INIT VARS -------------- ###
@silviopaganini
silviopaganini / auto.sh
Last active December 20, 2015 01:59
Generate HTML files from images for clickthrough presentation
#!/bin/bash
# clean up any old HTML
for a in `ls -a *.html`
do
rm $a
done
# create array with the images
array=( $( ls -a *.png *.jpg ) )
@silviopaganini
silviopaganini / fussball.ino
Created July 22, 2013 14:44
UNIT9 Interactive Fussball table
#define REDPIN 5
#define GREENPIN 6
#define BLUEPIN 3
#define GOAL_REPEAT 20 // how many times to flash when someone scores
#define DETECT_RIGHT A0
#define DETECT_LEFT A1
boolean goal;