Skip to content

Instantly share code, notes, and snippets.

@bdunagan
bdunagan / s3-delete-bucket.rb
Created November 21, 2011 17:23
s3-delete-bucket.rb: quickly delete large AWS S3 buckets using fog
#!/usr/bin/env ruby
# s3-delete-bucket.rb
# Fog-based script for deleting large Amazon AWS S3 buckets (~100 files/second)
# Forked from this excellent script: https://github.com/SFEley/s3nuke
require 'rubygems'
require 'thread'
require 'fog'
@bdunagan
bdunagan / how-to-disable-multi-touch-on-apple-magic-mouse.bash
Created December 5, 2016 21:08
Terminal: How to Disable Multi-Touch on Apple Magic Mouse
# Launch Terminal.
defaults write com.apple.AppleMultitouchMouse MouseMomentumScroll -bool NO
defaults write com.apple.AppleMultitouchMouse MouseHorizontalScroll -bool NO
defaults write com.apple.AppleMultitouchMouse MouseVerticalScroll -bool NO
defaults write com.apple.driver.AppleBluetoothMultitouchMouse MouseMomentumScroll -bool NO
defaults write com.apple.driver.AppleBluetoothMultitouchMouse MouseHorizontalScroll -bool NO
defaults write com.apple.driver.AppleBluetoothMultitouchMouse MouseVerticalScroll -bool NO
# Restart the computer.
@bdunagan
bdunagan / git.log.with.lines.changed.rb
Created November 13, 2011 19:05
git log with colors and lines changed
# See colored 'git log' with lines changes in Terminal on Mac
# => * 1234567 - 2001-01-01 - NNNNN - description <user>
# Based on http://www.jukie.net/bart/blog/pimping-out-git-log
# git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"
# To install as 'gl' alias (not overriding 'git log'):
# 1) save this as ~/.gitlog.rb
# 2) add to ~/.bash_profile: 'alias gl="ruby ~/.gitlog.rb | more -r"'
@bdunagan
bdunagan / salesforce-timezones.txt
Created December 29, 2016 04:34
Salesforce: How to Set Up US Timezones with a Custom Formula
# Salesforce Custom Formula for US Timezones based on Billing State
# Note there are 51 because DC counts.
CASE(BillingState,
"HI","US-PST",
"AK","US-PST",
"WA","US-PST",
"OR","US-PST",
"CA","US-PST",
"NV","US-PST",
"MT","US-MST",