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.
whatson gem - Use $ beerfest to list upcoming beer festivals on command line
Hello, for fun I’ve added another dataset to the whatson gem that lets you list upcoming beer festivals from around the world. Ever wonder how many days to the next Oktoberfest? Just type in your shell: $ beerfest The command will fetch the beerfest event calendar page (from the intertubes) and print out: in 9d Ottakringer Braukultur Wochen, Thu-Wed Jul/2-Sep/2 (63d) @ 16., Ottakring › Vienna › Austria; in 88d Oktoberfest ("Die Wiesn"), Sat-Sun Sep/19-Oct/4 (16d) @ Munich › Upper Bavaria ... and so on. Cheers. Prost. Kampai.
To Serialize Or Not To Serialize: ActiveModel Serializers
Structuring data can be complicated, and on the web, everything is just a game of passing data back and forth. When it comes to serializing data into a JSON format, there’s one gem that can make your life infinitely easier: active_model_serializers! This blog post highlights when and how to implement a serializer in your Rails app, and how to customize it to fit your needs.
ANN Lotus v0.4.0
Features: additional architecture, database migrations, HTML5 form helpers, CSRF Protection, Force SSL. New Core Team member, Rails Girls Summer of Code and Guides! [more inside]
Shortcuts for navigating nested associations
How do you access non-adjacent models while avoiding N+1 problems? Find out in my latest post - shortcuts for navigating nested associations.
Drat! - Ruby has a double splat
Continuing from the single splat *, we’re looking into the spoils and tricks of ** in your Ruby code. There’s probably stuff you didn’t know here either.
LinkThumbnailer
LinkThumbnailer helps you extract meta informations from a given URL such as title, description, images and much more. It embeds a powerful algorithm to rank and return you the best images and description out of the website. It comes with a great documentation and a live demo.
Static Frontend Apps in Pure Ruby
In episode 5 I explore ways to make static frontend apps in Ruby using Opal and Rake.
Using Sunzi Gem
Sunzi is the easiest server provisioning utility designed for mere mortals. If Chef or Puppet is driving you nuts, try Sunzi! Here is step-by-step instructions on : Provisioning a Server using Sunzi
Bitwise hacks in Ruby
A brief tutorial on twiddling bits in Ruby: http://blog.honeybadger.io/bitwise-hacks-in-ruby
Filterrific: Filter, search, and sort your ActiveRecord lists
Filterrific is a Rails Engine plugin that makes it easy to filter, search, and sort your ActiveRecord lists. It comes with awesome documentation and a live demo.
A gem to sync your CHANGELOG to GitHub’s release notes
I like GitHub’s Releases UI, but keeping it updated in addition to maintaining a CHANGELOG is tedious. So I created a gem called “chandler” to do it automatically. If you maintain a gem, just add chandler to your Rakefile, and rake release will now update GitHub’s release notes in addition to tagging and uploading to rubygems. Chandler also works interactively on the command line. Give it a shot!
Intro to the Docker Stats API with Ruby
The Docker Stats API provides a ton of information about running containers. See how easy it is to tap into key performance info (CPU, Network In, Network Out, etc..) with a couple Ruby scripts. This post walks thru the basics.
Mastering Ruby Regular Expressions
Learn to use regular expressions in Ruby with this tutorial. Many examples are provided. Please share if you find it useful :)
Rails Multi-Database Best Practices Roundup
The goal is simple! To give you the tools you need to keep your Rails application running smoothly when connecting to multiple databases.
The Computer Science Behind Postgres Indexes
Indexes are powerful and important. Pat Shaughnessy shows us how they work and discovers the computer science behind Postgres indexes. [more inside]
whatson gem - Use $ rubyconf to list upcoming Ruby conferences on command line
Hello, I’ve put together a Ruby gem, that is, whatson, that lets you list all upcoming Ruby conferences on the command line. Type in your shell: $ rubyconf
The command will fetch the awesome ruby events page (from the intertubes) and print out:
Jul/1+2 - RubyMotion Conference - #inspect @ Paris, France; Jul/20 - Brighton Ruby Conference @ Brighton, East Sussex, England ... and so on. Cheers.
Using the Rails 5 Attributes API today, in Rails 4.2
Rails 5 is going to have a great new Attributes API, but you can use it already in Rails 4.2. If you’ve ever tried doing something as simple as overriding attribute accessors and found yourself chasing down and plugging endless edge cases, this post is for you.
ROM 0.8.0 Released
You can read the official announcement
Decorators in Ruby
Ruby’s low-overhead metaprogramming facilities make it easy to create elegant APIs with minimal effort. As a testament to its power, I can say with a high degree of confidence that all of your favorite Ruby libraries leverage metaprogramming in one way or another. [more inside]
Pongal Gem Released
Pongal is a valid US state generator that can be used in Geocoding applications. https://rubygems.org/gems/pongal The source code is on Bitbucket https://bitbucket.org/bparanj/pongal
Holycorn: PostgreSQL multi-purpose Ruby data wrapper
I have just released Holycorn. It is a Foreign Data Wrapper for PG that uses Ruby (actually, mruby) as its data provider: write a Ruby script, and select its data transparently from a PG table!
Render Markdown views with Redcarpet and Pygment in Rails
This Lugo Labs Tutor tutorial shows a way how to create a Rails renderer for Markdown so we can use it in views as we do when we write HTML. The view will need to support all Markdown syntax and Pygments, to prettify any code we have in the view. The code should be wrapped within a tag decorated with a class specifying the language in which the code is written, following standard Markdown syntax.
Ruby Productivity Scripts
As developers, we are so busy that we don’t have time to think about the amount of repetitive tasks we do on a daily basis. So, why not automate repetitive tasks and learn Ruby at the same time? Read the first article in this series: Clone a Git Project