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.
Latest reCAPTCHA v3 + Rails app
https://github.com/igorkasyanchuk/new_google_recaptcha allows integrating the latest reCAPTCHA v3 and your Rails app.
4 Ways to Scale on Heroku
In this 18-minute talk, I explain my approach and mental model for scaling Rails apps on Heroku. Check out the summary here.
2FA google authentication with Active Admin
Have you ever implemented 2FA google authentication on rails app? Well I bet you haven’t with Active Admin. [more inside]
Ruby on Rails Security
Folks still get the basics of Rails security wrong. Here’s a few big ones. I think it comes from too much reliance on assuming a “security engineer” will come in and pay attention. They never come.
Performance of Regular Expressions
Regexps are useful, neat and dangerous. Uncarefully written regular expression may hang both frontend and backend apps severely harming user experience and causing headaches at debugging stage. Read our blogpost on regexp performance to see when it could happen, understand how the regular expression engine work and what to do to optimize regexps. Benchmarks, real-word stories, step-by-step analyses and live examples included!
Building a Ruby C Extension From Scratch
In this edition of Ruby Magic, we’ll show you how to use code written in C from Ruby. This can be used to optimize performance sensitive parts of your code or to create an interface between a C library and Ruby. Read all about it.
Is Rouge the best code highlighting solutions for ruby apps?
We needed to implement the code highlighting solution for our blogs, and after some research we decided to use Rouge. In this article I present the detailed guide how to do that. [more inside]
Working with ActiveRecord Callbacks
This article goes through some helpful tips when working with ActiveRecord callbacks. [more inside]
The Architecture No One Needs
Single-page apps are all the rage these days despite being an awful business decision 99% of the time. The Architecture No One Needs argues why SPAs are a poor investment and offers some alternative solutions.
Forms—Comparing Django to Rails
This article is a short study in web application design, comparing Rails to Django using a simple web form as an example.
Building auto login for fast Rails development with Sorcery
Learn how to build auto login with Sorcery to speed up your development.
Ruby Quiz is Back (Fortnightly)! Challenge #1 - Read Comma-Separated Values (CSV)
Hello,
The Ruby Quiz is now back fortnightly (once every two weeks). Challenge #1 - Read Comma-Separated Values (CSV) from the “Real World”.
Let’s use the test.csv file from Apache Commons CSV Reader. The challenge: Code a parse method that passes the RubyQuizTest :-). Start from scratch or, yes, use any library / gem you can find. To qualify for solving the code challenge / puzzle you must pass the test. Post your code snippets on the “official” Ruby Quiz Channel,
that is, the ruby-talk mailing list. Happy hacking and data wrangling with Ruby.
PS: Thanks to RubyFlow and Peter Cooper for blocking my account. Last post (really only an edit others get blocked). See you in the free world. All the best. Cheers. Prost. PPS: If that’s how you treat your friends - how do you treat your enemies :-)..
Introducing Enkrip
Enkrip is Ruby gem to make your Active Record model seamlessly encrypt and decrypt your desired attributes. Under the hood it uses ActiveSupport::MessageEncryptor for encryption and decryption. https://www.railsmine.net/2018/10/introducing-enkrip.html
Galaaz: Better R for Ruby integration
Using GraalVM, now it is possible to smoothly integrate R invocations into Ruby code: https://towardsdatascience.com/ruby-plotting-with-galaaz-an-example-of-tightly-coupling-ruby-and-r-in-graalvm-520b69e21021
Why the CSV library is broken (Part VI) - Fast, Faster, Fasterer, Fastest
Hello, I’ve written a new (and sixth) episode on why the CSV standard library is broken (and how to fix it). Let’s have a look at fixes in alternative CSV libraries out there: Fixes in Alternative CSV Libraries or Evolve or Die or Fast, Faster, Fasterer, Fastest Questions and comments welcome. Cheers. Prost. PS: If you want to see other (more) CSV formats / dialects pre-configured and supported “out-of-the-box” in the new csv reader, please tell. PS: (Update) Added Part VII or What’s Your Type? Guess. Again. And Again. And Again. Guess What’s a Schema For?
A Safer RuboCop
I wrote a short post on RuboCop’s improved safety in version 0.60.
HexaPDF 0.8.0 released - Box layout
The latest version of HexaPDF adds functionality to automatically place boxes on a page and flow text around arbitrary shapes. See https://hexapdf.gettalong.org/news/2018/hexapdf-0-8-0-box-layout.html for details
The short guide to learning how Classes work in Ruby
In this article, we’re going to explore the following topics:
How to use HMAC-SHA256 to connect to an API
I could not find much about using HMAC-SHA256 to connect to an API. So I figured it out and wrote a blog post about it. I used Ticketmatic as an example but this will work for other API’s too. https://www.runrails.com/programming/how-to-use-hmac-sha256-to-connect-to-a-rest-api-like-ticketmatic/
Domain Driven Rails Architecture
The following article describes DDD flavoured Rails application layout https://bpohoriletz.github.io/2018/10/26/domain-driven-rails-architecture-pattern.html
Launching Your Own Ruby Gem - Part 1: Build It
I’ll show you how to build a simple Ruby gem from scratch and publish it. By creating your own gem you can contribute back to the Ruby developers community https://buttercms.com/blog/launching-your-own-ruby-gem-build-it
New and shiny Passenger Docs
The new Passenger Docs just launched. We’ve updated, rerouted and regrouped our developer documentation for better discoverability and better flow: https://blog.phusion.nl/2018/10/25/passenger-docs/
How to Use Repository Pattern with Active Record
Let me guide you through the process of creating a repository pattern with Active Record in Rails, share some tips for improvement and lessons learned. https://www.monterail.com/blog/repository-pattern-active-record
Handling exceptions in Rails API applications
Handling exceptions in your API applications is quite an important thing, and if you want to keep things DRY, you should think how to do it in the proper way. https://driggl.com/blog/a/handling-exceptions-in-rails-applications [more inside]