wojsznis.eu

Batch ERB to HAML conversion

Quick and useful code snippet that you may want to use eg. while upgrading some old Rails projects. That HAML awesomeness you should use, Luke!

Batch ERB to HAML conversion

Setting up Ubuntu 12.04 Web Server

Last week I’ve got a brand new server to play with ;). The mission was clear (I’m going over there, I’m going to do the mission…) - upgrade, install all essential stuff, prepare and migrate the data from the old machine. So here’s what I’ve done so far (except setting up system accounts, ssh access and all that basic stuff).

Setting up Ubuntu 12.04 Web Server

Stubbing paperclip file upload with rspec

Here’s small chunk of code that will help you out with testing paperclip. Basically it will stub any fie upload of any instance for given model. So now you won’t be left with ridiculous amount of files created after each test run. Yay!

Stubbing paperclip file upload with rspec

PHP Code Quality / refactoring messy code tips

Lately I have been adding new and new features to existing application and now came time when I have to play with some seriously old code. I mean - really old, forgotten and never refactored code. It’s just there, it’s working and nobody dares touching it. So before I started I need to prepare myself for the battle.

PHP Code Quality / refactoring messy code tips

Rails legacy database migration, Part 2

(Link to Part 1) Now let’s look at some tools that can help you migrating messy html into some more easy to maintain format. Obvious choice for many would be markdown, but as markdown is quite geeky I decided to go with well known by average user - and hated by many programmers - BBCode. BBCode would also allow me to implement some custom tags that I needed anyway - so from now we will stick with it.

Rails legacy database migration, Part 2

Exporting SMS messages and contacts into Android phone

Whoa, that was a busy week, anyhow, here’s a quick reference for all new android phone users. If you own an old WindowsMobile 5/6 phone and you want to import your contacts and text messages here is a quick receipt (sources: 1, 2). Tools you will need:

For your windows phone:

For your android phone:

Exporting SMS messages and contacts into Android phone

Rails legacy database migration

I will give you some of my thoughts about migrating legacy database to Ruby On Rails framework. Welcome to part one.

Rails legacy database migration

Working with Typo3

At my current job I have to devote a lot of time to deal with enterprise Open Source CMS called Typo3. If you didn’t worked with it before it may seems like it’s just another CMS of choice, but let me warn you - if you still considering platform for you site or whatever I strongly recommend checking it out first very carefully, you have to see for yourself how it’s flexibility works for you.
Working with Typo3

Installing Debian Squeeze on Buffalo Linkstation Mini (LS-WSXL)

I own a little pretty Buffalo Linkstation Mini that - I bought it over a year ago and I decided it’s about time to get this puppy for a spin, so to say. Tempted with idea of installing Debian on it I armed myself with a bunch of tutorials and just went for it.

Installing Debian Squeeze on Buffalo Linkstation Mini (LS-WSXL)

Git deployment using post-receive hook

Let’s assume you have configured your brand new git repository on a brand new server and now you want to setup it in a way that every push done on a master branch update your production directory. How can you achieve that? You can use git hooks feature. In hooks/ directory in your git repo you can find a file called post-receive, take a look at quick example below: {% codeblock lang:bash %} #!
Git deployment using post-receive hook