The Ruby and Rails community linklog
Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!
Submit a post
Note: Only the first pargraph is shown on the front page and overly long paragraphs may be broken up.
Ruby Quiz - Challenge #6 - Build the Table of Contents (ToC) for Documents in Markdown. Happy data wrangling and text processing with ruby.
Even here at Custom Ink, we use knolling to showcase our products. But how could we personalize knolled images to help our customers visualize their creations? We often use IMGIX to help us process & optimize catalog images and decided to give its blending capabilities a try out. Let’s jump right in and explore how.
After using Heroku for years, I wanted to give AWS Elastic Beanstalk a try. My experience during deployment was less-than-stellar, so I wrote a tutorial on deploying a Rails 5.2 / PostgreSQL app on AWS Elastic Beanstalk to help others who might be in the same situation I was.
I wrote up a walk-through of how I discovered and fixed some performance issues in the RubyParser gem by investigating object allocations.
The de facto web server that ships with your language hasn’t been hardened against attacks, and using it outside of development is irresponsible: https://blog.phusion.nl/2018/11/28/why-you-need-a-ruby-app-server/
There’s something to say for combining Puma and Passenger, the 2 most popular app servers for Ruby applications, in fighting off slow client DoS attacks: https://blog.phusion.nl/2018/11/28/stopping-slow-client-dos-attacks-with-puma-on-passenger-6/
If you fight with your slow specs this article can be helpful: https://railsguides.net/stub-active-record-associations/
How many times have you, while investigating an (admittedly rare ;)) production bug, stumbled upon an exception backtrace that just doesn’t have enough information? For example, an exception gets reraised, destroying the original backtrace with it. So now your logs say that your AI failed to take over the world with AIEpicFailError (great, you already know that), but not why (Timeout::Error while connecting to stackoverflow.com). [more inside]
Build on top of dry-monads and http Provides ORM-like behavior of API responses https://github.com/rubygarage/api_struct
Remember the problem with uniqueness validation in ActiveRecord? Yes, it doesn’t guarantee the uniqueness! Check out database_validations gem. You can also read the article on reddit about it. Feel free to contribute!
Wetransfer’s Wander, and Red Hat’s Dávid Halász on serving more than 10k connections from a single Ruby process, and smuggling TCP traffic through an HTTP connection, at the Amsterdam Ruby meetup: https://blog.phusion.nl/2018/11/23/all-things-rack-in-amsterdam/
I’d like to introduce a project I’ve been working on in the last few month, Modulation, a small gem providing an alternative way to manage dependencies in your Ruby applications. For more information, visit the Modulation repository.
I just published a new post on the Mastering data structures in Ruby. This time, I show you how to implement AVL trees in Ruby. AVL trees a special kind of self-balancing binary search trees that are great for lookups on large datasets. I hope you enjoy it.
It’s great to build SQL queries in Ruby. However, it’s not great when you have to drop to raw SQL as soon as you need to write a more complex SQL expression. At Citrusbyte we use Sequel, which has an extensive SQL expression API that allows us to build even the most advanced SQL expressions in Ruby. In this article I talk more about it and compare it with Active Record.