サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
アメリカ大統領選
coderrr.wordpress.com
Shameless Plug: Hide your IP address from snooping websites to regain your privacy with a VPN Service. This came up from someone’s question on IRC. Here’s a simple way to get your local IP address in Ruby without spawning a shell and without making a connection. require 'socket' def local_ip orig, Socket.do_not_reverse_lookup = Socket.do_not_reverse_lookup, true # turn off reverse DNS resolution t
||= is an extremely useful ruby operator that lots of people learn to love and use often. The problem is it doesn’t mix well with threading (shared writable variables in specific) because it’s not atomic. I’ve been noticing a lot of people making these mistakes recently, even in code which touts being thread safe (even in my own x_x). It’s an easy mistake to make so I figured I should explain what
I just wanted to go over the different ways Rails 2.2 can clean up your DB connections. 1. ActiveRecord::Base.clear_reloadable_connections! If you don’t have cache_classes set to true, which means you are probably in development mode, then Rails will call ActiveRecord::Base.clear_reloadable_connections! after every request. def clear_reloadable_connections! @reserved_connections.each do |name, co
このページを最初にブックマークしてみませんか?
『coderrr | coderrr』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く