http://hashrocket.com/blog/posts/how-to-switch-from-textmate-to-vim http://www.vimgenius.com http://www.fprintf.net/vimCheatSheet.html http://vim-adventures.com http://www.vimsnake.com http://www.youtube.com/watch?v=9jzWDr24UHQ http://shime.github.io/blog/guard-down-vim-and-tmux-are-here/ http://stevelosh.com/blog/2010/09/coming-home-to-vim http://reefpoints.dockyard.com/2013/11/27/vim-windows.html
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
if (doc['primary_specialization_name'].value == specialization_name) { | |
_score + 1000 | |
} else { | |
_score | |
} |
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
permissions: | |
some_role: | |
- physicians # Can access all actions in physicians controller | |
- admin/inquiries#index # Can access index action in inquiries controller | |
some_other_role: | |
- physicians#show | |
- admin/inquiries | |
- admin/users | |
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
# Usage: | |
# fake_sign_in | |
# fake_sign_in(@user) | |
# fake_sign_in(@admin) | |
# fake_sign_in(:admin) | |
# fake_sign_in(@some_object, :scope => :user) | |
# fake_sign_out | |
# fake_sign_out :admin | |
module ControllerHelpers |
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
module Capybara::Poltergeist | |
class Client | |
private | |
def redirect_stdout(to = nil) | |
to ||= @write_io | |
prev = STDOUT.dup | |
prev.autoclose = false | |
$stdout = to | |
STDOUT.reopen(to) |
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
// Usage: | |
// $('div').gracefullEffect('slideDown') | |
$.fn.gracefullEffect = function(effectName) { | |
fallbacksMap = { | |
slideDown: 'show', | |
slideUp: 'hide' | |
// ... | |
} | |
if ($.support.trailingWhiteSpace) { |
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 | |
# Usage: | |
# Add env variable: /path/to/this/script {environment} add VAR_NAME varvalue | |
# Remove env variable: /path/to/this/script {environment} remove VAR_NAME | |
require 'active_support' | |
app_name = "betterdoc" |
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
class TooltipsAndClientSideValidationsFormBuilder > ActionView::Helpers::FormBuilder | |
def text_field(object_name, method, options = {}) | |
# do nothing if raw option is present (same as rails standard text_field) | |
unless options[:raw] | |
extract_tooltip_options! options | |
extract_validation_options! options | |
end | |
super(object_name, method, options = {}) | |
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
# 1. Extend Chosen with custom method or owerwrite existing methods | |
class CustomChosen extends Chosen | |
show_search_field_default: -> | |
# ... | |
# original method updated | |
# ... | |
some_new_method: -> | |
# ... | |
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
http://fredwu.me/post/60441991350/protip-ruby-devs-please-tweak-your-gc-settings-for | |
http://fredwu.me/post/61571741083/protip-faster-ruby-tests-with-databasecleaner-and | |
http://labs.goclio.com/tuning-ruby-garbage-collection-for-rspec/ |