Mr. Dias

Software Development Thoughts

  • 10 Sep 2012

    Closed doors open source

    During my time working at XING I believe my single biggest contribution for the company is a side project I’ve developed called Xing scripts. This project started with a personal need for working with our development environment in a more automated way. I’m a big proponent of automating everything you can and so when I started working I realized that there were these tasks that I would do over and over again. Since I couldn’t bare doing all this manual work I started writing my own scripts. [...] read more

    Comments

  • 11 Jul 2012

    Git rebasing without conflicts

    Yesterday I was at work with a colleague and we wanted to merge a long-running branch we had. This branch was full of useless commits so we wanted to clean it up. We tried an interactive rebase but we got a lot of conflicts since git doesn’t know how to resolve merge conflicts that we had previously fixed. As you probably know this is no fun, so we did what any sane person would do and found a nice solution for this called git-rerere. [...] read more

    Comments

  • 11 May 2012

    Using chef to setup your OSX environment

    Recently I had to reinstall my computer at work since I had to update to Lion and I could only do a fresh install, so I decided to try to automate the installation process since some of my colleagues are going through the same and it seems like every time we have to waste many hours or days to solve the same issues over and over. [...] read more

    Comments

  • 29 Feb 2012

    Slow down, you are programming too fast

    As a programmer, the impetus to go as fast as you can is to be taken with caution as it helps you move forward but it can also hold you back. [...] read more

    Comments

  • 21 Dec 2011

    Being pragmatic

    It is perhaps my experience but I’ve hardly had the opportunity to work on green field projects, but rather worked on legacy ones where most of the original developers were no longer part of the team or even none of them. Projects with little to no documentation and in some cases no tests at all. You probable know this feeling, it sucks, you want to do things but everything you touch breaks something else, where you obviously see that there was lack of care. [...] read more

    Comments

  • 29 Aug 2011

    Back from the trenches

    It’s been some agitated months lately for me, I quitted working at JustLanded after almost two years there and then went working for some consulting, the experience was not so great, actually it was really bad, the kind of experience that has made me learn to choose very carefully my future career moves and never again believe in marketing people. Fortunately I got an offer to work at XING offices in Barcelona, so I packed my stuff and moved there. Now this is a really good place to work, everything was as we talked, they’ve been very helpful with my relocation and the environment is great, lots of smart people that want to do a good job, so nowadays I’m very happy and enjoying my new city. [...] read more

    Comments

  • 13 Jan 2011

    Avoid Empty Deploys with Capistrano

    If you’ve ever forgotten to push your changes to the remote repository before trying to make a deploy, you will know that it can be really frustrating to think that everything has gone live when actually it has not. This little script will help you avoid this situations. [...] read more

    Comments

  • 17 Nov 2010

    Passenger, RVM gemsets and Bundler

    When using passenger with rvm I’ve had some issues with project specific gemsets, where bundler was unable to find the gems. After searching a lot I found out about using the “config/setup_load_paths.rb” file to tell passenger where to locate your gems, but then I had a new issue with rvm trying to use the system ruby instead of the ruby version of my .rvmrc file.

    After going to the irc channel, I got some help that help me fixed my problem. The culprit was my rvmrc file. [...] read more

    Comments

  • 04 Nov 2010

    Conferencia Rails Workshop

    As promised here are the slides for the “Conferencia Rails” workshop on process automation. Thanks to all the people that were there. I’m also releasing the redmine CLI I’ve created along with the CLI twitter client.

    The presentation was created using the slideshow gem which generates an html document for you.

    Slides To start the presentation just hit the “LEFT” arrow key. You can also find a pdf version here.

    Redmine CLI

    Ruby CLI Tweet

    Hope you enjoy it.

    [...] read more

    Comments

  • 25 May 2010

    Ruby Enterprise, Passenger and Encoding hell

    Today I spent several hours with my friend Gleb trying to find a weird bug we we’re having importing some rss feeds.

    We have a rake task that will grab an xml feed and import it to our system. When we call this rake task from the command line it would run fine, but if we run it from inside our application, we would get some wrong characters (you know, the usual ???) in the imported items. [...] read more

    Comments

  • 11 Apr 2010

    Emacs support for Jekyll

    If you’re using emacs to write your jekyll blog posts, there is a mode to help you with some common tasks. It is originally from metajack. Recently I thought it could be a nice addition to have syntax highlight support for jekyll posts, so I got my hands dirty and after some hours of lisp hacking (this was my first attempt at lisp programming) it was a reallity. It is based on nxhtml so you need it to work. [...] read more

    Comments

  • 09 Mar 2010

    Setting environment to run migrations with capistrano ext

    If you’re using capistrano-ext to deploy to a different server, using a custom environment, you’ve probably noticed that it always tries to run the migrations for the production environment, like this:

    cd path_to_app/deploy/releases/20100309152738; rake RAILS_ENV=production  db:migrate
    

    Digging through capistrano’s source I found the solution is really simple, just set the rails_env variable to the environment you want, in this example staging. So inside config/deploy/staging.rb

    set :rails_env, "staging"
    

    Then when migrations get executed they’ll have RAILS_ENV=staging.

    [...] read more

    Comments

  • 08 Mar 2010

    Monthly archives for Jekyll

    Recently I moved my blog to Jekyll, while being able to write stuff directly in my favorite editor EMACS, there was some functionality that I was missing from my previous custom blog engine, such as archives. Looking at how I could achieve this, I found Raoul Felix approach to the problem. Instead of patching jekyll, he wrote a small library that wraps around it, called jekyll_ext. Using it was really easy, and based on some of the extensions he created, I was able to provide this functionality in my site.

    Although I had archives generated for me, I was still missing a way to display this information on my site, so I decided to create my own extension. [...] read more

    Comments

  • 02 Mar 2010

    View your emails with cucumber

    I’ve been developing some new mailers at work, and I’ve found it really helpful to be able to view the emails as they are sent to the users. So I’ve implemented a cucumber step to help me achieve that, inspired on a similar webrat step for web pages. [...] read more

    Comments

  • 23 Feb 2010

    ActiveRecord migrations from the console

    If you ever run into the situation where one migration doesn’t complete sucessfully, and you’re stuck with a column in a table or a new table, so you can’t drop the migration or execute the migration again, you can always call the migration methods from the console like this: [...] read more

    Comments

  • 12 Aug 2009

    IE issues with new Element and class with Prototype

    The problem we have is that this code

    new Element('div', {'class':'klassName'})
    

    will work in firefox but in IE (tested on version 8) the className is never set, which was causing some problems with the elements styles. [...] read more

    Comments

  • 12 Feb 2009

    Git Goodies

    A couple days ago I had to gather some information from a git repository, so I’m sharing this small scripts with you. [...] read more

    Comments

  • 16 Dec 2008

    Will Paginate And Ajax

    I recently had to implement some ajax pagination for a site. After googling for a while I found a solution, but I couldn’t customize the pagination url’s or I had to specify the paginator to use (will paginate’s default or mine for ajax), so I came up with this solution which fulfils all my needs. [...] read more

    Comments

  • 09 Dec 2008

    Will Paginate And Merb

    I read something about how to do it in this post by The merbist, albeit the information was not complete.
    So here are my instructions: [...] read more

    Comments

Tags

  • activerecord
  • ajax
  • archives
  • automation
  • awareness
  • capistrano
  • chef
  • conferencia_rails
  • cucumber
  • development
  • emacs
  • emails
  • encodings
  • git
  • IE
  • javascript
  • jekyll
  • life
  • merb
  • migrations
  • open_source
  • osx
  • passenger
  • prototype
  • rails
  • refactoring
  • reflections
  • ruby
  • rvm
  • shell
  • thor
  • will_paginate

Friend's Links

  • Least Significant Bit
  • Jorge Calas

Subscribe

  • RSS

Monthly Archives

  • September 2012 (1 posts)
  • July 2012 (1 posts)
  • May 2012 (1 posts)
  • February 2012 (1 posts)
  • December 2011 (1 posts)
  • August 2011 (1 posts)
  • January 2011 (1 posts)
  • November 2010 (2 posts)
  • May 2010 (1 posts)
  • April 2010 (1 posts)
  • March 2010 (3 posts)
  • February 2010 (1 posts)
  • August 2009 (1 posts)
  • February 2009 (1 posts)
  • December 2008 (2 posts)
© 2012 Jorge Dias