- Swap Control and Caps Lock in System Preferences -> Keyboard -> Modifier Keys
- Google Chrome http://www.google.com/chrome/
- iTerm2 http://www.iterm2.com/
- Oh my zsh https://github.com/robbyrussell/oh-my-zsh/
- XCode (from the mac app store)
- XCode command line tools (run XCode, go to Preferences -> Downloads -> Command Line Tools)
- Homebrew https://github.com/mxcl/homebrew/wiki/installation
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
var shuffleAndValidateFiles = function(files) { | |
var F = new Array(); | |
while (files.length > 0) { | |
var N = Math.floor(Math.random()*files.length); | |
if ((files[N] instanceof File) && !files[N].hidden) { | |
F.push(files[N]); | |
} | |
files.splice(N,1); |
This is a plugin meant for Jekyll.
Example use:
Easily embed a YouTube video. Just drop this file in your _plugins
directory.
{% youtube oHg5SJYRHA0 %}
As configured in my dotfiles.
start new:
tmux
start new with session name:
Convenience function for performing a groupBy
on a list then a sortBy
on the resulting groups using Underscore methods.
sortedGroupBy(list, groupByIterator, sortByIterator)
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
#!/bin/bash | |
export AWS_ACCESS_KEY_ID=YOUR_ACCESS_KEY | |
export AWS_SECRET_ACCESS_KEY=YOUR_SECRET_ACCESS_KEY | |
export PASSPHRASE=YOU_PASSHRASE | |
# directories, space separated | |
SOURCE="/home/thomas/backup /home/thomas/bin /home/thomas/documents" | |
BUCKET=s3+http://mybucket | |
LOGFILE=/home/thomas/tmp/duplicity.log | |
# set email to receive a backup report |
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
// UMD dance - https://github.com/umdjs/umd | |
!function(root, factory) { | |
if (typeof define === 'function' && define.amd) { | |
define(['jquery'], factory); | |
} else { | |
factory(root.jQuery); | |
} | |
}(this, function($) { | |
'use strict'; |
#Node - File Paths
##File Paths Node has a path module which can be used to manipulate paths.
###Normalizing Paths Paths can be stored in different ways and it is neccessary to ensure that the path is standardized.
var path = require('path');
path.normalize('/foo/bar//baz/asdf/quux/..');
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
#!/bin/bash | |
if [ $# -ne 2 ]; then | |
echo "Usage: $0 file partSizeInMb"; | |
exit 0; | |
fi | |
file=$1 | |
if [ ! -f "$file" ]; then |