Migrate files between ActiveStorage Providers with ease

There are several ways to migrate files between ActiveStorage Provider. I'm gonna use the mirroring way. First setup your new ActiveStorage provider. Let's say for the sake of this post we're going to migrate from local Disk based storage to S3.

Upload ActiveStorage files to nested S3 path

ActiveStorage doesn't support any kind of nesting inside S3 bucket (as of Rails v6.0). But without nesting, managing Multi Tenant application will be just plain hard. Specially is you use different database/schema per tenant.

Seamlessly login to locked down server with SSH ProxyCommand

It's a good practice to lock down the servers behind a firewall and only allow access via VPN. Specially the control ports like SSH, Control Panel etc. That would require you to always connect to the VPN before connecting to the server.

Inspect Websites on iOS

Sometimes it's absolutely horrendous to debug a css/js issue just on iPhone. It's not reproducable on desktop, in responsive view, even not in simulators. But in actual devise it just winks at you!

How to parse first and last name from full name

Sometimes we need to split a full name into first name and last name parts. In Ruby String#split is the default thinking. If the name is just two parts, like "John Doe" it'd work like breeze.