Category: Mikael Lofjärd

It has been a bad year for my blog. Early on I started working on a new blogging platform that would also support a number of other content types to better reflect my life. I wanted to host my own data from my running and mountain biking activities a…

And with summer, my almost year long blog hiatus ends. July 31st 2013 was the day my second daughter was born. Besides installing some long forgotten parts in the server machine, little has happened since then. Well, little has happened with regards t…

My server mostly keeps to itself, chugging along in my apartment storage space, but sometimes I order new parts for it. One such part was the picoPSU I bought several months ago to replace my totally overkill 650W PSU. Essentially, I wanted to replace…

Here’s my latest project: !Sanded down keys It’s taking me a lot longer to sand down all the keys with 180 grit sand paper than I originally planned, but a few more hours and I’ll be ready for paint. Having kids though, I might not be able to comple…

The blog has been silent lately but i certainly have not been sitting still. About a month ago I started to remake the administration area of the blog into something a bit more fashionable (today it consists of a few input boxes and a "publish" button). Halfway through I decided to rewrite it using AngularJS. Needles to say, I’m not quite done with it yet but it’s a work in progress and it’s going to be awesome. My great friend and fellow coder Mattias spent a long weekend here and we put together a little P2P file sharing site using Node.js, AngularJS and Web RTC data channels. It’s really cool but like most things, it needs a little more work. It’s up on GitHub though if anyone wants to take a peek at it. The day before yesterday I beefed up security on my server and it’s been quite in…

I’ve been using Google Web Fonts ever since I started building this blog. It’s an awesome service with a great user interface and it makes it really easy to add fonts to your web site. Of course I had to find something wrong with it. Earlier this week our company released our new web site. On our Yammer page, one of my colleagues posted a link to a WebPageTest result for it and it fared reasonably well. It got an "F" on the "First Byte Time" test, but that test is really finicky and could just as well show an "A" if you retake the test (as I later became aware). This triggered my inner masochist and I just had to run the same test on this blog. The first result was this: Test | Score —-|:–: First Byte Time | A Keep-alive Enabled | A Compress Transfer | A Compress Images | C Cache st…

Uploading files asynchronously with XMLHttpRequest is a neat trick on its own, but what I really wanted was a nice way to upload images from my phone and/or tablet. The problem with this is that technology is evolving quite rapidly these days and my …

Uploading files using HTML forms has always felt a bit off for me. You had to set your encoding to `multipart/form-data` and the synchronous nature of form posts always made it a waiting game when uploading larger files. Then came AJAX and the dawn of "single page applications" and such buzzwords, but file uploads somehow got left behind. Javascript didn’t have the access it needed to send files with the `XMLHttpRequest`. Years passed and along came the File API and XMLHttpRequest Level 2 (it seems to be called that again) with its `upload` attribute, support for byte streams and progress events. Today I’m going to show you how to build an asynchronous file uploader with it. We’ll start with the HTML part: There’s nothing weird going on here; just a regular file selector and a list o…

I’ve been hacking away at the blog again and made a little nifty photo uploader for the admin area. It resizes the image on the client (browser) before uploading it with Ajax which is great because now I can upload directly from my phone without worryi…

Every blog should have a search box. Not because it’s necessary, but because it’s fun to implement. A few weeks ago I ran across a small Javascript library called Lunr.js. It’s basically a small text indexer that can rank search results and it’s writt…