Skip to content

Instantly share code, notes, and snippets.

View iloveitaly's full-sized avatar

Michael Bianco iloveitaly

View GitHub Profile
@iloveitaly
iloveitaly / node-less-install.bash
Created August 7, 2011 00:33
Install Node + LESS on a Dreamhost Server
#!/bin/bash
mkdir ~/tmp
curl http://nodejs.org/dist/node-v0.4.10.tar.gz -O
tar -xvf node-v0.4.10.tar.gz
cd node-v0.4.10
./configure --prefix=/usr && make
sudo make install
curl http://npmjs.org/install.sh | sh
npm install less -g
@iloveitaly
iloveitaly / Questions
Created August 13, 2011 22:33
Frozen Rails Give-away
Day job: Web Developer & Designer (PHP, Ruby, Python, HTML, CSS, etc)
Your Rails contributions (if any): None yet, fairly new to ruby.
What's your Ruby/Rail experience?: Used ruby for web testing via watir & some misc scripting purposes.
How do you use GitHub?: For open source projects and misc snippets / scripts
@iloveitaly
iloveitaly / ssh-key-transfer.bash
Created August 17, 2011 00:56
Move local SSH keys to production machine
#!/bin/bash
# sends your local dev machines keys to the production machine for easy deployment + ssh
if [[ ! -e ~/.ssh/id_rsa.pub ]]; then
echo "Local keys do not exist, creating them..."
ssh-keygen -t rsa
fi
echo "username"
read username
@iloveitaly
iloveitaly / base_name.py
Created August 19, 2011 17:09
Normalizing Addresses With Google Refine + Maps
# eliminate stop words and create base name from title
import re
import urllib2
stop_words = urllib2.urlopen("http://www.textfixer.com/resources/common-english-words.txt").read().split(",") + ["cds", "mp", "cd", "dvd"]
words = re.sub(r"[^a-zA-Z]", ' ', value).lower().split(" ")
existing = set()
return "_".join([i for i in words if len(i) > 1 and not i in stop_words and i != "" and not i in existing and not existing.add(i) and (len(existing) < 5 or len("_".join(existing)) < 35) ])
@iloveitaly
iloveitaly / bookmarklet.html
Created August 31, 2011 01:05
Format Vatical / Papal Documents / Encyclicals
<a href="javascript:(function(){var jsCode = document.createElement('script'); jsCode.setAttribute('src', 'https://raw.github.com/gist/1182569/30cc436e68b6a4f455cb354a773fbf9bd5723b5c/format_vatican.js'); document.body.appendChild(jsCode); }())">Format Vatical Website Bookmarklet</a>
@iloveitaly
iloveitaly / Mail.applescript
Created August 31, 2011 15:03
Lion Applescript Mail.applescript
-- Mail.applescript
-- iCal
-- !!! Note that this script is not compiled by iCal.xcodeproj, which uses a compiled version instead
-- !!! so changes to this file will not be reflected in iCal behavior unless manually recompiled.
-- (Not compiled because of <rdar://problem/3675416> osacompile fails in a chrooted environment)
on show_mail_sbrs(subjectLine, messageText, myrecipients)
tell application "Mail"
set mymail to (make new outgoing message at the beginning of outgoing messages with properties {subject:subjectLine, content:messageText})
repeat with i from (count of myrecipients) to 1 by -1
@iloveitaly
iloveitaly / git.bash
Created October 30, 2011 21:24
Automatic Build Numbers for XCode
#!/bin/bash
BASE_VERSION=572
VERSION_NUMBER=$((`git describe --match SVN-Import | ack "([0-9]+)-[^-]+$" --output='$1'` + $BASE_VERSION))
@iloveitaly
iloveitaly / Podfile.rb
Created November 1, 2011 17:38
MacRuby Snippets
# Enable garbage collection support, which MacRuby requires.
post_install do |installer|
installer.project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['GCC_ENABLE_OBJC_GC'] = 'supported'
end
end
end
generate_bridge_support!
@iloveitaly
iloveitaly / cross_fade.less
Created November 19, 2011 21:01
CSS3 Cross Fade Slider
.cssanimations #main_content_holder {
#image_holder {
position:relative;
img {
.transition(opacity, 1s);
top:0;
left:0;
position:absolute;
@iloveitaly
iloveitaly / galleries.js
Created November 27, 2011 21:07
Multiple Javascript / Mootools Gallery Boilerplate
window.addEvent('domready', function() {
var galleryLength = <?=$l?>,
galleryList = [];
for(var a = 0; a < galleryLength; a++) {
galleryList.push("gallery-" + a);
}
var galleryManager = new GalleryManager(galleryList, {