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.
Glimmer Tetris Cont'd: Scoring, Leveling, and Preview
The Glimmer Tetris game that took one day to develop just got improved with Scoring, Leveling, and Next Preview with one more day, thanks to Glimmer DSL for SWT’s incredibly malleable architecture and extensive feature set. [more inside]
3 Practical Uses of Ruby's `method_missing` You Should Know.
Learn the practical uses of Ruby’s method_missing. You can use the method_missing method to handle errors, delegate methods and build DSLs. https://emmanuelhayford.com/3-practical-uses-of-ruby-method-missing/
Glimmer Tetris in One Day!
I present to you Glimmer Tetris in one day! Not bad, right!? Believe me when I tell you it is the cleanest Tetris implementation on Earth! In fact, the main GUI body is only about 6 lines of code. http://andymaleh.blogspot.com/2021/01/glimmer-tetris-in-one-day.html
Russian Doll Caching in HOTWire
Does your app feel slow on page refreshes? You can optimize this loading experience to make it feel more interactive by using a Russian Doll Caching strategy. Follow along as we make 400 comments load immediately! https://onrails.blog/2021/01/22/improving-performance-with-russian-doll-caching-hotwire-tutorial-6/
elliptic gem - elliptic curve cryptography w/ OpenSSL made easy
Hello, I’ve put together the little elliptic gem that makes elliptic curve digital signature algorithm (ECDSA) cryptography with OpenSSL easy / easier (incl. “classic” secp256k1 curve used by ethereum, bitcon, and many others). Cheers. Prosit 2021!
invokable v1.0.0 is out!
Includes keyword argument support, more robust testing, and better error handling! [more inside]
Designing a Ruby Serverless Runtime
I discussed some of the design decisions and trade-offs involved in bringing Ruby support to Google Cloud Functions, the challenge of fitting Ruby conventions with the paradigms of the serverless cloud.
libev_scheduler - a fiber scheduler for Ruby 3.0
Introducing libev_scheduler: a new gem implementing the fiber scheduler interface introduced in Ruby 3.0. For those interested in Ruby fibers and fiber-based concurrency, the README includes some thoughts on the fiber scheduler interface.
tty-progressbar v0.18.0 is out!
The latest tty-progressbar packs many new features. It adds indeterminate mode to show progress for unbounded tasks, supports multibyte characters in bar display, has more than 20 built-in bar formats and allows to pause and resume progress at any time. See changelog for more. Enjoy!
How ActiveRecord Uses Caching To Avoid Unnecessary Trips To The Database
ActiveRecord makes accessing your database easy, but it can also help make it faster by its intelligent use of caching. In this article, Jonathan Miles shows us the tricks that Rails uses to ensure that your database isn’t doing more work than it needs to. https://www.honeybadger.io/blog/rails-activerecord-caching/
Canvas Graphics Come to Glimmer DSL for SWT, Finally!
Canvas graphics have been on my radar for quite a while, but I have been busy focusing on integrating Glimmer DSL for SWT with Glimmer DSL for Opal with webready app scaffolding and the webify glimmer task as that enables users to instantly turn a Glimmer desktop app into a web app. In the meantime, I got contacted on Gitter (Glimmer’s Open-Source Help Chat) for help with Canvas graphics… [more inside]
A Lenient Capybara
Flaky specs with Capybara seem to be a law of nature. Instead of hunting them down one after the other, we learned to stop worrying and let the rodent run.
React Components in Active Admin
I’ve revised and updated my article on creating a custom input field in Active Admin using React: https://medium.com/modern-rails/how-to-use-react-components-in-active-admin-184ff63b378d
crypto-lite Gem Update - New Examples / Cookbook - Bitcon (Base58) Address Generation
Hello, I’ve added a new examples / cookbook section to the little crypto-lite gem / library. The first example is a look inside the magic bubble machine and shows you how to generate / calculate the bitcon (base58) address form the (elliptic curve) public key in 1-2-3 steps. Cheers. Prosit 2021!
Debugging with pry-byebug: moving in the stack frame
Let’s be honest, debugging just never really ends, right? The more you learn, the more debugging becomes complex. Here’s a write up about some cool pry-byebug features: moving in the stack frame, adding breakpoints on the fly, aliases
Interact with Mysql Server using mysql2 gem [Part 2] – Insert and Update Operations
This tutorial shows how to interact with the MySQL server using mysql2 gem by adding additional methods to help us perform insert and update operations. Link: https://thedevpost.com/blog/update-insert-using-mysql2-gem/
New command option parser benry-cmdopt (and why not optparse?)
New command option parser benry-cmdopt gem released, and
Why new command option parser required instead of standard optparse.rb?
Refactoring Filters
Recently I was working on refactoring some unwieldy code for filtering data. Here’s a short story of how it went: https://tejasbubane.github.io/posts/2021-01-17-refactoring-filters/
base58-alphabets gem V1.0 - base58 encode / decode numbers, hex or binary strings
Hello, I have put together a new base58-alphabets gem that lets you base58 encode / decode numbers, hex or binary strings (incl. leading zeros) with Bitcon or Flickr base58 notation / alphabet. Cheers. Prosit 2021! PS: The base58 / unbase58 methods will be shortly part of the crypto-lite gem / family but you can use the “zero-dependency” gem of course standalone too.
Time travel in Rails app in development (or other env) from UI
https://github.com/igorkasyanchuk/rails_time_travel for easier testing and creating objects in the “past” you can use this gem. It’s bringing a UI page with an interface to change the current time.
Run fast RSpec tests with GitHub Actions parallel jobs
Example of how to configure Github Actions and its parallel jobs to run faster Ruby tests. https://docs.knapsackpro.com/2019/how-to-run-rspec-on-github-actions-for-ruby-on-rails-app-using-parallel-jobs