Fun with first class functions in Go
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 . . .
My confusion surrounding casting a function into an object
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.
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
. . .
A look at my favourite configuration settings
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 . . .
Implementing the Enumerator (not)
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 . . .
Resources, best practices, and diving in
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 . . .
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 . . .
Convert subfolder into Git submodule
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 . . .