January 5, 2013

Using will_paginate with Arrays

I really like [will_paginate][1] for Ruby on Rails because it’s easy to setup and the intent of pagination is communicated well. The only thing that bothers me is that it can be used with ActiveRecord only. My blog runs on Rails without ActiveRecord and all posts are kept in a git repository as simple markdown files. So I needed to write a wrapper that returns a WillPaginate::Collection and works on Arrays. Read more

December 14, 2012

bash based time tracking

Time tracking has been a recurring theme in my career as software developer. I’ve previously developed multiple solutions to do this myself, but this is the one that I like the most - and since I’ve been using it for about half a year now it’s time to publish it: say hello to traq - bash based time tracking which works on Linux and OS X I like to be in control of my own data. Read more

December 8, 2012

authenticate sudo using Yubikey

I’m a huge fan of security by “Something You Have” in combination with “Something You Know”. A good example for web developers probably is their public/ private key pair they use to authenticate access via ssh to their web servers. When I read about the Yubikey I immediatly wanted to use it to authenticate sudo access on my web server. I’ve been using my ssh agent to do that via pam-ssh-auth, but I can add a physical component to my authentication setup with a yubikey. Read more

December 1, 2012

Check for Unit-Tests in Objective-C

I’ve been adding some Unit Tests to an iOS App lately, which had both Test Host and Bundle Loader set for the Unit-Testing target. Now executing the unit tests caused the iOS App to launch, and the launch itself interfered with my unit-tests (e.g. real network calls which interfere with your mocked network calls). I needed a way to stop the launch if we are running in a unit testing scenario. Read more

November 28, 2012

zero-downtime deployments with unicorn and supervisord

In this post I’ll discuss zero-downtime deployments using unicorn and supervisord. There’s a lot more to zero-downtime deployments then just keeping your website available. Listen to Ruby Rogues Ep. 71 or search google for a broader discussion of the problems involved. When running a web application in production you should strive for 100% reachability. Down-times are normally perceived as errors in your application; and rightfully so. If you deploy often your users might stop using your app because of 502er they encounter. Read more

November 23, 2012

Setup HAProxy with Nginx on OS X

This is a follow up for one of my earlier post about Replacing Pow. I’ve been working a lot with Faye and PrivatePub lately, which cause me to stumble across some problems with the setup of mine. Primarily, moving from development to production environment. The main problem is that WebSocket support will come to Nginx as of 1.3.x. - which is many months away. A common solution is to use HAProxy in front of Nginx. Read more

July 28, 2012

Don't write your own ORM-abstraction - Flexirails revised

Three years ago I started writing a Rails plugin that could create customizable table views which reload via Ajax. The plugin was eventually used for the ICS Festivalmanager which is used to help organize the Wacken Open Air Festival since 2010. Having re-written the plugin from ground up I want to share some bad design decisions I made while writing the first version of Flexirails. 1. Don’t couple your plugin to a persistence layer Flexirails was supposed to represent parts of our domain objects, in a customizable way. Read more

July 14, 2012

Capistrano is dead - use Mina

Up until lately I was happy using Capistrano for my deployments. But then I noticed the following: Capistrano was utilizing 70 % of a physical CPU core when deploying on the go. I’m on a dual core system so this impacts my Mac Book Pros overall performance, battery life and it kept me waiting for a long long time. My iPhone was at edge speed so I figured Capistrano spent most of the time waiting for network I\O - busy waiting that is. Read more

July 7, 2012

Do it yourself calendar helper for Ruby

I needed the possibility to display any given month of a year, along with some additional informations in Rails. I wanted to place the additional informations within the calendar in a way that no available plugin allowed me to, so I rolled my own. In this blog post I want to share my approach to build a simple calendar helper for Ruby. The following code does not use any functionality provided by Rails, so you can use it anywhere you want. Read more

June 20, 2012

A usecase for git commit hooks

I’ve been working a lot with XCode lately, developing an iPad app for a customer at weluse. Sometimes I just dropped assets from my dropbox into XCode, which lead to XCode adding the files using my absolute file directory path, rather than the path relative to the project. Now this wasn’t a problem until our customer started building the project which obviously failed. The solution which worked great for me was a git pre-commit hook to ensure that no files have been checked in containing absolute paths, in this case: any file which path starts with $HOME. Read more

© Raphael Randschau 2010 - 2022 | Impressum