2012-07-24

iOS app and good book

I wanted to blog about good book I found on twitter. While I'm on the road I decided to give a try to an official blogger iOS app and so far this is good enough for my usage.

The book is Getting Real http://gettingreal.37signals.com/

It has lots of good ideas, which I have faced while a developer in Enemy. The book is definitely worth of reading.

2012-06-20

PHP gallery Ruby port part 1

Yesterday I told about rack-legacy. I started new project https://github.com/samitheberber/galleria and will write the progress in here.

I had old PHP application with my own "framework". My route dispatching wasn't bullet proof, so I needed to patch it a little. Patching was few oneliners in few places to get all edge cases to work. At first I used rack-rewrite to direct all requests to PHP. Initial step is completed.

Next I created public directory and moved assets there. Then I rewrote assets rewrite rule and application was back in action. It was time to get sinatra in use. To do so I had to change my generic rewrite rule to specify each route I had in use. If rewrite rule matches, PHP will handle it and if not, sinatra will do the rest. After that is was possible to remove public rewrite rule and let sinatra provide public directory functionality.

Next I need to replace rewrite routes one by one with sinatra routes. At first I replace my json "API", because it doesn't need any UI writing and I can create application core parts, like models. The progress will be visible in GitHub and I will provide url for the result when I get it deploy ready :)

2012-06-18

Ruby and legacy applications

This post isn't about JRuby + Rails + Spring (or other Java web frameworks) like my first intuition would tell to me.

I'm currently helping my friend to renew her website and I was looking looking for pow-like application for PHP, because didn't want full apache on my laptop. I googled and found way to run PHP website in pow. This operation is possible with rack-legacy gem.

rack-legacy provides middleware where you can run legacy php and cgi in rack stack. gem is in alpha state and in production you should use apache or some other server software for performance. For my local development environment this suited perfectly.

What did I want to do then. Well I wanted to have PHP powered website running on my local environment without too much configuration. I also wanted quick way to show currently working site to my friend and she isn't a technical person so git cloning wasn't the answer. So I wrote this config.ru-file, which runs index.php with correct parameters in every request. Symbol link under the .pow dir and I got undulaatit.dev site visible on my laptop. I have used localtunnel before so it was first choice this time too. rackup and localtunnel 9292 ftw. I pasted localtunnel url to my friend and she could see my changes in real time.

I think I find this approach useful in future too. I have done lots of stuff in PHP before moved to Ruby and some of the stuff I have planned to port in Ruby as well. Now I can do the migrations in little parts. At first using rack-rewrite to direct all request to PHP. Then I take one page, write it in Ruby and don't redirect it to PHP. Now the functionality stays same all the time, but the implementation changes under the hood.

Feel free to leave a comment about this kind of approach to rewrite legacy applications in Ruby.

PS. rack-rewrite is heroku friendly http://icelab.com.au/articles/useful-heroku-friendly-rewrites-with-rack-rewrite/

Long silence ends

Hi, I'm going to write now own more often. The subjects are going to be from things I face on developing by working or in free time.

This blog also has new address http://blog.samisaada.com Setting dns-records is one of the new things I have learned in one and half years.

My blog will mainly keep on geeky stuff, but maybe I will write about not so geeky stuff too :) I'm not good writer so I have prefered micro-blogging lately with twitter and it wont go anywhere. I hope this writing will help me to express myself more clearly, also in verbal way.

2010-05-13

Spotify problems solved

I got link from friend through IRC, how to set new Spotify for Ubuntu (http://www.webupd8.org/2010/05/get-new-spotify-043-to-work-with-ubuntu.html). With help of that link I managed to get my facebook connection to work. That link also had answer link for my second Spotify problem, openning the urls (http://www.webupd8.org/2010/03/how-to-make-wine-open-links-in-your.html).

Now you can see my favourite music by Facebook account ;)

2010-02-27

SpanDog - the dog robot

I will introduce you to the SpanDog, it is my dog robot. Now I only have built it and programmed some models. The main functionality isn't yet ready and I can't test it yet on my robot, because of connection problems. I will put some pictures, when I have some.

2010-01-22

Interesting stuffs coming

I have taken part of robot programming workshop course and linux administration courses. I will be reporting my experience with post and pictures :)

I have been hurry with working and with the beginning of studies.