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.
There Is No Magic in Ruby
Magic code? I don’t think so! Today you will learn why there is no magic in Ruby :) http://www.blackbytes.info/2017/06/there-is-no-magic-in-ruby/
5 hard-earned lessons from a decade of Rails performance work
The last 3,650 days of my professional life have been focused on making Rails apps faster. Five lessons I’ve learned the hard way.
Rails Helper Testing Made Simple
View helpers are often a focal point for all the chaos and miscellaneous code in Rails applications, but that shouldn’t scare you away from testing them. This post provides a basic guide to testing the various sorts of helper methods.
Speed up bundle install with this one trick
Did you know bundler can download and install gems in parallel? Find out how to take advantage of this bundler option and speed up your gem installations forever.
Implementing Linear Regression using Ruby
A quick guide that shows how to use linear regression machine learning algorithms in Ruby. Using existing Ruby gems we will setup a linear regression model, train the algorithm and make predictions in minutes. For this example we will use historic house prices in Staten Island to predict the values of houses. [more inside]
Helpful Resources for Your Rails App Upgrade
Need to update your Rails app version? These resources will help the process go smoothly. [more inside]
Reading Ruby Code: ROM - Domain Specific Languages
Reading Ruby Code is an on going series on code reading that explores the ROM library. In this post we explore domain-specific language (DSLs). There is a focus on how this influences code reading and how DSLs are implemented in ROM.
Design Patterns & Ruby - The Template Method
An introduction to the concept of design patterns in ruby world, with an overview of one of the most commonly used ones: the Template Method pattern. [more inside]
Deploy Rails App with Puma and Nginx on EC2 Ubuntu 14.04 LTS instance
Did you forget important step while deploying your app to AWS EC2 server? Here is the checklist for the deploying rails app to EC2 server: http://mayurkumar.info/blog/deploy-rails-app-with-puma-and-nginx-on-ec2/
Yet another guide to permission management using Pundit
Security is an important aspect of application development. Two main components of security are Authentication (Who are you?) and Authorization (are you supposed to be here?). Authentication verifies the user’s identity while authorization verifies whether that user has access rights on certain resources to perform actions on them. http://blog.redpanthers.co/authorization-with-pundit-gem/
[Screencast] Geocoding, Places and Maps
Using the Geocoder gem and Google APIs, learn how to add some geolocation functionality to your application. https://www.driftingruby.com/episodes/geocoding-places-and-maps
feedtxt gem - reads Feed.TXT - feeds in text w/ metadata (YAML) n content in markdown
Hello, as an alternative to JSON Feed I’ve put together Feed.TXT - a new feed format in plain text with structured metadata in YAML and content in HTML or Markdown. Use the new feedtxt gem / library to read / parse the new feed format for publishing & sharing posts, articles, podcasts & more. Try Feedtxt.parse() returning an array with a metadata hash and items (w/ metadata hash and content). Cheers. PS: Feed.TXT is also knowns as RSS (Really Simple Sharing) 5.0 ;-)
How to Build a Simple, Lightweight APM Service from Scratch
In this article, Tyler talks through the process that he went through to build Tracebin, an open source “bin” style APM service. He worked through the challenges of hooking into framework’s instrumentation services, patching database libraries, keeping a small memory footprint, handling concurrency, reducing computational overhead, asynchronous data transmission and performance considerations on the server side.
Debugging Rails views in production
Quick tip for debugging what’s getting slow in the views in production.
The Future of News (Facebook & Co) w/ Web Feeds & feedparser gem ;-)
Hello, the notes from last night’s Vienna.rb talk titled “Meet Jason Feed - The Future of News & Syndication (Facebook & Co) w/ Web Feeds (Ruby Edition)”. All about Web Feed Formats in XML (Atom, RSS), JSON (JSON Feed), HTML (Microformats w/ h-entry/h-feed), TXT (Feed.TXT w/ YAML & Markdown) and more. The message & conclusion: Live and let live! The more formats the better! Let the computer (e.g. feedparser gem) handle the reading of feeds. One gem to rule them all! All your base are belong to feedparser ;-). Cheers.
Why you should probably avoid mixins
Mixins are another syntax for inheritance and inheritance is bad when used for code sharing http://undefined-reference.org/2017/06/10/why-you-should-probably-avoid-mixins.html
Using Rails with webpack generated assets
We wanted to use existing Rails workflow to upload the assets generated from webpack. Was able to achieve that with existing gems like asset_sync and sprockets gems and little rake task. [more inside]
Taking advantage of Mailchimp web hooks
An article on how we can take the advantage of the Mailchimp web hooks in order to keep our database synchronized with MailChimp data. [more inside]
Unit testing ActionCable channels with RSpec
Rails 5.1 doesn’t have official support for testing ActionCable channels yet. Here is the minimal example how to unit test a single channel action.
Acceptance testing using actors/personas
A lot of examples on how to structure your tests using classes and abstraction for better readability. [more inside]
Organize Your CSS with BEM
Learn how to organize your CSS with BEM. It’s great when your project starts to scale