Posts List

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.

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.

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).

Hook up aspell dictionary into your rails app

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

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.

Testing private methods with SimpleTest - example

2017 Update note: before proceeding think if you really want to test underlying implementation of a class in the first place ;-) Here’s quick example how to test private class method with SimpleTest using RelectionClass (while you are reading about reflection class I will also point you directly to reflection method and what it’s all about).

Super fast deployment with mina - capistrano alternative

Mina is an interesting alternative for capistrano. It’s really tiny, easy to configure and fast as hell. Overall usage is very well documented, so to avoid repetition I’ll just describe very specific case of deploying rails apps on a shared server through use of a gateway (or whatever you may call it). So it happens I keep my personal project on ones of those shared servers - it’s just cheaper and I don’t have to bother with upgrades, system security etc. - assuming my provider knows what he’s doing of course ;). I can normally log through ssh on my shell account and then from that machine I can ssh to yet another machine that hosts my sites.

Winter is coming... so protect your eyes with Redshift

As they say - winter is coming - and that’s mean the day is getting shorter and shorter. Nowadays it’s getting dark quite fast out here so maybe it’s time to adjust the color temperature and the brightness of your screen accordingly to the time of the day/night? There are two alternatives that I know of that can help you with that:

Free github alternative with private repos - meet Bitbucket

Everyone knows github, right? The github community - that the main power of that site. The amount of open-source projects, drafts, ideas is just overwhelming and nobody can’t neglect that. But what if you have a small team that need some github-like platform for hosting your new top-secret project in private and right now you just don’t have few bucks to spare? Well, you can take a look at bitbucket that got totally redesigned last few days, you can read all about all cool features and tweaks here.

Breaking Rails, part 2, putting your RoR inside your PHP

Yo dawg, I heard you like… Purely theoretical (obviously) case: you have existing php app and some legacy rails code that you refreshed a little bit and now someone asks you one simple question - why can’t you just put that code into that code and run it as one app? Sometimes you can reason, sometimes not. But let’s do it - I mean seriously - let’s create some kind of hybrid that will work transparently and silently for the user. Unleash your imagination and get ready for breaking every programming paradigm; treat it like a sport and get ready :). Let’s ever get a little bit further, let’s create one rails app that will distribute its content for two different domains. Where do we start?