- iTerm 2
- Oh My Zsh
- Powerline shell: path bars, edit config and remove username and hostname
- Meslo Powerline Font as you need a font that supports the directory characters for powerline
- Homebrew
- RVM
- Bundler
- direnv: Unclutter your .profile
- z: quickly jump between projects. Like Alfred but for your Terminal reduced to folder search only
echo "gem: --no-document" >> ~/.gemrc
to stop installing docs every time you install a gem
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/sh | |
COMMIT_FILE=$1 | |
COMMIT_MSG=$(cat $1) | |
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) | |
JIRA_ID=$(echo "$CURRENT_BRANCH" | grep -Eo "[A-Z0-9]{1,10}-?[A-Z0-9]+-\d+") | |
if [ ! -z "$JIRA_ID" ]; then | |
echo "[$JIRA_ID] $COMMIT_MSG" > $COMMIT_FILE | |
echo "JIRA ID '$JIRA_ID', matched in current branch name, prepended to commit message. (Use --no-verify to skip)" |
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
rvm use ruby-2.0.0@project_name --ruby-version --create |
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
public struct VersionNumber: Equatable, Comparable { | |
public let version: String | |
public init(version: String) { | |
self.version = version | |
} | |
} | |
// Returns 1 if lhs > rhs, -1 if lhs < rhs and 0 if lhs = rhs | |
private func compare(_ lhs: VersionNumber, _ rhs: VersionNumber) -> Int { |
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
public class ABTester { | |
public init() {} | |
/** Randomly chooses a weighted generic item from a list of item | |
- item: a weighted item | |
- more: more weighted items as a variadic parameter | |
- randomNumberGenerator: random number generator | |
- returns: the selected generic item | |
- discussion: | |
We force the first item to be provided so we ensure that we don't end up with an empty list of items |
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
public extension String { | |
public func localize(tableName tableName: String? = nil, bundle: NSBundle = NSBundle.mainBundle(), comment: String = "") -> String { | |
return NSLocalizedString( | |
self, | |
tableName: tableName, | |
bundle: bundle, | |
value: "", | |
comment: comment) | |
} | |
} |