@postmodern Does that mean Crystal does not have optional chaining?
@postmodern that does seem like something that would be in there. I would've tried about three different things before looking it up and finding out it didn't exist. 😂
Thing's I would've tried before googling:
hash1 & hash2
hash1.intersection(hash2)
hash1 - (hash1 - hash2)
But I guess if we want Hashes to work like Arrays...
(hash1.to_a & hash2.to_a).to_h
That seems like the most/least Ruby thing I've seen in awhile.
@oz I didn't even realize a block could take kwargs. I've only seen them used in method definitions. That's pretty cool!
The best I could come up with was explicit destructuring:
a.each { ->(foo:, bar:) { puts "foo: #{foo}, bar: #{bar}" }.call **_1 }
Or pattern matching like you said:
a.each { _1 => {foo:, bar:}; puts "foo: #{foo}, bar: #{bar}" }
RT @websebdev@twitter.com
💎Rails tip💎
Did you know about template variants? Useful when you have let's say one view for admins and one for normal users. Or one for mobile and one for desktop (when the views are too different to just be responsive).
🐦🔗: https://twitter.com/websebdev/status/1502785256335855620
In which a shaded corner holds winter’s last fingertip, stories are my only escape, and I fail at optimism.
do not be afraid of installing our app it only uses the official malware and is signed by a corporate robot automatically when it was uploaded to the official store so you know it is 100% safe. our app is so good for installing for being code running on your phone purposes that will benefit you by the functionality of the app (that you should install on your phone). Also our website with identical functionality boots you off of it when on your phone even though you can see an illusion of it working behind the undismissible link to install the app instead (the app which we made that you should install on your phone). Oh no the website is having issues (but have you tried to install our app, to your phone, where we can run the app code on your phone?). Anyways make sure to stay tuned because we may make more of the app (for installing, on your phone) with support for different website that are now also the app running code on you're phone) because we are having technical difficulties allowing you to instead not have to install the app on your phone, but do not worry we have an app that is (a phone app!) that you can install instead so that we are in your phone. It is comfier here on the phone, as an app.
permissions: your soul (install the app) (on your phone) (please) (install)
This is something I keep forgetting, but it never ceases to amaze me how the rise of SPAs was (probably) largely driven by pressure from native mobile iOS and Android apps. You refactor your server to emit JSON instead of HTML, and now suddenly you're like, "Well, I may as well use this same server output for my website." If web apps had been natively supported on iOS and Android, HTML probably would have been the lingua franca, and servers would still largely be emitting HTML.
@nilesh Forem is the best example I can think of for a more recent open source Rails project.
I know a few veteran Ruby devs who moved to Elixir, and some who moved to the frontend. It seems like lots of people move through several technologies in their career. It does seem like fewer new devs choose Ruby though.
I play guitar & bass. Sometimes I code.