Today was another day of the first day of the first release of a new web application. After prototyping the new project for a few days, the time had come that we’d finally show the first part to the rest of the team members and the client. Currently, it’s the least thing I like about releasing new apps: deploying. It always involves setting up the Git repository on Github, adding domain configuration on the web server (or even worse, setting up a load balanced environment), launch ec2 instances and write or configure the (web|cap)istrano scripts. It takes hours and multiple things fail you’ve already done a thousand time on other deployments. Here’s a list of what the most awesome deployment app would have:

  • It should be a web app, hosted, pre-installed, no fuzz, clean-interface, Basecamp-like subscription payed shizzle.
  • It MUST support with deploying from various SCM’s like Git, SVN, Bzr and maybe even still CVS. (Git with submodules, svn with externals, you do the math)
  • It MUST constrain the user to some broadly supported standard deployment strategies. For instance Ruby on Rails applications with Apache/NGINX and Phusion Passenger (aka Mod Rails). The user should not have to worry about the background of the deployment and should not have the power to break stuff.
  • It MUST have a philosophy of projects/applications over servers. Your app runs “in the cloud”. The architecture behind it is secondary. Instead of installing an application clone on a new server and configure the load balancer, you add a server – or better an instance – to your application and the application makes sure the new instance of itself gets picked up.
  • It SHOULD take over all the configuration of the application. From generating passwords to setting up databases and migrations to configuring new servers in a load balancer. The deployment app knows best.
  • The user should only have to add their deployment keys or maybe a local deployment password everything else (like deployment locations and stuff) should be convention over configuration. Everything the user want’s to add should be available through nice gradient-like big buttons with smilies on them and the user MUST be greeted with “Yo, dude”.
  • Everything should be as sexy as your girl or boyfriend.

And no worries guys, we are buiding this right now.

P.S.: If you don’t have a girl or boyfriend, pick your dog or cat. If you don’t have those either. You’re not allowed into the beta.

{ 0 comments }

This is a sneak preview screenshot of Cash Buddy. Cash Buddy is about tracking your personal cashflow. It helps you plan bills and expenses and let’s you keep track of what money is coming in and going out. Just to make you sure you won’t have to worry about your personal finances. What do you think?

Cash Buddy Design

{ 0 comments }

Yacht

Yacht

{ 0 comments }

Android 1.6 Donut released

September 16, 2009 · 0 comments

in Android

Today is a good day for Android developers, and for Android users in the future: The new 1.6 version of the Android operating system is released. See this movie for the changes:

{ 0 comments }

Beanstalkd is a queueing deamon that let’s you queue messages from one client and let them be processed by another client. It has features like burrying messages for later usage if the command at the first time can’t be executed and more stuff like that.

We use it for queuing things in Ruby on Rails applications which are time-intensive. For example, executing an install command on a remote server can take some time and you don’t want your web application to block or queue op other requests in this case.

Beanstalkd has excellent Ruby bindings which you can use in  your Rails app. There’s even a gem for it:

gem install beanstalk-client

Using it is as easy as:

beanstalk = Beanstalk::Pool.new(['10.0.1.5:11300'])
beanstalk.put('hello')

beanstalk = Beanstalk::Pool.new(['10.0.1.5:11300'])
loop do
  job = beanstalk.reserve
  puts job.body # prints "hello"
  job.delete
end

Installing on Mac OS X

Beanstalkd depends on libEvent, so you’ll need to install that first:

wget http://monkey.org/~provos/libevent-1.4.12-stable.tar.gz
tar zxvf libevent-1.4.12-stable.tar.gz
cd libevent-1.4.12-stable
./configure
make
sudo make install

And then you can install Beanstalkd:

wget http://xph.us/dist/beanstalkd/beanstalkd-1.3.tar.gz
tar zxvf beanstalkd-1.3.tar.gz
cd beanstalkd-1.3.tar.gz
./configure
make
sudo make install

{ 0 comments }

I started learning Objective C 2.0 (ObjC) – the primary programming language used to write Apple and iPhone applications – a few days ago after seeing the Stanford iPhone Development Course on iTunes U. I really recommend watching the lectures in this course as a podcast and making the assignments which are publicly available on the course website.

I always thought ObjC was crap and hard to understand but after a few hours of playing with it, it is actually quite easy. Here is a list of code examples for ruby developers.

The most important thing

The most important thing you should know is how to use ObjC as an Object Oriented Programming language. ObjC has everything from classes to instances to super- and subsetting classes, from class methods to instance methods and variables. The only thing you need to know is how to call them.

ObjC uses the following syntax for this:

[object message:first_argument andSecondArgument:second_argument]

Here, “object” is the object on which you want to call the function “message”. After that is a colon (:) and a comma-seperated list of the arguments. In fact the [ ] (square brackets) are the “.” and “::” in Ruby or “->” and “::” in PHP.

Assigning strings

my_string = "Hello, world!"

translates to

NSString *myString = [NSString stringFromString @"Hello, world!"]

or more convenient:

NSString *myString = @"Hello, world!"

Creating objects and calling instance methods

person = Person.new
person.walk(10); # Let's a person walk by 10
                           # metres by calling the "walk"
                           # method on the instance of person

translates to

Person *person = [[Person alloc] init]
[person walk:10] // Given that 10 or the variable in this place
                  // is an integer. In this case it's the integer 10

Arrays and hashes

my_hash = {'key' => 'value', 'key2' => person}

my_array = ['value', person]

translates to

NSDictionary *myDictionary = [NSDictionary
    dictionaryWithObjectsAndKeys:@"value", @"key", person, @"key2", nil]

NSArray *myArray = [NSArray arrayWithObjects:@"value", person, nil]

/* Notice that the "lists" when initializing the dictionary (hash) and the array
   should be terminated with "nil" */

I hope this post helps you getting started with developing applications in Objective C 2.0. If you have any tips or questions, please drop a line in the comments, get to me on Twitter/FriendFeed or send me an e-mail.

{ 1 comment }

Today TPB announced it would sell itself to the Global Gaming Factory X AB. This is great for the future of the open internet and might be a step forwards to open up the conservative big copyright watchers and media companies Here’s why:

  • It shows commercial interest in an “illegal” practice started by a wide community of both regular people and people interested in protecting the openness of the internet.
  • If I believe TPBs blogpost, the company buying the torrent site is not only interested in earning money, but also in keeping the site running in the philosophy as it started, but also find ways to maybe bring commercial methods of downloading the files linked to as torrents.
  • The money will go into a foundation protecting the freedom of speach, freedom of information and openness of the internet.

{ 0 comments }

Here are four gems and Rails plugins I generally like to use to build Rails applications. Use them to support authentication, internationalization, haml/sass and model avatars in your new Rails app.

Blueprint CSS framework, haml and Sass

If you’re still using erb for your standard views you are old school. You should use Compass, the Rails gem that allows you to easily create stylesheets based on the Blueprint framework, using Haml and Sass in your styles and views.

Internationalization on models (I18n)

You can use the excellent Globalize2 by joshmh for making your Rails apps international. This plugins allows you to translate attributes on your models (dynamic translation). You can do this by creating the correct translation migrations and by adding this to your models. Use this plugin in combination with the standard Rails I18n API to fully translate your application labels and models.

class YourModel < ActiveRecord::Base
  translates :title, :text
end

Restful authentication with Authlogic

The authlogic gem by binarylogic allows you to create a flexible authentication system with accounts for your application. It supports a lot of options to configure and you can keep it as basic as possible. For example, you can create parent accounts (example: businesses and users of the application in that business), password reset functionality, OpenID and more. Check it out!

Account avatars and product previews

Want to add user profile pictures or product previews if you're running a web shop or other catalogue application? Use the Thoughtbott Paperclip plugin to generate avatar columns, handle the file uploads and scale to different sizes. If you like Paperclip, be sure to check out other Thoughtbott Rails marbles!

{ 0 comments }

Tonight I was working on an old Rails app which I upgraded to Rails 2.3.2. All code went fine and on my local Mac installation all worked perfect. When I tried to deploy to the live environment I got the following strange error:

undefined method `alias_method_chain’ for I18n::Backend::Simple:Class

At first, I thought this had something to do with new i18n stuff in Rails 2.3.2 and after half an hour of Googling I finally got the answer. ActiveSupport and ActiveRecord in Rails now require ruby-iconv to be installed. This is probably available in most installations – because there where only 2 pages of unhelpfull answers on Google – but it wasn’t on my production environment.

I hope this blogpost will save you some Googling and it will fix the undefined method `alias_method_chain’ for I18n::Backend::Simple:Class error message. Also this error can happen with the following message: undefined method `silence_warnings’ for main:Object.

So the solution is: install ruby-iconv. If you’re running FreeBSD, that’s in /usr/ports/convertors/ruby-iconv (via: http://forums.freebsd.org/archive/index.php/t-763.html)

{ 2 comments }

Here’s a list of practical things I do to keep productive.

  • Reset your mind every evening (especially before a work-day): go read a book an hour before you usually go to bed. Read it in your living room or somewhere where you can’t go to bed and can’t get to a computer. I like to do this at 11pm with a nice cup of tea.
  • Have a healthy eating rhythm. By this I do not explicitly mean eat healthy food! Just have breakfast, lunch and dinner each day. Snacks are fine too, as long as you keep your 3-meals a day rhythm. I force to have breakfast the last few weeks and I’m feeling better already. If you’re like me and you hate having breakfast try something light like some fruit, cornflakes or yesterdays leftovers.
  • Schedule your off-time. Don’t see relaxation as a reward for getting things done. Plan your relaxation so you know you will get things done after relaxing. If you don’t plan time to unstress, you never will. Also, it will make sure you don’t worry about relaxing because you know you can because you scheduled it.
  • Don’t worry about finances. Make sure you have a system for keeping track of your finances so you won’t have to worry about them. This doesn’t stop you worrying from not having money to pay your bills but knowing you can’t pay them and finding out when you can pay them relieves stress about finances.
  • Keep your inbox clean and actions organized. Just like with finances. You can relieve mental stress if you know what to do and when you’ve answered to all your running projects and tasks. It might be possible you can’t do every task you have but it helps knowing having actions you can’t do, rather than not knowing what to do with them. I just Dave Allen’s Getting Things Done system for this. Read his book Getting Things Done: The Art of Stress-Free Productivity about this.

{ 0 comments }