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
| # config/initializers/omniauth.rb | |
| module OmniAuth | |
| module Strategies | |
| # tell OmniAuth to load our strategy | |
| autoload :Pixelation, 'lib/pixelation_strategy' | |
| end | |
| end | |
| Rails.application.config.middleware.use OmniAuth::Builder do | |
| provider :twitter, "app_name", "secret" |
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
| # want to nest `Video` under `Media`; had a `videos` collection | |
| # rename the collection: | |
| Mongoid.database.drop_collection('videos') | |
| Mongoid.database.rename_collection('videos', 'media') | |
| # or | |
| Mongoid.database.collection('videos').rename('media') | |
| # change the type of all the existing records |
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
| # install gs (Ghostscript) | |
| # install ImageMagick | |
| # add to ~/.bash_profile: | |
| pdf_to_jpg () { | |
| filename=${1:-5} | |
| precision=${2:-1} | |
| convert -density 150 $filename -background white -alpha background -alpha off +adjoin -quality 100 -sharpen 0x1.0 "${filename%.*}-%0${precision}d.jpg" | |
| } |
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
| kill -s sigusr2 `ps -aux | awk '/puma/ {print $2}' | awk 'NR==1'` |
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 get_in_master='git checkout develop && git pull && git checkout master && git pull && git merge --no-edit develop' | |
| alias push_it='git push && git checkout develop' |
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.application.eager_load! | |
| data = ActiveRecord::Base.descendants.map{|klass| [klass, klass.reflections.map{|k, v| [v.class.name, k]}] } | |
| data.map{|klass, relations| relations.map{|k, v| "#{klass} #{k.gsub('ActiveRecord::Reflection::', '').gsub('Reflection', '').underscore.humanize.downcase} #{v}"} }.flatten | |
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_proxy '10.2.2.1', 8888 | |
| # the ones inspired by the documentation do not work | |
| # http_proxy 'http://10.2.2.1', 8888 | |
| # http_proxy 'http://localhost', 8888 | |
| # http_proxy 'http://127.0.0.1', 8888 |
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 LegacyInspector | |
| def initialize(should_have_data_newer_than=nil) | |
| @should_have_data_newer_than = should_have_data_newer_than || 6.months.ago | |
| end | |
| def connection | |
| @connection ||= ActiveRecord::Base.connection; | |
| end | |
| def tables |
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
| ack TODO app | grep TODO | wc -l; ack TODO lib | grep TODO | wc -l; ack TODO spec | grep TODO | wc -l |
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
| object.constructor |
NewerOlder