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.
Meet Yabeda: Modular framework for instrumenting Ruby applications
Introducing Yabeda (Russian for “tattletale”)—a family of gems based on the extendable framework that makes collecting metrics from Ruby applications and exporting them to datastores such as Prometheus easier than ever before. Rails, Sidekiq, and Prometheus are supported out of the box, more integrations are coming, hopefully with the help from the community.
How does Devise keep your passwords safe?
A brief explanation on how Devise alongside Bcrypt store passwords safely. https://medium.com/@alvesjtiago/how-does-devise-keep-your-passwords-safe-d367f6e816eb
New AppPerf Feature - Latency Bands
Hey everyone. Just wanted to share an update that I made to AppPerf (open source application performance monitoring tool). I added a new feature call Latency Bands that tries to combine histograms counts of latencies and percentiles of latencies into a single graph to help identify issues more quickly. You can read about it here: [more inside]
tty-config v0.3.0
The latest release of tty-config adds support for binding settings to environment variables, adding a custom setting aliases, reading and writing INI type files formats which are often used for holding environment configuration variables. Enjoy!
Mining for Gold Using the World's #1 and Most Popular Data Format (w/ Ruby)
Hello, the talk notes from yesterday’s Vienna.rb meetup titled Mining for Gold Using the World’s #1 and Most Popular Data Format (w/ Ruby and CsvReader). Happy data wrangling / mining with Ruby. Cheers. Prost. PS: The talk slides from the 2nd talk titled Designing HexaPDF: Iterarative Design, Orthogonality and Other Design Tools by Thomas Leitner
Livestreaming from Phusion HQ: adding a major feature to Passenger
November 1st Passenger creator Hongli Lai will be livestreaming the implementation of a major feature in the app server. Implementing ‘generic language support’ seemed like the opportune moment to show how Passenger is architected and how we approach writing (C++) code: https://blog.phusion.nl/2018/10/19/livestreaming-from-phusion-hq-adding-a-feature-to-passenger/
Why the ruby community encourages Duck Typing
In this article, we’re going to explore the following topics:
How to Speed up Your Tests without Touching the Code
I wanted to share an interesting discovery. If you’re using Capybara then you might be able to speed up your tests considerably (5 times in my case) by moving the database to tmpfs. I wrote an article showing how: https://www.gregnavis.com/articles/how-to-tune-your-database-to-make-tests-faster.html . The same technique should work in other frameworks (and languages) as long as you don’t wrap test cases in transactions to clean up after them.
`ActiveSupport::StringInquirer` magic
Did you know that ActiveSupport::StringInquirier class is a part of Ruby on Rails codebase? I didn’t. It gives String objects magic powers :-) [more inside]
Open source SEO platform on Rails
The HateFreeWeb.org just open sourced a new SEO platform that detects hate speech, phishing scams, E-mails that where exposed in hacks, accessibility issues, mobile issues and more. As we thought “you are who you link to” (and Google thinks so too!), we pay special attention to problems on sites you are linking to. This means that if you link to a site that has phishing links on it, you enable crimes without knowing it. It’s a very useful tool for web designers, software developers and every business that runs a website. It’s all on GitHub! Happy forking and let’s make the Internet a safer place:) https://www.hatefreeweb.org
Create a maintainable and scalable search in your Rails apps
Search is quite a common problem in any app. The main issue is that search has to evolve over time to allow the users to refine their results based on your ever-evolving data. [more inside]
Rails 5.2 disallows raw SQL in dangerous Active Record methods
Hello, I’ve published the https://blog.bigbinary.com/2018/10/16/rails-5-2-disallows-raw-sql-in-active-record.html that will guide you how we can prevent SQL injections in Rails.
tabreader library / gem v1.0 - read in tabular datafiles in text in the TAB format
Hello, I’ve published the tabreader library / gem version 1.0
that lets you
read in tabular datafiles in text in the tabular (TAB) format.
Use Tab.parse or Tab.read or Tab.foreach or Tab.open or Tab.new.
Or with headers (column names in the first row) use TabHash.parse or TabHash.read and so on.
Yes, tabreader uses "1\t2\t3".split( "\t" ) for parsing :-).
Happy data wrangling with ruby. Cheers. Prost. PS: The FAQ in the README includes:
Q: Why NOT use Csv.read( sep: "\t" )? ++
Q: What’s the tabulator (TAB) format? ++
Q: Why tab? ++
Q: Why NOT tab?
How to move from ActiveRecordSerializers to Fast JSON API
As the ActiveRecordSerializers Gem is not used anymore, it’s nice to have a replacement. Here I describe How to move from one gem to another. [more inside]
How to Use the Ruby Grep Method
Discover how to use Grep to filter enumerable objects in interesting ways! https://www.rubyguides.com/2018/10/grep-method-with-examples/
Speaking on Ruby and Chronic Pain Management in Sheffield
I was recently invited to Sheffield Ruby User Group to share the story of MaraBot, a very personal project to help use machine learning and weather shifts to regain control over managing chronic pain: https://schwad.github.io/ruby/rails/community/2018/10/16/speaking-on-ruby-and-chronic-pain-management-at-sheffield-ruby.html
Distributed cron for Rails apps with Sidekiq Scheduler
In some of our Ruby on Rails applications, we have migrated from using OS based cron to distributed cron using Sidekiq Scheduler. We will discuss the motivation for this change and the benefits from it. https://godaddy.github.io/2018/10/15/distributed-cron-for-rails-apps-with-sidekiq-scheduler/
Spotting unsafe concurrent Ruby patterns - talk recording
Writing Ruby code that uses threads is a great way to get better performance and improve your app’s user experience. It can also be quite daunting due to the often-feared “concurrency bugs”. In this talk, recorded at the Fullstack LX Ruby meetup, I introduce a number of pitfalls to watch out for, presenting correct (and fast!) alternatives for each. [more inside]
csvjson library / gem v1.0 - read tabular data in the CSV ♥ JSON format
Hello, I’ve published a new library / gem, that is, csvjson that lets you read tabular data in the (new) CSV <3 JSON format, that is, comma-separated values CSV (line-by-line) records with javascript object notation (JSON) encoding rules. Happy data wrangling with ruby (and csv and json). Cheers. Prost.
How we halved our memory consumption in Rails with jemalloc
I recently wrote a blog post on how we halved our memory consumption, and drastically increased speed, in our Ruby on Rails app just by switching to jemalloc: https://medium.com/rubyinside/how-we-halved-our-memory-consumption-in-rails-with-jemalloc-86afa4e54aa3 If anyone has any thoughts, or other tips for performance optimisation, please do leave a comment!
Working with Thread in Ruby
Little article about Thread in Ruby and how you can use it for I/O operations: Medium post
Serverless Platform for Ruby - FaaStRuby 0.2.0 Released!
Hey there, FaaStRuby 0.2.0 is out! This version comes with lots of improvements. Top 2 highlights: Functions are packaged, deployed and managed individually (no more pulling from git repository) | TESTS! Functions can have tests and they can be configured to run before each deploy, aborting if it fails. Feedback is greatly appreciated!
Why the standard CSV library author deserves our hugs and thank yous
Hello, I’ve written a new episode in the why the csv standard library is broken, broken, broken (and how to fix it). It’s a new introduction to the series titled “I apologize - Sorry, Sorry, Sorry.” to clarify that I am in no way blaming the author (really I’m blaming YOU :-), that is, all the free-loaders waiting for a miracle. The author or the authors of the standard CSV library deserve our hugs and thank yous for the great work and many hours (for sure many unpaid and volunteered) put into the CSV library. We are all standing on the shoulders of giants. Thank you. Thank you. Thank you. Cheers. Prost.
Invisible Captcha, a honeypot protection gem for Rails, new release!
Hello 👋 I just released a new version of Invisible Captcha (v0.11.0), a gem to protect your forms/actions from spam bots. [more inside]