Skip to content
View expost-published-post-permalink-list.php
<?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);
View gui-scripting-mavericks.applescript
on enabledGUIScripting(flag)
get system attribute "sysv"
if result is less than 4240 then -- 4240 is OS X 10.9.0 Mavericks
-- In OS X 10.8 Mountain Lion and older, enable GUI Scripting globally by calling this handler and passing 'true' in the flag parameter before your script executes any GUI Scripting commands, or pass 'false' to disable GUI Scripting. Authentication is required only if the value of the 'UI elements enabled' property will be changed. Returns the final setting of 'UI elements enabled' even if unchanged.
tell application "System Events"
activate -- brings System Events authentication dialog to front
set UI elements enabled to flag
return UI elements enabled
View itunes_eleven_utilities.applescript
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"
View tax_rate_decorator.rb
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
View select_itunes_dj.applescript
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"
View setup_ichat_trigger.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
View disable_asset_logger.rb
# 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
View snippets.bash
# 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/
View olark.php
<?php
/*
Plugin Name: OLark
Description: Live Chat
Version: 1.0
Author: Michael Bianco
Author URI: http://github.com/iloveitaly/
*/
function admin_page () {
View wp-config.php
<?php
/* Config Custom
*******************************/
define('IS_LOCAL', isset($_SERVER['IS_PRODUCTION']) || strpos($_SERVER['DOCUMENT_ROOT'], '/Users/Mike') === 0);
if(IS_LOCAL) {
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', true);
Something went wrong with that request. Please try again.