Josh on Development

0 notes

Migrating from Github to another Server

After spending what seemed like days trying to figure out how to migrate a git repository from Github including all remote branches. This sounds like an easy task but I couldn’t find a single article which showed how to do it. I did however stumble upon a post by Intelli Grape which shows how incredibly simple it really is!

Here are the steps:

  1. Clone the repository from Github
  2. Create a new bare repository which mirrors the old

    git clone --bare --mirror path_to_repository your_new_repository.git
  3. Cd into your_new_repository.git

    cd your_new_repository.git
  4. Push the changes to your new repository

    git push --mirror your_new_repository.git

Thats all folk!

Thanks again Intelli Graph (

0 notes

Getting started with mongodb - dbpath (/data/db) does not exist

I’m working on a project at the moment which requires mongodb. After installing it with

brew install mongo

I got this strange error

Mon Apr 16 13:18:39 [initandlisten] exception in initAndListen: 10296 dbpath (/data/db) does not exist, terminating Mon Apr 16 13:18:39 dbexit: Mon Apr 16 13:18:39 [initandlisten] shutdown: going to close listening sockets... Mon Apr 16 13:18:39 [initandlisten] shutdown: going to flush diaglog... Mon Apr 16 13:18:39 [initandlisten] shutdown: going to close sockets... Mon Apr 16 13:18:39 [initandlisten] shutdown: waiting for fs preallocator... Mon Apr 16 13:18:39 [initandlisten] shutdown: closing all files... Mon Apr 16 13:18:39 [initandlisten] closeAllFiles() finished

Mon Apr 16 13:18:39 [initandlisten] exception in initAndListen: 10296 dbpath (/data/db) does not exist, terminating

Its an easy fix:

$ sudo mkdir -p /data/db/

$ sudo chown `id -u` /data/db

0 notes

Time Saving commands

Every now and then you learn a command which make you think WHY DIDN’T I KNOW THIS!

cat | ssh "cat >> ~/.ssh/authorized_keys"

Makes managing servers wayyy easier.

0 notes

Order by Last name where name is one field

Just started work on a new project which has a name field opposed to first_name last_name.

If you want to order by the last name you’ll need to do something like this.

@artists.sort! { |a,b| a.title.split(" ")[1].downcase <=> b.title.split(" ")[1].downcase }

Hopefully that’ll work for you. If you have a better way let me know!

0 notes

Project Planning - One Size doesn’t fit all

"Plan and wireframe it up, do some user flows and find out if your idea works?"

I had a discussion on twitter about an idea I have for a project, we had a disagreement on how to manage projects. I probably didn’t get my point across, twitters 140 limit is restricting in some ways.

My thoughts on project planning really does vary depending on the project. For client projects we spend a lot of time in the planning stage. It usually looks like this:

  1. Objective
  2. Research
  3. We draw wireframes
  4. We create sketches
  5. We create working prototypes
  6. We test
  7. We Launch
  8. We analyise

Its a simple process thats tried and tested and has served us well for the past few years.

However its rigid in some respects as its client facing, we can’t show sketches on napkins or prototypes than only work if you know the urls. When I work on personal projects they do follow a very similar process but its a lot more organic, my wireframes are on the back of pieces of paper, the plans are written or spoken about, this is how we work and how we can launch little projects really quickly in an afternoon, or from a hack weekend.

My point is not to say that project plans are bullshit, but that “find out if your idea works?” is bullshit, if you want to put the time in to develop a product over a weekend, then its your choice. The validation is already made as soon as you choose to work on it. Validation only needs to happen if the time has an inherent cost which effects something else.

Side projects are so important in how we work as developers / designers / product makers.

2 notes

Lion, RVM and 1.8.7 - 1.8/timeout.rb:60

I’ve just started a new project.. well an old project that uses ruby 1.8.7 and rails 2.3.5.

If you get this error:

1.8/timeout.rb:60: [BUG] Segmentation fault

Its a problem with lion and ruby. Uninstall any version of 1.8.7 you have with

rvm remove 1.8.7

and then run

CC=/usr/bin/gcc-4.2 rvm install ruby-1.8.7 --force

1 note

Creating an empty branch with git

I needed to create an empty branch to just have the html of a project in it.

Heres how todo it:

git symbolic-ref HEAD refs/heads/newbranch 
rm .git/index 
git clean -fdx 
<do work> 
git add your files 
git commit -m 'Initial commit'

0 notes

Spork and Rmagick - Segmentation Fault

Its ironic that I spent longer debugging this as to how much time spork actually saves me!

Anyways, if your having issues with Spork and Rmagick its probably down to a dodgy imagemagick installation. I couldn’t figure out what the problem was but theres the solution..

brew remove —force  imagemagick

Then reinstall imagemagick with

brew install -f imagemagick —disable-openmp

Now you will need to uninstall rmagick

gem uninstall rmagick

Go back to your application root and run

bundle install

This resolved my issue, hopefully it should yours too!