This file contains hidden or 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
# Generate TAGS files with bundler projects. Bundle must be updated, and tags binary | |
# must be exuberant ctags. | |
namespace :tags do | |
namespace :generate do | |
desc <<-EOT | |
Generate a new emacs TAGS file for the current project. | |
Requires exuberant ctags and bundler. | |
EOT | |
task :emacs do |
This file contains hidden or 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
#!/usr/bin/env ruby | |
# Copyright: 2011 Opscode, Inc. | |
# Author: Bryan McLellan <[email protected]> | |
# Modified by: Brian Corrigan 2012 | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 |
This file contains hidden or 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
# Add something to my last commit (forgot a comment!) | |
git commit --amend -m "New commit message" | |
# Merge my last two commits | |
git rebase --interactive HEAD~2 | |
# Create the patch file | |
git format-patch HEAD~..HEAD |
This file contains hidden or 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
# Uninstall all ruby gems | |
gem list | cut -d" " -f1 | xargs gem uninstall -aIx | |
# Useful SSH Escape Characters | |
~. Disconnect. | |
~^Z Background ssh. | |
~? Display a list of escape characters. |
This file contains hidden or 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
# Error | |
[Sat Jun 9 17:03:13.111 2012] [ 4912] WARNING: rotating index 'swf_fulltext': rename '/data/sphinx/swf_fulltext.sps' to '/data/lib/sphinx/swf_fulltext.old.sps' failed: No such file or directory | |
[Sat Jun 9 17:03:13.112 2012] [ 4912] WARNING: rotating index 'swf_fulltext': rename to .old failed; using old index | |
# Fix | |
touch /data/lib/swf_fulltext.sps |
This file contains hidden or 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
Show where headers are being output: | |
if (headers_sent($filename, $linenum)) { | |
echo "Headers already sent in $filename on line $linenum\n"; | |
} | |
This file contains hidden or 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
# Display short hash | |
git rev-parse --short HEAD | |
# Delete all merged local branches | |
git branch --merged | grep -v '^* master$' | grep -v '^ master$' | xargs git branch -d | |
# Pretty git log (shows branches) | |
alias gg='git log --oneline --abbrev-commit --all --graph --decorate --color' | |
# Diff a file against the last change |
This file contains hidden or 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
// Knockout, it's just javascript folks. | |
var Foo = function(data) { | |
var that = this; | |
/* | |
* ======== | |
* Map Data | |
* ======== | |
*/ |
This file contains hidden or 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 Toggler = (function() { | |
var totalTogglers = 0; | |
var Toggler = function() { | |
this.linkSelector = ".detail_toggle"; | |
this.detailSelector = ".detail"; | |
this.hiddenClass = "hidden"; | |
this.hideText = "Hide Details"; | |
this.showText = "Show Details"; | |
}; | |
Toggler.prototype = { |
This file contains hidden or 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
Always install Gems into a local directory: | |
bundle install --path ruby_modules --binstubs |