Tutorials
Ruby concurrency: in praise of condition variables · vaneyckt.io
In a previous post, we talked about the benefits conferred by Ruby mutexes. While a programmer’s familiarity with mutexes is likely to depend on what kind of programs she usually writes, most developers tend to be at least somewhat familiar with t...
Implementing classification using a SVM in Ruby - Practical Artificial Intelligence
In this blog post I will show how to implement a support vector machine (SVM) in Ruby, and how to use it to solve a simple classification problem. We will be using the RubyGem rb-libsvm to help us setup a SVM, train it and make predictions in a mi...
A Fresh Cup - Home - Introduction to Active Storage
Today DHH announced Active Storage: a new gem that makes it easy to attach Amazon S3 or Google Cloud Storage files to Active Record model instances. Looks like this is slated to become part of Rails in 5.2. I happen to have a Rails 5.2 application...
rails/activestorage: Store files in Rails applications
A key difference to how Active Storage works compared to other attachment solutions in Rails is through the use of built-in Blob and Attachment models (backed by Active Record). This means existing application models do not need to be modified wit...
Build a query parser (using Ruby, Parslet, and Elasticsearch)
However, it's better to write your own query parser, for two reasons. First, built-in parsers are too powerful. They are confusing and allow users to trigger expensive queries that kill performance. Second, built-in parsers are too generic. There ...
Single file Rails applications (for fun and bug reporting) | Christoph Lupprich
As you might know from previous posts, I keep a Rails playground project around. That’s a small application with a bunch of models, controllers and accompanying tests. It allows me to quickly try out a new gem that was mentioned in a blog post, se...
Rails' CurrentAttributes considered harmful - Ryan Bigg
Very briefly, it makes program state unpredictable.To elaborate, imagine you have a couple of objects that both use the same global variable. Assuming you're not using a source of randomness anywhere within either module, then the output of a part...