Every couple of weeks, I hear someone complaining about some difficulties with Bundler. Yesterday, it happened twice. But somehow I just never have those difficulties. I'm not saying Bundler is perfect; certainly in its early days it wasn't even close. But for the past two years it's been incredibly solid and trouble-free for me, and I think a large part of the reason is the way I use it. Bundler arguably does too much, and just as with Git, a big part of it is knowing what not to do, and configuring things to avoid the trouble spots.
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
| nnoremap <Leader>yf :let @*=expand("%:p")<cr>:echo "Copied file name to clipboard"<cr> |
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/routes.rb | |
| resources :documents do | |
| scope module: 'documents' do | |
| resources :versions do | |
| post :restore, on: :member | |
| end | |
| resource :lock | |
| end | |
| 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 'sinatra' | |
| require 'openssl' | |
| require 'json' | |
| post '/' do | |
| body = request.body.read | |
| puts "Time : #{Time.now}" | |
| puts "Actual Signature : #{request.env['HTTP_X_CHARGIFY_WEBHOOK_SIGNATURE_HMAC_SHA_256']}" | |
| puts "Computed Signature: #{signature(body)}" |
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 Beer | |
| def sing(start, finish = 0) | |
| start.downto(finish).collect do |number| | |
| verse(number) + "\n" | |
| end.join | |
| end | |
| def verse(number) | |
| Kernel.const_get("Beer::Verse#{number}") | |
| 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 'uri' | |
| require 'multi_json' | |
| require 'net/http' | |
| # Simple client wrapper around Google Geocoding API V3 | |
| # https://developers.google.com/maps/documentation/geocoding | |
| # | |
| # geo = Geocoding::Google.geocode('91106') | |
| # geo.state | |
| # |
ror, scala, jetty, erlang, thrift, mongrel, comet server, my-sql, memchached, varnish, kestrel(mq), starling, gizzard, cassandra, hadoop, vertica, munin, nagios, awstats
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 () { | |
| local zeus_command="" | |
| if _zeus-installed | |
| then | |
| zeus_command="zeus" | |
| fi | |
| $zeus_command rake db:migrate && $zeus_command rake db:rollback && $zeus_command rake db:migrate && $zeus_command rake db:test:prepare | |
| } |
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 Kew | |
| require 'thread' | |
| require 'socket' | |
| def initialize | |
| @pipes = UNIXSocket.pair(:STREAM, 0) | |
| @mutex = Mutex.new | |
| end | |
| def pipe |
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
| # Touch tmp/caching.txt to turn on caching | |
| if Rails.root.join('tmp/caching.txt').exist? | |
| config.action_controller.perform_caching = true | |
| config.cache_store = :mem_cache_store | |
| else | |
| config.action_controller.perform_caching = false | |
| config.cache_store = :null_store | |
| end | |
| # Touch tmp/precompile.txt to test with asset precompiles. Run |