Category: Blog

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…

Nu har till och med Computer Sweden börjat skriva om Scratch: http://computersweden.idg.se/2.2683/1.504465 http://computersweden.idg.se/2.2683/1.504464/en-barnlek-att-bygga-eget-spel Så nu är det på tiden att göra något åt saken. De senaste 6 månaderna har jag hört bra saker om ”programmeringsspråket” från alla möjliga håll och … Continue reading

Inga relaterade poster

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…

I got tired of the old dark green design. It was too murky and spring is in the air, so I redesigned the site to be lighter and more "spring-y". ` `Inconsolata` is back as the source code font and `Open Sans` makes up the majority of the text on the blog now with the exception of headers which are set in `Racing Sans One`. All-in-all, I’m happier. And hopefully this can trigger my implementation of multiple pictures per post since I need that to report on my robot project progress. Summer is coming and summer means sun, and sun means solar power which in turn means that I need to speed things up if I want this project done before the (OMG spoiler alert!) new baby in the end of July….

Wow, that was kind of exhausting. I’ve completed my rewrite of all my blog posts into Markdown. Somewhere in the middle I found why my inline HTML didn’t work and that made my old posts look almost acceptable, but the syntax highlighted source code di…

Desperate, as always, for lowering my blogging threshold I implemented Markdown syntax for the blog. As I did this through use of the marked plugin I lost support for inline HTML (might be a setting though). For a few hours this means that my old blog…

In a totally unoriginal move I’m now starting to wean myself off Facebook, starting by deleting the Facebook app from my phone and tablet. Since almost everyone else in the tech sector seems to have done the same thing at least once, I don’t feel that I have to post any particular reason for doing so other than being tired of it. Since I’m not going cold turkey right away I will still check in on Facebook from my laptop, but the number of "feed reads" will hopefully be few and far between….

One might wonder where I’ve been or what I’ve been up to these last couple of months. One would be right to wonder why I, so close to the one year anniversary of this blog, suddenly stopped writing. The truth is kind of embarassing. I created a bu…

In March this year I took a great leap forward in performance when I built my in-memory cache. It took my blog from a paltry 5 requests per second to a whooping 62 requests per second. Well, since then I’ve made some changes… Since you already kn…