Programming posts of interest
This is list a list of programming articles that I find interesting and may want to reference again in the future. For now I’m going to organize them by language and/or framework.
- Build concurrency control in Sidekiq: This tutorial article shows how one can leverage Redis to lock resources. It’s context is locking Sidekiq jobs, but it would be easily repurposed to lock anything. Also, worth noting, the paid version of Sidekiq (Sidekiq ENT) already has a unique_for option. The general pattern/algorithm this article demonstrates is also discussed in the Distributed locks with Redis docs.
- Configuring Puma, Unicorn and Passenger for Maximum Efficiency: Shares advice for figuring out how many workers and threads to use for your server configuration based on available CPU and memory resources. For example worker_count = 1.5 x (n hyperthreads). There’s also an explanation of forking and copy-on-write.
- Ruby’s magical Enumerable module:
Shows how to make objects enumerable by creating a
LinkedListclass. See also Make something enumerable for another example.
- Don’t waste your time on assets compilation on Heroku: A silly, click-baity title, but an interesting take on piping Rails assets to a CDN.