Filter by:
Sort by:

Are you smart enough to debug your code?

Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it? Brian Kernighan from The Elements of Programming Style, 2nd edition, chapter 2 “Simple doesn’t ... Read more »

One of the best programming skills you can have is knowing when to walk away for awhile.

"One of the best programming skills you can have is knowing when to walk away for awhile." - Oscar Godson "Sometimes it's better to leave something alone, to pause, and that's very true of programming." - Joyce Wheeler "Best ergonomics advice is 'stay hydrated'" Michael Feathers When working in a ... Read more »

We value code that is easy to maintain over code that is easy to write

"We value code that is easy to maintain over code that is easy to write" from Growing object-oriented software guided by tests. "Quick becomes quicksand" Uncle Bob. This is the first post in the Series on wise software catchphrases This is probably one of the most overarching catchphrases in this ... Read more »

Series on wise software catchphrases

So I follow Code Wisdom on twitter: What the account basically does is tweet quotations by famous and not so famous software developers. The quotes are wisdom gathered through many years of working with software development. In my day to day job, I work with quite ... Read more »

Serverless Monitoring heat remotely

So I attend a small church and I am responsible for the heating system. That should be a simple task, but sometimes people fiddle with the heating system and sometimes the furnace simply stops. And even though I live pretty close to the church I don't want to go there ... Read more »

Docker vs binary packages

The other day I had a conversation with a Operations Engineer who made a bold statement: "Sending us a docker container is not different from sending us a .deb package" I do not agree with that statement at all but didn't have the time to counter it, so instead I ... Read more »

Exception handling for junior devs

Exception handling is a very important thing for creating production ready code. When you are a brand new developer you might not know how to do exception handling properly. Here I will try to describe a few basic rules that should be followed when coding. Please note that as always ... Read more »

TILs (Today I Learneds)

I have started a TIL. To be quite honest, I don't post a lot on this blog, but on my TIL, I do post a lot more often. ... Read more »

Values in software development

During my job as a software developer I have stumbled upon some values that makes a lot of sense to me: We value code that is easy to maintain over code that is easy to write I am not sure if this is the origin of this value, but I ... Read more »

Vlog: what is an API (for non-tech people)

So I decided to try something new: I made a video explaining what an API is! Of course if you are a software developer you probably already know, so move on then, or wait just a second - you could show this video to a business person you know :-) ... Read more »

Mix tasks in Phoenix using Ecto

Working with Phoenix version 0.16 I needed to import some records from a csv file. My first problem was where to place the tasks, after some research I found that you place them under lib/tasks and name them some_name.ex (not exs) The code for the task ... Read more »

Optimistic locking in mongomapper and eventbus

In Be My Eyes we use mongomapper and eventbus, both are very good tools that make my everyday life as a developer easier - except when it doesn't. We had a problem where more than one helper is added to a call. This should not happen. We have a pretty ... Read more »

Setup resque mailer on Ubuntu 14.04

I recently moved a site from EngineYard to Digital Ocean. The site used resque mailer to send emails. So I had to set up resque to handle the queue. I decided to start it with upstart and added the following script to /etc/init/resque.conf description "Resque worker configuration" ... Read more »

So you think the internet is a dark and hostile place...

Well think again! Last night we had a big breakdown on Some famous actor mentioned us on facebook - which is by the way great, and well the database could not handle it. Within 6 minutes the database went from responding within about 3-600 ms to 6-8000 ms. ... Read more »

Working from home

So yesterday we did the big launch of Be My Eyes, and what a splash we made! I am so proud of having been part of this. I work from home, which basically means that I have set up an office in the bedroom. Working from home is amazing: If ... Read more »

Map Reduce in MongoDb

I had a problem where I needed to aggregate some documents in MongoDb. In Be My Eyes, we keep records of which version of ios the app is installed on. We do this to know which versions to support. The natural solution would be to use the aggregation framework, however ... Read more »

Unix commandline

Just a few scripts useful for changing many files at once. To replace all double quoted strings with single quoted strings in ruby to make rubocop happy: find . -type f -iname '*.rb' -exec sed -i.bak "s/\"/'/" "{}" +; Now find all the places where you do string interpolation and ... Read more »

EventBus in a Sinatra app

I had a sinatra app (the Be My Eyes app), that I thought had a bit too much code in the route file. So I investigated how to make that better. What I came up with was that it would be great to have some kind of EventBus, where I ... Read more »

Frontend developers and their tools

I read some frontend developer magazines like net magazine and Web Designer Magazine. Now I really like both of them, and so I thought about how great it would be to have something like that for backend developers (or maybe full stack developers). And I thought about why it is ... Read more »

Git bisect

Oh how I love git bisect In the last couple of weeks I had some bugs that were introduced at a unknown commit. Actually I couldn't even find out what code was working wrong. I did however know excactly what was wrong in the UI. For problems like this git ... Read more »

My Mac Setup

This is just a run through of my Mac setup - I do this mostly for myself, so I can find it whenever I need to setup a Mac, but you are welcome to take a peek :-) First of all Caps Lock (I never hit Caps Lock except by ... Read more »

Update all records in mongodb

Recently we discovered a problem in Be My Eyes where an id was not unique. So we needed a quick fix to make all ids a forthrunning unique number before solving the problem in the code. On stackoverflow i found this question: And I ... Read more »

Heroku like deployment for your cloud host / VPS

For Be My Eyes I have set up a heroku like deployment environment Basically I followed this approach: But there is one problem with the above approach, and that is that I want to be able to push other branches than master to ... Read more »

Practices of a proffesional developer

Over the years I have picked up a list of practices that I think are essential to a professional developer - these are of course my opinions - other may disagree. We don't expect our customers or managers to ask for these things - but rather as professionals we do ... Read more »

Start umbraco with mvc four

I found an article by Ben Morris and it was very useful, however it seems to be gone now, so to remember it, I keep it here: The below text is from this stackoverflow This setup worked really well for me (Umbraco version 6.1.6) Firstly, start an empty ... Read more »

Hvorfor jeg koder

Hvorfor er det fedt at kode? Bemærk: En redigeret version ligger op Det er godt engang i mellem og tænke over det man gør og hvorfor man gør det. Derfor vil jeg hér reflekterer lidt over hvad jeg laver og hvorfor mit arbejde er det bedste i verden. ... Read more »

Euler in f#

Here is my solution to Euler problem 2 in F# I took the memoization code from Wiki Books Yeah I know I should use infinite lists - but have not come around to it yet let memoize f = let dict = new System.Collections.Generic.Dictionary<_,_>() fun n -& ... Read more »

Just Did the String Calculator Kata

I just did the string calculator kata, here is the output, first the test code: [TestFixture] public class CalculatorTests { readonly Calculator _calc = new Calculator(); [Test] public void Add_WhenGiven1_ShouldReturn1() { int result = _calc.Add("1"); Assert.That(result, Is.EqualTo(1)); } [Test] public void Add_WhenGiven15_ShouldReturn15() { int result = _calc. ... Read more »