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.
Rearmed-JS v2.0.0 Released! - Make your JS code relaxing and readable
I just released v2.0.0 of my plugin Rearmed-JS. This library is a collection of helpful methods and monkey patches for Arrays, Objects, Numbers, and Strings in Javascript that will make your code more relaxing and more readable by taking inspiration from Ruby. Works in the browser and NodeJS. See the changelog for more details. https://github.com/westonganger/rearmed-js
Tips on how to speed up a Ruby Test Suit
“Why on earth is my test suite taking so long to run?” [more inside]
Sequel 5 Released
After 50 releases of Sequel 4, Sequel 5 has been released with frozen datasets, symbol splitting disabled by default, and reduced chance of SQL injection by making SQL code fragment usage explicit.
Ruby: pass by value or pass by reference?
Describes how Ruby passes arguments into functions. http://rubyblog.pro/2017/09/pass-by-value-or-pass-by-reference
The perils of writing request specs using concurrent-ruby under the JVM
On writing request specs for a JRuby API that uses the concurrent-ruby gem: what issues arise and how to fix them. full article
Autocorrect with Postgres Trigrams
I wrote an article about using pg_trgm to implement auto-correction in a Rails app backed by PostgreSQL.
Introduction to Concurrent Ruby Gem
Concurrency is the ability of a program to make progress on a task that is spread out over different slices of time. It allows us to run multiple “threads” at the same time. As one thread may be sleeping or waiting on I/O, another thread may take priority and start working, thus making optimal use of available CPU time. When you think of concurrency, think of “threads”. [more inside]
world.db.starter Sample - Build Your Own HTTP JSON API (w/ world.db)
Hello, I’ve updated the world.db web service starter sample that gets you started building your own HTTP JSON API using the world.db (incl. continents / countries / states / cities / etc.). What’s news? The starter sample now uses the new webservice library (a simplified sinatra 2.0-style library for HTTP JSON APIs). Enjoy. Cheers.
Automate repetitive coding tasks with Snippets
Snippets is a text-editor feature that can save you hours by automating the insertion of certain code blocks that come up often. Learn how to use Snippets in Sublime Text in this short screencast.
How I got RSpec to load 50 times faster
RSpec load time is important in a TDD workflow design environment. Here’s how I got mine to be lightning-fast. https://schwad.github.io/ruby/rails/testing/2017/08/14/50-times-faster-rspec-loading.html [more inside]
Careful what you measure: 2.1 times slower to 4.2 times faster – MJIT vs TruffleRuby
Have you seen the MJIT benchmarks and been impressed by their performance numbers? I was too, but upon closer inspection I’ve seen TruffleRuby go from 2.1 times slower to 4.2 times faster than MJIT. It’s an interesting story of what to measure and what really counts in the end.
Verify user phone numbers in Ruby on Rails with the Authy verification API
If you ever need to contact your application’s users by phone then it’s good practice to verify that the phone number they enter is in fact theirs. Let’s see how to verify phone numbers in a Rails 5 application using the Authy Verification API.
inject vs each_with_object - which is better and when
inject vs each_with_object are quite similar but there are tiny differences. Find out when to use which one and why
How to Implement a GraphQL API in Rails
Let’s explore how to implement a GraphQL API in Rails, something that giants such as GitHub and Shopify are already using in production. Read here.
ExceptionAlarm for Ruby
This simple gem play an alarm sound when an exception is raised on your Ruby code. https://github.com/pioz/exception_alarm
We're a Ruby dev shop and we will continue using Ruby
For the past years, there’s been a growing trend of Ruby dev shops/boutiques/consultancies switching to Elixir or Node. The market is undoubtedly changing and new technologies might be fancier and a good way to broaden one’s toolbelt. [more inside]
A Review of the Hanami Web Framework
This review tends to answer a question if Hanami is really a good alternative to Rails, what features it has and is followed by an attempt to make a simple CRUD application in six hours. [more inside]
Base Rails 5.1 app to get projects started faster
Zen Rails Base Application is a “skeleton” application for Ruby on Rails 5.1 projects, with many pre-configured tools and features. Its purpose is to minimize the time spent writing boilerplate code and performing repetitive setup tasks when starting a new project.
Why I do not use strong parameters in Rails
Strong parameters have supposedly been an improvement in Rails 4. Yet, it feels to me, they were more a marketing trick after Github’s hacking, than a real feature. Read more
13 more gems I use all.the.time
A few months ago I posted an article/story about the 27 Gems I use in Almost Every SaaS Project. Here are a few more gems for your arsenal that may help you out! https://hackernoon.com/13-more-gems-i-use-all-the-time-a17ba64d4b83
A fast chess library that use bitboards to play chess with Ruby
A fast Ruby library to play chess with Ruby. This library is quite fast because rappresent the game situations with bitboards. In addition, the move generator is written in C as a Ruby extension. https://github.com/pioz/chess