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
Post Preview
Note: Only the first pargraph is shown on the front page and overly long paragraphs may be broken up.
Ruby Support for AWS Lambda
AWS announced support for Ruby on AWS Lambda. [more inside]
Mastering data structures in Ruby — Graphs.
On this post I’ll show you how to implement graphs from scratch Ruby. Check it out I hope you find it useful!
Ruby Quiz - Challenge #6 - Build the Table of Contents (ToC) for Documents
Ruby Quiz - Challenge #6 - Build the Table of Contents (ToC) for Documents in Markdown. Happy data wrangling and text processing with ruby.
Using IMGIX to Personalize Knolled Images
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.
Deploying a Rails 5.2 PostgreSQL app on AWS Elastic Beanstalk
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.
Finding Ruby Performance Hotspots via Allocation Stats
I wrote up a walk-through of how I discovered and fixed some performance issues in the RubyParser gem by investigating object allocations.
Sandboxed Rake Tasks for Your Rails app!
Write sandboxed Rake tasks that rolls back any changes you made in the database! [more inside]
Your language's built-in server was never meant for production use (the Ruby version)
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/
Stopping slow client DoS attacks with Puma on Passenger 6
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/
Stub active record relations in tests
If you fight with your slow specs this article can be helpful: https://railsguides.net/stub-active-record-associations/
Better Ruby Gem caching on CircleCI
I’m saving a whopping 2 minutes for every build on CircleCI by using more robust Gem caching. Read Better Ruby Gem caching on CircleCI and so can you.
Advanced Ruby exception handling
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]
ApiStruct - API wrapper builder with response serialization
Build on top of dry-monads and http Provides ORM-like behavior of API responses https://github.com/rubygarage/api_struct
How to recycle ideas
Just a couple of ideas about learning new things and using it in existing rails applications to develop more maintainable code.
Four Things About Pry
Last month I wrote a little blogpost about Pry. In it I talk about a few features which I think to be very useful for everyone, mostly newcomers.
RubyMine 2018.3 Released
The new version adds full support for Struct and rails scopes, improves i18n and refactoring features, allows you to work with pull requests right inside the IDE, and adds many other things. [more inside]
Why on earth do Fibers exist?
For a long time, I couldn’t understand what is the purpose of fibers in ruby. I could understand how to use then, but I didn’t understand when or why should I. This blogpost is a result of small research, I’ve do to find my answers.
Database based uniqueness validations for ActiveRecord
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!
Consistency between database constraints and ActiveRecord validations
Check out my new gem database_consistency`. You can read my article on reddit for details. Any feedback is very appriciated!
All things Rack
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/
Introducing Modulation - explicit dependency management for Ruby
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.
AnyCable v0.6.0 released!
Check out the brand new docs website for more: https://docs.anycable.io [more inside]
Mastering data structures in Ruby — AVL Trees.
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.
Have you tried Dependabot yet?
I’ve been using Dependabot for a while — it’s like adding a developer to your team. I’m really impressed so I wrote about why.