Skip to content

Instantly share code, notes, and snippets.

@fallwith
fallwith / .zshrc
Created June 22, 2011 18:01
ZSH config (~/.zshrc)
# Use the remainder of this file only with interactive shells
[ -z "$PS1" ] && return
# Enable prompt substitution and colors
setopt prompt_subst
autoload colors
colors
# Set the prompts
ruby_version() {
@fallwith
fallwith / ruby_hashes.rb
Created July 21, 2011 07:52
Ruby hash benchmarking
#!/usr/bin/env ruby
require 'benchmark'
RUNS = 10_000
OUTER_KEYS = 10
INNER_STRUCTURES = 3
INNER_KEYS = 5
GC::Profiler.enable
@fallwith
fallwith / minecraft_guide.txt
Created February 26, 2012 03:12
Minecraft Guide -- Crafting, Smelting, and Brewing
Minecraft Guide
###############
The Minecraft wiki (www.minecraftwiki.net) was the source for all of this
material. I wanted the info in a fixed width, 80 column, text only format,
but none of the recipe content itself is new or unique to this guide.
basics
===============================================================================
1 wood => 4 wood planks
@fallwith
fallwith / gist:2364156
Created April 12, 2012 01:48
Split 3840x1200 image into two halves w/ImageMagick
convert -crop 1920x1200x1920 src.jpg output.jpg
@fallwith
fallwith / gist:2473228
Created April 23, 2012 19:23
Enable write support for NTFS flash drives in OS X
$> brew install ntfs-3g
# The exact syntax for the following commands for your system will be available in the "Caveats" section of the documentation if you run "brew info ntfs-3g"
$> sudo mv /sbin/mount_ntfs /sbin/mount_ntfs.orig
$> sudo ln -s /usr/local/Cellar/ntfs-3g/2012.1.15/sbin/mount_ntfs /sbin/mount_ntfs
# The exact syntax for the following commands for your system will be available in the "Caveats" section of the documentation if you run "brew info fuse4x-kext"
$> sudo cp -rfX /usr/local/Cellar/fuse4x-kext/0.10.0/Library/Extensions/fuse4x.kext /Library/Extensions
$> sudo chmod +s /Library/Extensions/fuse4x.kext/Support/load_fuse4x
@fallwith
fallwith / gist:2571974
Created May 1, 2012 22:30
OS X keyboard shortcuts
Here are a few OS X keyboard shortcuts I can think of now that I'm in front of a keyboard:
text editing
-
cmd + right arrow = end of line
cmd + left arrow = start of line
alt + right arrow = right one word
alt + left arrow = left one word
(add shift to the above to add highlighting)
@fallwith
fallwith / gist:2728143
Created May 18, 2012 23:36
Bash: Echo a random word
alias word='d=/usr/share/dict/words; rand=$[($RANDOM % `wc -l $d|sed "s/[^0-9]//g"`)+1]; sed $rand"q;d" $d'
@fallwith
fallwith / gist:4269687
Created December 12, 2012 17:15
Shell method to clean up source code
# Clean up source code by converting tabs to 2 spaces, Windows newlines to
# unix ones, and by stripping away trailing whitespace. Pass in a list of
# files to clean, or let ack find a list of suitable candidates.
clean() {
if [ $1 ]; then
files=$@
else
files=`ack " +$|\t|\r" -l`
fi
echo $files|xargs perl -pi -e "s/\r\n?/\n/g;s/\t/ /g;s/[ ]*$//g"
@fallwith
fallwith / shortcuts.txt
Created March 4, 2013 09:29
Windows 8 keyboard shortcuts
Windows 8 keyboard shortcuts
=
Win + 1...0 = launch the 1st...10th taskbar app
Win + B = select tray notification area
Win + C = charms overlay (non-touch style)
Win + D = show desktop (switch to Desktop, hide all apps)
Win + E = windows explorer
Win + F = search
Win + I = settings pane
Win + L = lock screen
@fallwith
fallwith / .agignore
Created June 21, 2013 18:30
The Silver Searcher ~/.agignore file
/log/
/logs/
/images/
/javascripts/
/stylesheets/
/tmp/
/vendor/
*.sql
*.tags*
*.gemtags*