Skip to content
# For use in a `bin/setup` script to make onboarding new devs painless
# by configuring the current directory to link to a hard coded heroku app name
# test if heroku is configured for the app
if ! heroku config 2>&1 > /dev/null; then
echo $'\nHeroku is not configured. Configuring Heroku...'
# NOTE heroku app name hardcoded here
View all_stargazers_and_forkers.bash
# to avoid rate limiting
curl -u $GH_USERNAME:$GH_TOKEN -s$GITHUB_ORGANIZATION_OR_USER/repos?per_page=200 | jq '.[] .full_name' | sed 's/\"//g' | while read line; do
# forks and stargazers
curl -u $GH_USERNAME:$GH_TOKEN -s$line/stargazers | jq '.[] .login'
curl -u $GH_USERNAME:$GH_TOKEN -s$line/forks | jq '.[] .owner .login'
curl -s$GITHUB_USER/repos?per_page=200 | jq '.[] .clone_url' | sed 's/\"//g' | while read line; do g clone "$line"; done
View expost-published-post-permalink-list.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;
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()
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"
View tax_rate_decorator.rb
Spree::TaxRate.class_eval do
def self.adjust(order)
# TODO you'll have to customize this based on your situation
if order.taxable_flag?
View select_itunes_dj.applescript
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"
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
class DisableAssetsLogger
def initialize(app)
@app = app
Rails.application.assets.logger ='/dev/null')
Something went wrong with that request. Please try again.