128 Followers
172 Following
316 Posts
I'm a Rubyist, I've been writing code since 1981, since I was 8 years old. I'm a father, husband, sailor, and overall nice guy. I'm HoH/Deaf, I speak English, but prefer ASL. (he/him)
github.comhttps://github.com/jimnanney
I may never be famous, but at least I still hold a sailing record (for now)

More fresh ink! Artwork by my own offspring (definitely better than me at this stuff).

The tattoo is a reminder to me that losing my hearing is not a loss of anything except my hearing.

Got a new tattoo, the ASL handshape for “I Love you”.

In my hearing loss journey, I’m 60% loss, or moderate to severe. Down from 10% 15 years ago. I’ve been learning #ASL for 8 months and it has replaced my day to day language. I can’t explain just how much easier it is to not strain to hear to understand people. Hearing aids helped but ASL has completely made things 100% better.

I have a long way to go, but if you are on this journey, find your local deaf community and learn.

#deaf #love

If you wish to memoize (cache / calculate only once) a value, a Hash with a block in ruby is a good way to do it.

For example:

h = Hash.new do |hash, key|
hash[key] = "Default value for #{key} "
end

h.fetch(:no_such, "not defined")
#=> "not defined"

h[:no_such]
# => "Default value for no_such"

This is means the value for h[:no_such] gets set the first time it is accessed and no longer needs to be calculated with the block, but fetch does not use that default proc.

#Ruby #RubyTips