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
# This unfortunate hack is necessary because ActiveRecord doesn't provide any | |
# way (clean or otherwise) to circumvent the default_scope when preloading. | |
# | |
# Here's a closed-but-unresolved issue that goes into it a bit more: | |
# | |
# https://github.com/rails/rails/issues/11036 | |
# | |
# Example usage: | |
# | |
# In this scenario, Product and User may have paranoid deletes, and a |
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
source "http://rubygems.org" | |
# Test passes with version 2.2.3 | |
# gem "mongoid", "2.2.3" | |
# Test fails with version 2.3.2 | |
gem "mongoid", "2.3.2" |
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
<?xml version=\"1.0\" encoding=\"UTF-8\"?> | |
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" | |
xmlns:xsd="http://www.w3.org/2001/XMLSchema" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns:ns0="http://gov.fubar.services/XYZService/" | |
xmlns:ns1="http://gov.fubar.services/xyzreqeust" | |
xmlns:ns2="http://gov.fubar.services/xyzresponse" | |
xmlns:ns3="urn:herp:names:tc:derpy:derp:1.1"> | |
<env:Body> | |
<ns0:getResponseTypeDef> |
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
alias b='bundle' | |
# This gets used daily | |
alias be='b exec' | |
# Run this whenever there's an update to the Gemfile; regularly used. | |
alias bi='b install --path vendor' | |
# Run this the first time you add bundler to a project; rarely used. | |
alias binit='bi && b package && echo '\''vendor/ruby'\'' >> .gitignore' |
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
" Makes cmd-l use vimperator instead of FF location bar | |
map <M-l> :o<Space> | |
" Makes cmd-f use vimperator instead of FF search | |
map <M-f> / | |
" Tab opening with vimperator | |
map <M-t> t | |
" Makes autocompletion show up automatically |
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
(function(){ | |
// easily digestable document ready | |
$(function(){ | |
initializeFoo(); | |
initializeBar(); | |
initializeBaz(); | |
}); | |
// non global functions |
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
# Rails Template: something_great.rb | |
# by Jim Garvin (coderifous) | |
# | |
# Useful gems and plugins | |
# | |
# * shoulda/mocha/factory girl | |
# * pacecar for lots of automatic scopes | |
# * haml | |
# * sprockets for javascript management | |
# * will paginate |
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: ruby vcard_skidoosh.rb vcard.vcf | |
# outputs a bunch of asterisk commands to stdout. | |
# taste it. | |
# Cargo culters: look elsewhere for best practices and good coding principles | |
# Ripped from @rmm5t http://gist.github.com/32998 | |
def format_number(n) | |
n = n.gsub(/\D/, '')[0...11] |