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.
Rails: Grouping The Records By Date Using Enumerable#group_by Method
Here is the simple example which uses the group_by method to group records by it’s created_at date differentiating today’s messages with other days’ messages. https://www.botreetechnologies.com/blog/rails-grouping-the-records-by-group-by-method
Understanding differences between create_or_find_by and find_or_create_by
It is important to know the expected usage of an web endpoint when picking between Activice Records helper create_or_find_by or find_or_create_by. Know the DB interactions that best fit your needs and how one implementation could be up to 4X faster depending on your needs.
Software Engineers are basically Carpenters
Do you know, software engineers are basically carpenters. This analogy will help you to boost your productivity. Read more here: https://mayurkumarpatel.medium.com/how-engineers-are-basically-carpenters-9f1b3c38a511
Implementing Jekyll blog
This year I migrated my blog over to Jekyll, a Ruby static site generator. If you are thinking about setting up a new Jekyll site, I wrote Migrating WordPress blog to Jekyll with a lot of tips.
Introducing Stimulus components
Stimulus Components is a set of Stimulus controllers with a first class support of Rails. [more inside]
Splitting Rails migration into smaller pieces
If the table is huge and such a migration takes a lot of time, it sounds natural to split it into smaller pieces and run them without locking the table. See some thoughts about this approach here: https://veelenga.github.io/splitting-rails-migration-into-smaller-pieces
Track User Events and Visits in Rails using Ahoy GEM!
There could be other such use-cases where we need to use the data available from such third-party service and acquire some new parameters. https://www.botreetechnologies.com/blog/ahoy-an-analytics-for-rails-track-events-and-visits
Shortest Ruby Syntax Highlighting Implementation with Glimmer
Glimmer DSL for SWT 4.17.4.0 ships with a number of changes, such as the new code_text syntax highlighting custom widget, the Glimmer Meta-Sample (The Sample of Samples), and the Hello, Sash Form! Sample. One noteworthy thing to mention about implementing code_text is that with Glimmer Ruby syntax, it was the shortest Syntax Highlighting implementation of SWT StyledText I have ever seen compared to various resources online.
https://andymaleh.blogspot.com/2020/10/glimmer-syntax-highlighting-text-widget.html
Rails API: be nice to your clients
A collection of tips and tricks (with code!) to write smart and nice APIs in Ruby on Rails. [more inside]
Truemail 2.0.1 has been released 🚀
Fixed smtp-requests behaviour, released developers documentation 📚 Be sure that email address valid and exists 📨 https://github.com/truemail-rb/truemail
Implementing fastlane in 50 lines of code
Thousands of mobile developers use the fastlane gem and its DSL on a daily basis, but only a few understand that they’re writing Ruby. This post shows how you can recreate the main concepts of Fastlane in 50 lines of Ruby. [more inside]
Sane Excel file generation with Ruby on Rails
Read about 3 steps we took to reduce our memory footprint (0.2Gb instead of 4Gb) and the time when generating Excel reports (2m instead of 15m). [more inside]
ClickHouse for Ruby
ClickHouse Ruby Gem v1.3.3. released with support of Yandex ClickHouse Server v20.9.3.45 [more inside]
How To Enable SSL For Rails Development Environment In Two Minutes
Learn more about how to enable SSL for Rails development environment in two minutes. read about how we can enable SSL on thin server. https://www.botreetechnologies.com/blog/enable-ssl-for-rails-development-environment-two-minutes
Desktopify Web Apps with One Glimmer Command
You read that right! Not only can you webify desktop apps in Glimmer, but you can also desktopify web apps with a new Glimmer scaffolding command (added in v4.17.3.0)! https://andymaleh.blogspot.com/2020/10/desktopify-web-apps-with-one-glimmer.html
Ruby 3 adds a new method name on Symbol class
One of the important aspects of Ruby 3.0 is optimization. The part of that optimization is the introduction of the name method for Symbol. Read more at https://blog.bigbinary.com/2020/10/12/ruby-3-adds-symbol-name.html
football-to-sqlite - load / read football.txt match datafiles into a sqlite database
Hello, inspired by the datasette {db,dbf,markdown,geojson,shapefile}-to-sqlite series I have put together the missing football-to-sqlite tool that lets you load / read football.txt match datafiles (e.g. English Premier League, German Bundesliga, Spanish La Liga 2020/21, etc.) into a sqlite database. Example: football-to-sqlite england.db 2020-21\1-premierleague.txt
Enjoy the beautiful game with ruby. Cheers. Prost.