Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
PS1="\u\e[1;31m \W\e[m $ "
alias ll="ls -lahG"
alias sniff="sudo ngrep -W byline -d 'en0' -t '^(GET|POST) ' 'tcp and port 8888'"
alias mysqlstart='sudo /usr/local/mysql/support-files/mysql.server start'
alias mysqlstop='sudo /usr/local/mysql/support-files/mysql.server stop'
alias gp='git pull origin master'
@silviopaganini
silviopaganini / facebook.coffee
Created November 23, 2013 19:05
Facebook notification
@sendTreeNow : (id, tree_id, complete, fail) =>
# TODO get message data
template = "@[#{Facebook.user.id}] gifted you a tree in the Amazon. Name it now."
url = (window or document).location.origin + "trees/#{tree_id}"
$.get "https://graph.facebook.com/oauth/access_token?client_id=#{window.config.fb_app}&client_secret=#{window.config.fb_secret}&grant_type=client_credentials", (data) =>
str = "https://graph.facebook.com/"
str += "#{id}/"
@silviopaganini
silviopaganini / gist:7067252
Created October 20, 2013 09:48
Sublime User Key Bindings
[
{ "keys": ["super+d"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Line.sublime-macro"} },
{ "keys": ["super+up"], "command": "swap_line_up" },
{ "keys": ["super+down"], "command": "swap_line_down" },
]
@silviopaganini
silviopaganini / giga.sh
Created July 25, 2013 13:53
Clean up the directories for Gigapix Image
# directory with the gigapic
cd giga
for (( i = 2; i < 11; i++ )); do
rm $i.html
cd $i"_img"
echo `pwd`
rm ImageProperties.xml
rm zoomifyViewer.swf
mkdir a
@silviopaganini
silviopaganini / appliness.js
Created July 25, 2013 13:46
Download the latest Appliness PDF
var http = require('http'),
fs = require('fs'),
$ = require('jquery');
var issues = [];
function downloadIssue()
{
var lastIndexSlash = issues[0].lastIndexOf('/') + 1;
var filename = issues[0].substring(lastIndexSlash, issues[0].length);
@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;
@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 / CakeFile
Created April 18, 2013 14:24
standard CakeFile
###
silvio paganini | s2paganini | @silviopaganini
Thanks to https://github.com/jashkenas
###
### -------------- INIT VARS -------------- ###
@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 / 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,