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.
Does Rails everything for us?
The latest Rails security fixes were another reminder that we shouldn’t rely too much on a framework to solve everything security for us. Let’s take a moment every time we use user input directly (like in render params[:id]) and think about what class it could potentially be: Fixnum, String, Array, Hash, nil, a blank string. This and other news in the Rails and web app security reading list.
Stronger Parameters Gem
Discovered this today - a gem to help with type-checking submitted Rails params: https://developer.zendesk.com/blog/introducing-stronger-parameters
Rails 5 adds http_cache_forever to allow caching of response forever
Rails 5 allows to cache HTTP responses forever by introducting http_cache_forever method. [more inside]
ActiveRecord is reinventing Sequel
I’ve been happily using Sequel for over a year now, and was finding it to be consistently better than ActiveRecord. Moreover, I found out that most of new ActiveRecord’s features were already part of Sequel for quite some time. I think that’s a big and controversial discovery, so I decided to write a post where I attempt to prove my claims.
Avoid race conditions with record locking
Especially useful with high volume applications, record locking helps to maintain data integrity and avoid race conditions. [MORE INSIDE]
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.