| ⌘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 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
| map <F2> :mksession! ~/vim_session <cr> " Quick write session with F2 | |
| map <F3> :source ~/vim_session <cr> " And load session with F3 |
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/ruby | |
| require "rubygems" | |
| require "yaml" | |
| class Model | |
| def initialize(file) | |
| @file = file | |
| @_attr = YAML::load_file(@file) || {} | |
| end |
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
| require 'active_support/basic_object' | |
| ActiveRecord::Base.class_eval do | |
| class WithoutCallbacks < ActiveSupport::BasicObject | |
| def initialize(target, types) | |
| @target = target | |
| @types = types | |
| end | |
| def respond_to?(method, include_private = false) |
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 | |
| SPECIAL_TOKEN = 'SpecialTokenForSearch' | |
| WITHOUT_MERGES = "--no-merges" | |
| GIT_COMMIT_LINK="https://github.com/some_projects/commit/:commit" | |
| cmd = `git show-ref --tags` | |
| tags = [] | |
| cmd.each do |l| | |
| tag_commit, tag_name = l.chomp.split(" ") |
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
| #!/bin/sh | |
| ### BEGIN INIT INFO | |
| # Provides: god | |
| # Required-Start: $all | |
| # Required-Stop: $all | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: God | |
| ### END INIT INFO |
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
| # NOTE if you want to do this outside a git repo, find . -type f can by substituted for git grep -l 'Factory' | |
| # fix Factory.create and Factory() | |
| $ git grep -l 'Factory' | xargs perl -pi -e 's/Factory(\.create)?\((\:)?(\w+)(, )?/FactoryGirl\.create\($2$3$4/g' | |
| # fix Factory.build | |
| $ git grep -l 'Factory' | xargs perl -pi -e 's/Factory\.build\((\:)?(\w+)(, )?/FactoryGirl\.build\($1$2$3/g' | |
| # fix Factory.define | |
| # NOTE after running this, at the very least you still have to wrap your definitions sets with a FactoryGirl.define do end block, |
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
| # | |
| # Halftoneapp.com Sample Bluepill Configuration File | |
| # Read more at: http://blog.halftoneapp.com | |
| # | |
| # Set paths | |
| home_dir = "/home/railsapp" | |
| rails_shared = "#{home_dir}/app/shared" | |
| unicorn_path = "/path/to/unicorn_rails" |
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
| Steps to install and run PostgreSQL 9.2 using Homebrew (Mac OS X) | |
| (if you aren't using version 9.1.5, change line 6 with the correct version) | |
| 1. pg_ctl -D /usr/local/var/postgres stop -s -m fast | |
| 2. mv /usr/local/var/postgres /usr/local/var/postgres91 | |
| 3. curl https://raw.github.com/fragility/homebrew/737af01178590950749cf5e841f2d086c57c5a80/Library/Formula/postgresql.rb > /usr/local/Library/Formula/postgresql.rb | |
| 4. brew upgrade postgresql | |
| 5. initdb /usr/local/var/postgres -E utf8 | |
| 6. pg_upgrade -b /usr/local/Cellar/postgresql/9.1.5/bin -B /usr/local/Cellar/postgresql/9.2.0/bin -d /usr/local/var/postgres91 -D /usr/local/var/postgres | |
| 7. pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start |
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
| # Nginx+Unicorn best-practices congifuration guide. Now with SPDY! | |
| # We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies. | |
| # Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module | |
| # | |
| # Deployment structure | |
| # | |
| # SERVER: | |
| # /etc/init.d/nginx (1. nginx) | |
| # /home/app/public_html/app_production/current (Capistrano directory) | |
| # |
OlderNewer