⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
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
require 'json' | |
require 'open-uri' | |
class DependencyChecker | |
def initialize(*gems) | |
@gems = gems.flatten | |
@dep_cache = {} | |
end | |
def all_dependencies |
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
# Mongoid association matchers for RSpec 2.x and 1.x | |
# | |
# Save this file to your spec/support directory | |
# | |
# Usage: | |
# | |
# describe User do | |
# it { should reference_one :profile } | |
# end | |
# |
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
#!/usr/bin/env sh | |
source "$HOME/.rvm/scripts/rvm" | |
rvm default | |
__rvm_load_rvmrc | |
cd . | |
export BUNDLE_PATH=$GEM_HOME | |
exec ruby "$@" |
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
// First, let's define a widget/plugin called "foo" | |
// Either using jQuery's $.fn plugin namespace, for simple stateless plugins... | |
$.fn.foo = function(){ | |
// In this scope, this refers to the element on which the plugin foo() was called | |
// manipulate it and return this at the end, so it can be chainable | |
}; |
This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.
You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf
using homebrew.
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
wget http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem | |
wget http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem | |
gem install linecache19-0.5.13.gem | |
gem install ruby-debug-base19-0.11.26.gem -- --with-ruby-include=$HOME/.rvm/src/ruby-1.9.3-p0 | |
OR if Falcon the last one is use the one below (or whatever) | |
gem install ruby-debug-base19-0.11.26.gem -- --with-ruby-include=$HOME/.rvm/src/ruby-1.9.3-p0-falcon | |
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
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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
module GGeocode | |
### ref: http://code.google.com/apis/maps/documentation/geocoding/ | |
GGeocode::Version = '0.0.3' | |
def GGeocode.version | |
GGeocode::Version | |
end | |
require 'net/http' |
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
# Five lines of code that will make your underscore + CoffeeScript use cleaner. | |
# Creates an underscore function for each function in to_reverse with R (short for Reversed) appended to the name. | |
# The R version moves the function argument (first argument in normal underscore) to the end, | |
# so you can write: | |
$(window).scroll _.throttleR 500, -> | |
console.log "This print's at most every 500ms" | |
# Instead of: | |
$(window).scroll _.throttle -> | |
console.log "This prints at most every 500ms too" |
OlderNewer