wm
wm

First Class Functions

Fun with first class functions in Go

November 11, 2014

There are times I need to wrap a function with extra behavior. Also I need to wrap this behavior in different ways based on some configuration.

One option is to define a configurable object with a method that wrapped the specific behavior. Based on some state in the object the wrapping method would behave differently.

However, for fun, and . . .

Read More

Casting vs Calling

My confusion surrounding casting a function into an object

May 28, 2014

Being new to Go I was confused by how some packages in Go adapt functions into objects. The net/http package provides such an adapter.

Background

It is really easy in Go to create a basic web server. The function http.Handle takes a pattern and a http.Handler object. When a request is made that matches a provided pattern the handler's . . .

Read More

My tmux setup

A look at my favourite configuration settings

February 18, 2014

I have been using tmux for a couple of years now, I committed a tmux.conf to my dotfiles repo two years ago this week. I find that it is an excellent way to organize projects, share a session for pairing, or just ensure W or Q don't ruin your day! I just wrote a post on how I use it a Iora Health to manage my development environment that . . .

Read More

Enumerator in Go

Implementing the Enumerator (not)

January 31, 2014

I am a big fan of the Enumerator in Ruby. So I wanted to see if there was something similar in Go. But before I started my search I was curious to see if I could implement a crude version myself.

In Ruby we would just implement the each method and include the Enumerator module. So if I could implement an each method in Go it would be close . . .

Read More

Getting started with Go

Resources, best practices, and diving in

December 18, 2013

Why Go?

My programing language of choice is Ruby. I just love to work with it. As a former Java developer, Ruby has made my life so much better. Apart from the beautiful language, Ruby also has a great community. This more than anything is what makes Ruby so powerful.

So why would I be interested in a different language? Well much of it has to . . .

Read More

My Backup Strategy

March 28, 2011

Unfortunately there is no backup silver bullet, so to ensure that I have the computers in my home backed up and secured I use a mix of services. In the following sections I will describe how I use Time Machine, Arq and GitHub to keep my data backed up and secure.

Time Machine and Drobo

I use Time Machine to fully backup 3 MacBooks and a . . .

Read More

Extract to Git submodule

Convert subfolder into Git submodule

January 13, 2011

Recently I had the need to refactor a large repository we use at work. The layout of the repository was as follows

 ~ $ cd ~/Development/LUF (master) Development $ ls src/ (master) Development $ cd src; ls AAR/ MSEL/ SigEvServer/ WebServices/ (master) src $ 

All the apps in the src folder were Rails app (except AAR) and I wanted to
move each . . .

Read More

Applying changes to VIM buffers

How to apply changes to all open VIM buffers

January 13, 2011

A simple way to make modifications to a lot of file is to open all of them
in vi and apply the search and replace to every file that is buffered. The
easiest way to do this is as follows:

 :bufdo %s/pattern/substitution/ge | update

Breaking down the command we can see what each part is doing.

actiondescription
bufdoapply to all buffers
gapply to all . . .

Read More

Git: Rebase vs Merge

Using rebase instead of merge when pulling from remote

October 19, 2010

Instead of doing a regular pull

git pull# aka: git fetch && git merge remotes/origin/BRANCH BRANCH

To avoid the all the merge commit messages you can run the following command instead

git pull --rebase# aka: git fetch && git rebase remotes/origin/BRANCH BRANCH

I actually have the following in my ~/.gitconfig file

[alias] up = !sh . . .

Read More

SSH: Password free login

Setting up ssh keys

December 14, 2009

Step 1

On each machine type ssh somemachine.example.com and make a connection with your regular password. This will create a .ssh dir in your home directory with the proper perms.

Step 2

On your primary machine (the machine that you will ssh from) where you want your secret keys to live (let's say kermit), type

 $ ssh-keygen -t dsa

This will . . .

Read More

Archive
  Subscribe by Email and Never Miss a Post