Skip to content

Instantly share code, notes, and snippets.

View iloveitaly's full-sized avatar

Michael Bianco iloveitaly

View GitHub Profile
iloveitaly / snippets.bash
Created February 20, 2014 14:42
Snippets for WordPress Development & Deployment
# dreamhost server setup
curl > ~/.bash_profile
curl > ~/.gitconfig
curl >> $HOME/.php/5.4/phprc
# add ssh key to remote server for easy login
cat ~/.ssh/ | ssh 'mkdir ~/.ssh; touch ~/.ssh/authorized_keys; cat >> ~/.ssh/authorized_keys'
# switch essential wordpress settings when dumping from production DB to dev DB
wp option set siteurl
# app/middleware/disable_assets_logger.rb
class DisableAssetsLogger
def initialize(app)
@app = app
Rails.application.assets.logger ='/dev/null')
iloveitaly / setup_ichat_trigger.applescript
Created April 8, 2014 15:06
Setup a AppleScript trigger in Messages when a share my screen request is received via AppleScript
tell application "Messages" to activate
delay 3
tell application "System Events"
tell process "iChat"
keystroke "," using command down
click button "Alerts" of tool bar 1 of window 1
iloveitaly / select_itunes_dj.applescript
Last active August 29, 2015 13:58
Select iTunes DJ Playlist. For older versions (pre iTunes 11). Useful Applescript UI scripting debugging
on select_dj_playlist(playlist_name)
with timeout of 10 seconds
tell application "Finder"
set os_version to version
end tell
set errorString to ""
tell application "System Events"
iloveitaly / tax_rate_decorator.rb
Created April 30, 2014 21:08
Disable tax calculation on an order in Spree Commerce
Spree::TaxRate.class_eval do
def self.adjust(order)
# TODO you'll have to customize this based on your situation
if order.taxable_flag?
iloveitaly / itunes_eleven_utilities.applescript
Created May 18, 2014 14:33
Some utilities for managing iTunes preferences that are not accessible via AppleScript
on ensure_playlist_sort_and_list_view()
tell application "System Events"
tell process "iTunes"
-- ensure list view
outline 1 of scroll area 1 of splitter group 1 of splitter group 1 of window "iTunes"
on error
-- then we are not in list view
click menu button "View" of splitter group 1 of window "iTunes"
require( dirname( __FILE__ ) . '/wp/wp-load.php' );
$posts = new WP_Query('post_type=post&posts_per_page=-1&post_status=publish');
$posts = $posts->posts;
foreach($posts as $post) {
$permalink = get_permalink($post->ID);
iloveitaly / feed2.php
Created January 16, 2010 18:38
Kohana 2 feed class with better namespace support
class Feed2 extends feed {
* Creates a feed from the given parameters.
* @param array feed information
* @param array items to add to the feed
* @param string define which format to use
* @param string define which encoding to use
* @return string
iloveitaly / flash-screenshot.applescript
Created May 12, 2010 21:06
Take a screenshot of a SWF
-- Author: Michael Bianco
-- References:
on run argv
generate_window_screenshot(item 1 of argv)
end run
/* PHP Paypal IPN Integration Class Demonstration File
* 6.25.2008 - Eric Wang,
* This file demonstrates the usage of paypal.class.php, a class designed
* to aid in the interfacing between your website, paypal, and the instant
* payment notification (IPN) interface. This single file serves as 4
* virtual pages depending on the "action" varialble passed in the URL. It's
* the processing page which processes form data being submitted to paypal, it