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.
Experimenting with database indexes - How fast can it get?
In this blog post I’m explaining what database indexes actually are and how much they can improve your query times in a Ruby on Rails application that contains a lot of records. The tests are done on a Postgresql database. [more inside]
Upgrade Legacy Passwords to Use Devise
Sometimes you get an old app that has a garbage password encryption scheme. Find out how to seamlessly update it to secure your app and prevent a security event.
Stay Static - Jekyll vs Middleman - And the Winner is...
Hello, For tonight’s Vienna.rb meetup I’ve put together a talk titled “Stay Static - Jekyll vs Middleman - Build Static (Web) Sites w/ Ruby”. The agenda reads: [more inside]
Three techniques to make your code for readable
Readable code is maintainable code. This article discusses best practices for writing readable code.
Better exception responses in Rails 5 API apps
Rails 5 has introduced better exception response format for API only apps. The post http://blog.bigbinary.com/2016/03/03/better-exception-responses-in-rails-5-api-apps.html discusses new configuration provided in Rails 5.
Code Ruby like you build Lego (refactored)
This illustrates a way to chain functions and service objects in Ruby if ever you miss the | (pipe) operator from unix and/or Elixir. I changed the presentation after the feedback from different talks: http://slides.com/apneadiving/code-ruby-like-you-build-lego [more inside]
Generating Sprite Images using Compass Rails Gem
Learn how to Create Sprite Images using Compass Rails Gem in Rails 4.2.5 to speed up your Rails 4.2.5 Apps.
ThreadPool: a Ruby antihero
Threading gets a bad wrap in Ruby - even still, you may be using thread pools everyday without even knowing it. Many of the most popular ruby gems use the concept of “pooling” to manage expensive resources. In this post, we’ll examine why thread pools are useful and take a test-driven approach to implementing one ourselves. https://rossta.net/blog/a-ruby-antihero-thread-pool.html
Reality: access to real-world entities
New reality gem provides access (through Wikipedia and Wikidata and other services) to real-life data. Its goal is to make entire world computable.
kramdown - markdown converter - update - v1.10 - released (now incl. strikethrough)
Hello, Via Vienna.html great news - kramdown v1.10 is out - thanks to Thomas Leitner - the author (from Vienna, Austria ;-) of the markdown converter in ruby. What’s news? [more inside]
Unicode Character Widths
Q: How do you determine how many terminal columns a string will take? A: It is not possible, because it is not standardized for every character! But you can achieve good results with EastAsianWidth.txt, Unicode’s general categories and other data. [more inside]
HOWTO access Amazon DynamoDB with Ruby
HOWTO access Amazon DynamoDB with Ruby. A guide to accessing the Amazon DynamoDB API with v2 of the official AWS SDK for Ruby. Setting up credentials, creating tables, adding items, fetching items, conditional writes, partial updates, scans, queries, secondary indexes, and running DynamoDB locally.
Spreadsheet Architect Gem Released!
Spreadsheet Architect makes it super easy to turn any ActiveRecord relation or plain ruby object array into a XLSX, ODS, or CSV spreadsheets. Generates columns from model ActiveRecord column_names or from a given array of ruby methods. https://github.com/westonganger/spreadsheet_architect
Removing duplicate builds on Travis CI
We made a simple alternative to travis-dedup when we had difficulty setting it up. This helps you stop duplicate builds from running on travis-ci.com. Its extremely simple to set up (3 steps) and we’ve got one of those nifty Deploy to Heroku buttons as well. [more inside]
A Customized Approach to HTTP Proxy Caching in Ruby
AcornCache is a Ruby HTTP proxy caching library that is lightweight, configurable and can be easily integrated with any Rack-based web application. AcornCache allows you to improve page load times and lighten the load on your server by allowing you to implement an in-memory cache shared by every client requesting a resource on your server. Please visit https://github.com/acorncache/acorn-cache for further information.
Turn on Keepalive to Speed Up Rails 4.2.5 App
Why you need to turn the keepalive on to Speed Up Rails 4.2.5 App
Reencryptor Gem Released
Use this gem to migrate from legacy versions of attr_encrypted to a more secure attr_encrypted method. Initial release; more encryption schemes and flexibility to come. Reencryptor Gem Released
Control Groups (cgroups) for the Web?
The web platform lacks primitives that expose control over how and where CPU, GPU, and network resources are allocated. Do we need cgroups for the web?
Five Practices for Robust Ruby on Rails Applications
I’ve shared five simple practices I follow to make my Rails applications robust. It all comes down to failing early, loudly and often.
Migrations are versioned in Rails 5
Migrations are versioned from Rails 5 onwards. [more inside]
How To Automatically Change Port If Default Is In Use With Guard And Rails
This article describes two simple methods to automatically increment the port number if its in use. http://solidfoundationwebdev.com/blog/posts/how-to-automatically-change-port-if-default-is-in-use-with-guard-and-rails
Hyde Press- New Books -Jekyll Plugin Developer's Guide (Generators, Converters, etc.)
Hello, I’ve added a three new volumes to the Hyde Press Bookshelf: 1) Jekyll Installation Guide 2) Jekyll Deployment & Continuous Integration Guide 3) Jekyll Plugin Developer’s Guide Cheers. PS: What’s Jekyll? It’s a free static (web) site builder / generator in Ruby.
Rails 5 improves redirect_to :back with new redirect_back method
Rails 5 improves redirect_to :back with new redirect_back method [more inside]
Ruby Spaceship => Operator
Adhering to the law of trichotomy, the <=> operator (sometimes called the “Spaceship Operator”) works by comparing two elements and returning a -1, 0, or 1. While the original mathematical criteria applies to only real numbers, many programming languages implement the law of trichotomy as a general comparison between equivalent types. Ruby’s <=> operator can be a bit confusing but when understood, is very powerful.