| an AngularJS side project

I finally got around to deploying the AngularJS version of is a web app for converting units. The web app exists in an extremely crowded space and is by no means anything new. has one thing going for it though, it’s mobile friendly.

However, all of that doesn’t matter; the main purpose of has been to learn AngularJS and routing by AngularJS.

Refactoring from jQuery to AngularJS

The first version of was written in jQuery using a classic paradigm:

  1. Change in input field causes
  2. JavaScript to calculate resulting values and
  3. jQuery updates the frontend.

Basic and event driven.

I wanted to do more though, and I’ve been wanting to work with routing and canonical urls for a while. Enter routing with AngularJS and a head-first dive into thinking in MWC.

The model is king

With AngularJS, I needed to get rid of all the event hooks, thinking differently about where values come from. With AngularJS, the model, the M in MWC, is king. You have to focus on updating the model and just make the frontend follow suit.

I also had to get into routing and the intricacies of ngRoute, keeping the url-bar and to current unit and value into sync. My hope is that at some point, it’s going to become SEO awesome.

Deep SEO

Check this out:

AngularJS routing SEO

This is Google hitting deep and dynamic content – score!

I am definitely going to work further on this – preferably hitting the Knowledge Graph with a vengeance at some point. I don’t think I could have done this without AngularJS routing.

Hit me at @mocdotcom if you have any questions.

Vector Racer 0.2

Vector Racer 0.2 – #winning

Vector Racer 0.2 is out! And I’m glad to say that I’ve solved the two primary issues in version 0.1:

  • Detecting collisions if the player path crosses an obstacle
  • Determining when a player does a lap

So now, you are actually able to win the game! And you are able to determine if you’re better than your buddy since the number of steps are declared upon crossing the finish line.

My record is 42(!). What’s yours?

PLAY NOW (more…)

HTML for webredaktører

Webredaktører oplever det hver dag. Der er kopieret tekst ind på hjemmesiden, og uanset hvad du gør, bliver der ved med at dukke andre skrifttyper, størrelser, afstande, farver, m.m. op i teksten.

Funktionerne i CMS’ets editor til at rydde formatering hjælper ikke, og problemet består, uanset hvad du gør. Til sidst spørger du den nærmeste, der kan lidt kode. Personen klikker på kode-knappen i editoren, alt bliver volapyk, og på kort tid er problemet væk.

Det kan du også lære – og det er nemt! (more…)

JavaScript game – yay!

Yay! My first JavaScript game – sort of.

Basically I saw a video of Mary Rose Cook live coding Space Invaders in 30 minutes and wanted to get my fingers dirty.

I thought the programming was awesome and I wanted to get some practice by replicating it, so I did.

After that, I started improving on it. Mainly, I did levels of incrementing difficulty and menues.

Press “Z” to shoot and check out the video of the live coding – it’s badass:

Solved: Unable to format disk on dlink NAS

Here’s the deal: I wanted to extend the standard configuration on my dlink DNS-320L by adding a second disk to form a RAID1.

The biggest problem was to format the new disk. No matter what I did, the button saying “Set RAID and re-format” in the dlink management software was greyed out.

I tried shutting down the NAS, insert the new disk in slot 1, no avail. Shutting down, inserting in slot 2, no avail. I did this numerous times. Performed S.M.A.R.T checks, scanned the disk again and again. Nothing worked.

You know what did? Using Internet Explorer!

Yup, apparently the dlink software doesn’t like Chrome.

So, there you have it. I hope you encounter this post in a search someday and it saves you a few hours.