RubyFlow : The Ruby Community Blog

Home   Submit   Sign Up   Log In   leaders   Twitter   RSS Feed  

mencio — 43 posts

I wrote a post about a simple middleware that can help you ensure, that you don't have any nofollow links that you don't want. You can read about it here: Rack/Rails middleware that will add rel="nofollow" to all your links
Handling exceptions is really important. I wrote a short post on how to handle reentrancy and other failures in Sidekiq workers: Adding reentrancy and a on failure fallback for your Sidekiq workers
If you implemented your own authentication engine, you can still move to Devise. Even when you have a custom encryptor that needs to stay. Here's an article on how to do it
One of the most common and most cumbersome errors you can make: using length instead of count. You can repeat this multiple times, but you will always find someone who’ll use it the way it shouldn’t be used. Here as a reminder: ActiveRecord count vs length vs size and what will happen if you use it the way you shouldn’t
If you don’t have multiple cores and/or you have a small VPN, you may end up with a huge slow down of your web app, when rake tasks are executed. This can be a big issue especially when you use something like whenever to perform periodic tasks. Luckily there’s a nice. You can read more about how to use it here: Ruby & Rails: Making sure rake task won’t slow the site down
When you want to write a mobile app, but you don't want to quit Ruby, it's worth looking into Rhodes. Unfortunately it might not be so simple to use it on Ubuntu (or any other Linux). Also it won't work out of the box with anything newer than 1.9.3. I wrote a simple how to bypass all of those issues: Installing Rhodes on Ubuntu and making it run on Ruby 2.1
Theoretically it is not recommended but on the other hand, sometimes you just have to do some things not as they were described in a default tutorial. Here's a description of how to run GitLab 7.1 using Puma instead of a Unicorn.
There is a time, when we need to switch our apps into maintenance mode. Maybe it is because of some data processing stuff, maybe because of backups, deployment or whatever good reason you might have. To be honest it doesn’t matter why. What does matter, is how we should handle working users of our apps. In this article I describe how to setup an automatic maintenance page that will show during each Capistrano deploy. Nginx (and Puma behind) maintenance mode for Rack/Rails applications with Capistrano
ActiveResource can be pretty helpful when you have a RESTful JSON API. Although it has some limitations. One of the most irritating is a lack of nested resources #new scope method. Luckily there's a way to make it work exactly as its ActiveRecord equivalent. For more details, plese refer to this post: ActiveResource relations – a bit of magic to make it look and feel more like ActiveModel relations
A quick hint for all those that think that it comes by default with Errbit/Airbrake. Tracking Sidekiq workers exceptions with Errbit/Airbrake
Blog post about Sidekiq. How to use it with multiple apps on the same server: Multiple Sidekiq processes for multiple Rails/Sinatra applications – namespacing
A small blog post on how to test Sinatra application methods, without having to perform full requests. More isolation easier. Testing Sinatra application methods in isolation with RSpec
Few words about documentation, code quality and costs that you can have, when you don't care about stuff like this. More in my article: Ruby programmers/project managers/CEOs Y U NO enforce code quality?
I just wrote a post about reentrancy for background workers. Want to know, why it's worth having reentrant workers (or what does it mean)? You can check out my blog post: Ruby (Rails, Sinatra) background processing – Reentrancy for your workers is a must be!
I wrote a post on how to upgrade your Ruby on Rails app from Rails 4.0 to Rails 4.1. It's not so hard as I first though it would be: Upgrading to Rails 4.1 from Rails 4.0 – Ruby on Rails.
I wrote a short blog post on how to crash many Rails/Rack based apps. Not a big deal and not a security issue, but still worth patching: Rack: ArgumentError: invalid byte sequence in UTF-8
Sometimes using unwind can be really useful. Here's an example on how to get similar documents, based on number of equal tags that they have: Mongoid and Aggregation Framework: Get similar elements based on tags,
Maybe instead of one database it is worth using one per user? Well in case of MongoDB it seems that it is definitely worth a try. Check out my short blog post about that:
Let's be honest, users don't want to authenticate each time they open an app. Obviously we can't do this for all applications due to security reasons, but there are some, that can benefit from having such feature. Here's a short description on how to obtain it with Devise authenticating engine.
Sometimes it is worth having files/images that were embedded into comments/etc on your own server. Here's an easy way on how to do it.
Sometimes it's hard to figure out simple things. This post is exactly about this: how to mark multiply nested objects for destruction in Rails forms using CoffeeScript and Jquery filter method.
You want to speed up rspec paperclip, but you still need image resolution validations, so Quickerclip is not an option? Take a look here: Paperclip and Rspec: Stubbing Paperclip/ImageMagick to make specs run faster, but with image resolution validation
Did you like the Rails 4.0.0 ActiveRecord#order behaviour? Well it's going to dissapear soon. If you're interested about the reasons and you want to keep it for a bit longer - it's worth looking at my post:
Revert change on ActiveRecord::Relation#order method monkey patch to keep Rails 4.0.0 order behaviou
I just posted a note on how to use Ransack fancy UI helpers along with Mongoid on Rails 4.0. If you're looking for a way to do this, than it might be helpful: How to use Ransack helpers with MongoDB and Mongoid on Rails 4.0.
Having weird errors when trying to to a web-based file update in one of your GitLab repos? You should check this short article on how to fix this.
Second part of my tutorial on how to update from Rails 3.2 to Rails 4.0. You can check it out here: Upgrading to Rails 4.0 from Rails 3.2 – Test case – Part II (assets, models)
I just wrote a first part of a tutorial on how to update you Rails application from Rails 3.2 to Rails 4. You can check it out here: Upgrading to Rails 4.0 from Rails 3.2 – Test case – Part I (preparations, configuration, gems).
If you want to know how to proxy pass Jenkins with Apache and add a SSL to it all, you should read this post.
I just wrote a tutorial on how to create a maintenance page for Passenger hosted Rails application and manage it with Capistrano tasks. You can check it our here: Apache (Passenger) Maintenance mode for Ruby on Rails application with Capistrano
I just wrote a post about integrating Paperclip with Bootstrap and SimpleForm without the need for f.error elements. In my opinion this approach is way more cleaner that the basic one. You can check it out here: Paperclip, Bootstrap and SimpleForm working together on Rails
Do you need to clear Memcached instance without restarting it? If you do - check this post.
A just wrote a post about my attempt to decrease Redis memory consumption by Gzipping the data that I was having there. Wanna see how it ends? Click here: Compressing large data sets in Redis - Ruby test case.
Post about loading dynamic CSV/XML data to MongoDB using Ruby and Mongoid gem. Check it out!.
Sometimes Passenger gets really naughty and grows rapidly, eating all available memory. I just wrote a post on how to protect our apps and servers from such problems. You can check it out in post titled: Simple Ruby(Rails) Passenger memory consumption limit monitoring
I just posted small note on how to fix "unknow command blpop" for Resque, Redis nad Rails. You can check it out here.
I've found a way to make Redis-store work with simple Regexps and also expire caches with wirdcard string (once that hit Redis Keys method). Check this out!
Blog post about fixing the "You need to install ruby-debug to run the server" message when trying to use RVM, Ruby 1.9.3 and Ruby debugger.
I just wrote a small how-to about upgrading to Rails 3.2.0 from Rails 3.1.3. It's not so hard as I thought it'd be and new Rails bring us some cool new features. Enjoy :)
Small tutorial on how to zip/unzip directories and how to access single files stored in those archives without unzipping whole packages. Read more
I just found an easy way to extend and overwrite bb-ruby bbcode gem translations in Ruby on Rails. This allows you to implement your own rules really easily. Check it out!.
I just posted an article about using Redis as a temporary cache for data shared by multiple independent processes.
Handling Rubies and gemsets management easier - second part of my tutorial about building from scratches small integration server for development purpose.
I just started creting own small Ruby integration server software here and I've decided to make tutorial out of it. Check it out.