This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# dreamhost server setup | |
curl https://gist.github.com/iloveitaly/6979578/raw/.bash_profile > ~/.bash_profile | |
curl https://gist.github.com/iloveitaly/6979578/raw/.gitconfig > ~/.gitconfig | |
curl https://gist.github.com/iloveitaly/6979578/raw/.phprc >> $HOME/.php/5.4/phprc | |
# add ssh key to remote server for easy login | |
cat ~/.ssh/id_rsa.pub | ssh login@server.com '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 http://joy.dev/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/middleware/disable_assets_logger.rb | |
# https://github.com/rails/rails/issues/2639#issuecomment-6591735 | |
# http://stackoverflow.com/questions/6312448/how-to-disable-logging-of-asset-pipeline-sprockets-messages-in-rails-3-1 | |
class DisableAssetsLogger | |
def initialize(app) | |
@app = app | |
Rails.application.assets.logger = Logger.new('/dev/null') | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on select_dj_playlist(playlist_name) | |
try | |
with timeout of 10 seconds | |
tell application "Finder" | |
set os_version to version | |
end tell | |
set errorString to "" | |
tell application "System Events" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Spree::TaxRate.class_eval do | |
# UPGRADE_CHECK https://github.com/spree/spree/blob/1-3-stable/core/app/models/spree/tax_rate.rb#L33 | |
def self.adjust(order) | |
order.clear_adjustments! | |
# TODO you'll have to customize this based on your situation | |
if order.taxable_flag? | |
return | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on ensure_playlist_sort_and_list_view() | |
-- http://stackoverflow.com/questions/4056812/how-to-change-the-order-of-a-song-within-an-itunes-playlist-by-applescript/13667549#13667549 | |
tell application "System Events" | |
tell process "iTunes" | |
-- ensure list view | |
try | |
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require( dirname( __FILE__ ) . '/wp/wp-load.php' ); | |
$posts = new WP_Query('post_type=post&posts_per_page=-1&post_status=publish'); | |
$posts = $posts->posts; | |
header('Content-type:text/plain'); | |
foreach($posts as $post) { | |
$permalink = get_permalink($post->ID); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Author: Michael Bianco | |
-- References: | |
-- http://discussions.info.apple.com/thread.jspa?messageID=11447012 | |
-- http://macscripter.net/viewtopic.php?id=28958 | |
on run argv | |
generate_window_screenshot(item 1 of argv) | |
end run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* PHP Paypal IPN Integration Class Demonstration File | |
* 6.25.2008 - Eric Wang, http://code.google.com/p/paypal-ipn-class-php/ | |
* | |
* 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 |
OlderNewer