Forked from CSS only Custom Radio Buttons.
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
# migrate | |
add_column :doges, :friends, :text, array: true, default: [] | |
# add an index | |
add_index :doges, :friends, using: :gin | |
# create a Doge | |
Doge.create(name: "Doge", friends: ["snoop", "snoopy"]) | |
# any Doge contains a friend snoop |
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 gdcop="git diff --name-only | grep '\.rb' | tr '\n' ' ' | sed 's/,$/\n/' | xargs rubocop" | |
# $ git status | |
# On branch master | |
# Your branch is up-to-date with 'origin/master'. | |
# Changes not staged for commit: | |
# (use "git add <file>..." to update what will be committed) | |
# (use "git checkout -- <file>..." to discard changes in working directory) | |
# | |
# modified: History.md |
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
# define a closure x that exposes function y | |
x = -> { | |
y = -> { puts "y" }; | |
{ y: y } | |
} | |
# invoke public function y on x | |
x.()[:y].() | |
# alternately |
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
-----BEGIN PGP PUBLIC KEY BLOCK----- | |
Version: GnuPG v1 | |
mQENBFShyekBCACpo9IikwAsume4AUBmqvzPn1vUNjuoicGFwg5QiDJgPo6yLcLL | |
6XiMtkKxOxyWVsss4DAhvvT1AirfEvvB1WZSf6Fvy/SzZCkwyO3pZmuvb/pCqwGM | |
zLuafm/629IjIp5MtI2JvTpihs0KBVypv9GYzJqNO5+u407jwOqzsNU2idnNzwhz | |
gVv69aQXDQY6k5YGR0ZLSDZ7Imd7ERWOjJRsZ2uABfaB1tyMPfjBqaYYvi93RylM | |
f5BOZkCZPSXD6wtqjxd7qBRW6BrjpwGF94dXQBVF3+59UMQT8u6tvBZNNqlYEuN2 | |
O4dbjx6FmRlGsLdsc/OFOcIlTHuiyke4kdCbABEBAAG0IVRlZSBQYXJoYW0gPHBh | |
cmhhbWV0ZXJAZ21haWwuY29tPokBOAQTAQIAIgUCVKHJ6QIbAwYLCQgHAwIGFQgC |
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 X | |
# implicit self | |
def get | |
value | |
end | |
# explicit self does not work when you call a private method | |
def get_self | |
self.value | |
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
attachments: parent_id, asset_id | |
domain_names: organisation_id | |
event_memberships: user_id, event_id | |
events: editor_id | |
group_actions: user_id, group_id | |
groups: user_id | |
icons: parent_id | |
invitations: sender_id | |
legacy_actions: item_upon_id | |
news_items: author_id |
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 'rdoc' | |
converter = RDoc::Markup::ToMarkdown.new | |
rdoc = File.read(ARGV[0] || 'README.rdoc') | |
puts converter.convert(rdoc) | |
# ruby rdoc2md.rb > README.md | |
# ruby rdoc2md.rb ABC.rdoc > abc.md |
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
# TL/DR; run `vacuum full` on your postgres databases | |
# auto-vacuuming is on by default but the thresholds are fairly high | |
http://www.postgresql.org/docs/9.3/static/sql-vacuum.html | |
http://www.postgresql.org/docs/9.3/static/routine-vacuuming.html | |
# ---> autovacuum & track_counts are on by default. In postgresql.conf: | |
# track_counts = on | |
# autovacuum = on |
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
brew upgrade libxml2 | |
brew cleanup | |
gem unin nokogiri | |
bundle config build.nokogiri --with-xml2-include=/usr/local/Cellar/libxml2/2.9.1/include/libxml2/ --with-xml2-lib=/usr/local/Cellar/libxml2/2.9.1/lib/ --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.28/ --with-iconv-include=/usr/local/Cellar/libiconv/1.13.1/include/ --with-iconv-lib=/usr/local/Cellar/libiconv/1.13.1/lib/ | |
bundle install nokogiri | |
# same as above, but readable: | |
# bundle config build.nokogiri |