wojsznis.eu

My Gems of 2013

I noticed that I ‘starred’ over 320 gems on rubygems.org. So I decided to do some cleanups there and while I’m at it - share with you few real gems that I like to use. So here it is - my tiny list that I called “My Gems of 2013”, mainly because it sounds catchy; a little bit of marketing didn’t killed anybody yet, I think.

I tried to avoid some, well, really obvious choices (like rspec, mocha, sidekiq, devise, resque, carrierwave, etc. - you get the idea) so maybe you fill find that one precious, very special thing that you will love ;-). Here we go.

My Gems of 2013

Yet another chruby user

Few days ago I notice that RVM took over 8GB of my disk space for various gemsets/rubies. RVM in general is a beast (20k lines of shell script, you kidding me?!) and I used it since I started my journey with RoR, it was great (hey, you can support rvm 2.0 if you want/can) but I decided it was time to look for an alternative. It was nice meeting you RVM, but it’s time to move on.
Yet another chruby user

REST API Client Server with Rails

Few days ago a new project was thrown in my face ;). And it was interesting I must say - extracting some heavy internals of existing application into internal API + external client (app), that could be developed further with some additional features.

REST API Client Server with Rails

Debricking Buffalo WZR-HP-G300NH (linux)

If you’re reading this you’re that means you don’t need further introduction to the problem, let go straight to solution then ;).

Debricking Buffalo WZR-HP-G300NH (linux)

Migrating from resque to sidekiq

In a company I’m currently working we have been using resque to do some heavy asynchronous work. And well, that’s like obvious choice in Rails world - just go with resque, fork some processes and relax ;). But when you get to a point, when you need few hundred workers and few servers, you start to ask yourself - can’t you do it better?

You probably can. There are some pretty smart folks out there, who were so kindly to share their knowledge. And that’s how you can find sidekiq build on top of celluloid.

Sidekiq uses multi-threading, so you can leverage that even if you use MRI (that have un-famous GIL) - if you have a lot of I/O bound work you can still benefit from this great piece of software (even without need to migrate to JRuby or Rubinius).

Migrating from resque to sidekiq

API-like gem for fetching data from quakelive.com

It has been a busy time for me lately, but I finally managed to release a small gem, that some of you might find useful. You can download it from github or rubygems, I attached readme, that should be sufficient enough to start hacking. As you may already know ID Software unfortunately didn’t provided official API, so if you want to get some data from them, your only option is to crawl their site.
API-like gem for fetching data from quakelive.com

Rails after_commit create mindf*ck

Rails 3 observers can be tricky. You probably already heard a thousand times how to deal with undefined id issue and how transactions are handled, so let’s take a quick example that can be google’d in just a couple of seconds.

Rails after_commit create mindf*ck

Windows-1250 to utf-8 bash one-liner

There was a time when I worked with non utf-8 coded files quite a lot. They were usually saved using Windows-1250 encoding and obviously I wanted them in utf-8. I think I don’t need to tell you that you should probably use iconv for that, but there is also quite interesting tool called sponge that will allow you to pipe output of iconv to the very same file. In ubuntu it comes with packed called moreutils (also check out other apps it provides!
Windows-1250 to utf-8 bash one-liner

Delayed::Job to Resque migration

When it comes to doing some asynchronous work, Ruby on Rails community have some great ready to use solutions to choose from. I think most popular is delayed_job and resque (and probably sidekiq, but a story for another blog post).

Delayed::Job to Resque migration

Fixing Bluetooth audio issue on Ubuntu 13.04 based distors

I’ve noticed that Ubuntu 13.04 (and all distors based on it, eg. Linux Mint 15) have some weird audio issue that basically makes impossible to connect to some audio speakers through audio sink (I had problems with mine Creative T12). After googling around and trying all possible solutions I still couldn’t get it working. Syslog showed various errors, for example: Unable to select SEP or Endpoint replied with an error: org.
Fixing Bluetooth audio issue on Ubuntu 13.04 based distors