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.
21 Minutes to Develop a Todo List iOS App with RubyMotion & RedPotion
If you’ve thought about jumping into iOS development with RubyMotion, here’s a video I put together that may help get you started. :) [more inside]
Drifting Ruby Episode 24 - Fragment Caching
Check out a new episode on Drifting Ruby covering performance via Fragment Caching. Make your application faster by leveraging memory and caching fragments of your view.
Ancient City Snake Case
I had the pleasure of attending the Ancient City Ruby Conference last week. The organizers issued the Snake Case Ruby Challenge: to use ruby to count the number of possible paths to walk between opposite corners of a city grid. Though I didn’t win the raffle, I wrote about a few ways to solve this problem and benchmarked the results. https://rossta.net/blog/ancient-city-snake-case.html
How to Compress Responses Using Rack::Deflater On Rails
This articles describes a super simple way to get compressed responses on Rails or any Rack app. http://solidfoundationwebdev.com/blog/posts/compress-responses-using-rack-deflater-on-rails
Chat App Implementation without Rails 5 and ActionCable
A lot of people migrated to Rails 5 and its awesome features, but what if you can’t? What if you need to stay on the Rails 4 versions, but still want to build real-time applications. Check out my new blog post :) [more inside]
Dropping elements left and right: fun with ruby arrays
Exploring ways of dropping elements from arrays: a look at Array#drop_while, implementing and benchmarking a counterpart Array#drop_while_right. More of an experiment and an excuse to play with refinements and benchmark-ips then something that would be used in production code :) [more inside]
Unicode Micro Libraries
Unicode X is a set of libraries providing specific Unicode-related functionality, like finding out the script a character belongs to or retrieving the name of a character.
Refactor away duplication in your RSpec tests using the Parameterized Test Method
What do you do when you need to run the same test multiple times, but with different parameters? If you copy and paste the test, you end up with a hard-to-read test file. You can’t easily tell how the tests differ from one another. Parameterized test method to the rescue!
The Optimist’s Guide to Pessimistic Library Versioning
Richard Schneeman looks at different strategies for declaring dependencies in libraries and how we might be able to make major version bumps easier into the future. Article here.
Don't tie jQuery to the Rails
It’s time for jQuery to go. It’s a great library but it’s not a part of Rails. I was recently auditing a site for dependencies. Skimming the list of JavaScript libraries I blew right by jQuery. Then a thought popped into my head. The bits of dynamic front-end were built using React. Where was jQuery being used? [more inside]
How to turn your service into a Heroku add-on
Butter CMS takes us through exactly how to build a Heroku add-on and shares their experience with the entire process.
RubyFlow Turns 8 Years Old
I just noticed that RubyFlow’s first post was 8 years and a few days ago. Thanks for all of your support and (14675!) posts over the years :-)
Playing With Google Vision API: Ruby Slack Bot Tutorial
Hey folks, I wanted to present a simple bot using Google Vision API in Ruby, created by my colleague Szymon. This tutorial will help you when building apps that require visual content identification. It’s open source, so feel free to use the code, contribute and improve where you find necessary. Your feedback is very welcome! Ruby Slack Bot: Using Google Vision API Tutorial
Rails 5 adds warning when fetching big result set with Active Record
Running into memory issue by accidentally loading large number of records in Rails ? Rails 5 has a solution. [more inside]
Testing PDF generation with Ruby
If you are generating PDFs in your apps, you should also test them. Here are my thoughts on how to test PDF generation in Ruby. I would welcome other tips/approches you do.
Background jobs in Ruby
Queue management systems are used to process background jobs, so these jobs don’t interfere with the user experience. There are systems that use a database, and others that use Redis instead. Even Ruby on Rails has standardized it with ActiveJob so the application uses the same syntax for any system. http://davidmles.com/blog/background-jobs-ruby/
Global Hotkeys Management for toggling windows in Linux/X11
I’ve just released global_hotkeys_manager a new gem that integrates some command line tools like xbindkeys and xdotool to enable you to assign global hotkeys (shortcuts) to existing windows that will toggle their visibility for quick access. It supports Linux/X11. [more inside]
Don't you Struct.new(...).new(...)
Have you ever seen Struct.new(...).new(...) in code or have you written it yourself? Have a look at this post ideas for reasons why not to do it, such as the immense performance hit.
From Rails to Node.js – Initial Observations
My initial observations coming to node.js from a rails background. [more inside]
Notifyor now with Linux support
Link: https://github.com/ndea/notifyor The new version of notifyor now supports growl messages on linux. Notifyor is a gem which generates growl messages on your desktop when something happens in your rails app.
Things to Consider when Metaprogramming in Ruby
Metaprogramming in Ruby is a polarizing topic. The most common purpose of Ruby metaprogramming is for code to alter itself at runtime. Metaprogramming can be used to achieve terse and more flexible code. However, it is not without its cost. As with most things, nothing of value is free, even metaprogramming.
Slide Show Quick Starter Kit - Write Your Talks in Text w/ Markdown (n Ruby Helpers)
Hello, I’ve put together a quick starter kit for writing your talks in plain text with markdown formatting conventions. What’s included? 1) A first sample talk (see sample1.text) 2) A second sample talk (see sample2.text) incl. some (ruby) macros/helpers e.g. left, right, step, etc. ++ Use a (static) slide show builder / generator to build a web page that is an all-in-one-page handout and a live slide show all at once e.g. $ slideshow build sample1.text and than open sample1.html in your browser of choice. Cheers.
From Rails to Hanami Part 2: Sequel Migrations, Model Validations, Specs and Fixtures
The ‘real world problems’ driven guide to use Hanami on production: http://rpanachi.com/2016/04/11/from-rails-to-hanami-part2-sequel-migrations-model-validations-specs-fixtures