wojsznis.eu

How to migrate from Mina to Capistrano

It’s been a while since I last posted here. I’ve been pretty busy with work, I’ve also moved to Cracov in the meantime - so yeah, I can’t really complaint about boredom ;).

Anyhow, some time ago I posted about Mina - neat little gem that allows super fast deployments. Unfortunately when your project grows you start adding additional bash scripts, you add more and more commands to your deploy script and it grows into something not-so-neat anymore.

That’s why tempted with Capistrano’s ready-to-use recipes I decided it’s time to say hello to Capistrano. I’ll provide here step-by-step migration process from Mina. I will be using here delayed_job, unicorn (with capistrano-unicorn gem) and thinking-sphinx.

How to migrate from Mina to Capistrano

Bootstrap 2.3.0 and lightbox/fancybox crash issue

After upgrading bootstrap to version 2.3.0 I spent an evening trying to figure out what’s causing too much recursion error that was in the end crashing my entire browser when using lightbox or fancybox. Then I said - frak it, it’s time to get some rest and in the morning I decided to visit github issues section first - and let me say I should start there, because there it was - waiting for me - exactly the same problem with possible solution :P.
Bootstrap 2.3.0 and lightbox/fancybox crash issue

PayPal IPN madness with Ruby on Rails

Lately I’ve been implementing Instant Payment Notification - great feature provided by PayPal. To be honest it cost me quite some time and a little bit of my dignity. I mean you can read the official guide and play with Instant Payment Notification (IPN) simulator - but in the end it’s back to trials and errors.

So here we go, here are some tips for you, I hope you will find them useful and it will save you some time.

PayPal IPN madness with Ruby on Rails

Morris.js display:none workaround

Morris.js is great, simple and lightweight charts library powered by jQuery and Raphael. Unfortunately you may encounter an issue when you will try to plot a chart on element with display:none property - for example when using Twitter’s Bootstrap tabbed component - it just doesn’t render properly. So as a quick workaround you can fire-up after showing that element. Bootstrap provides some neat javascript events that are fired after some specific actions.
Morris.js display:none workaround

How fast your tests are? - Working with rspec outside rails

Rails is a great framework, isn’t it? It’s ships with all those great tools witch are supposed to help you automatically test your application. So you write specs, you practice TDD, BDD or maybe DDD, but over time you may notice something - it’s getting painfully slow. You app grows, your test suite grows and suddenly testing isn’t anymore so much fun as it supposed to be. You feel like it’s slowing you down.

How fast your tests are? - Working with rspec outside rails

Project released!

Finally, after initial commit_ I did almost year ago (30.12.2011) I decided it’s time to release this app I’ve been working on. I spent many, many hours after work and I don’t regret it - I learned A LOT of rails and now I can say I’m pretty confident when it comes working with RoR. Yet I’m aware I kinda rushed it a little bit, but to be honest - year is a long time and I felt, I don’t know, personal pressure - I just had to release it before 2013 :P.
Project released!

Diary of Legacy Application

Some time ago I wrote two short stories (1, 2) about my journey with migrating legacy php application to rails. And yes - that’s topic is till on my plate :P. I didn’t had much time to push it till the finish (not mention posting on my blog), but I’m getting there.

Diary of Legacy Application

Dealing with Omniauth redirect_uri_mismatch (invalid port number gotcha)

Lately I had some problems with invalid callback url I was getting on my production server (shared host). Omniauth in response included port used internally by nginx (eg. this could be the case eg. when you have varnish in front of you web server) - after browsing the source code of omniauth gem I have found out that you can easily fix if without even touching webserver configuration (and I didn’t had access to it anyway :P).
Dealing with Omniauth redirect_uri_mismatch (invalid port number gotcha)

Hook up aspell dictionary into your rails app

How to check spelling in your rails app in three quick steps.

Hook up aspell dictionary into your rails app

Create build system for PHP under Sublime Text 2

Lately I’ve been working quite a lot with unit test using SimpleTest - so I often had to run scripts directly from command line. But wouldn’t it be cool if I just could write a test and run it directly under my code editor without even leaving it? And if you using Sublime Text 2 (and I really recommend checking it out - it’s gorgeous, it’s slim, it’s ultra fast and you can do basically everything with it) - you easily can.

Create build system for PHP under Sublime Text 2