A quick guide to creating, packaging and using your first WebAssembly module with Rust, wasm-pack and friends… I’m guessing if you’re here you’ve already heard about WebAssembly and you just want to get started building something without reading pages of specification, complex explanations or stewing your brains in binary.
If you don’t know what WebAssembly (AKA Wasm) is yet, it’s a new low-level language that can be executed by modern browsers, that traditionally only ran JavaScript.
Recently I’ve been reading Leslie Lamport’s Specifying Systems book. It’s free to read online, but I bought the hardcopy as I’m old fashioned like that.
Ever since I discovered TLA+, I’ve been fascinated with the idea of using precise language to describe systems upfront. Often as developers we either don’t do any upfront specification and just hope to wing it, or we very imprecisely add comments to our code as we go.
Socket.io and hapi.js are two great pieces of software for Node. There’s no official documentation on how they work together though. I’ve seen questions about this several times on Twitter and Github, so I thought I’d write a quick tutorial to show just how easy it is to integrate the two.
The listener Every hapi server comes with a listener property:
var Hapi = require('hapi'); var server = new Hapi.Server(); server.
Disclaimer: This was a weird idea I had one day and put this together the same evening. I’ve not tested it cross-browser or in a production environment. I’ve not benchmarked this either vs actually downloading all the images. It’s kind of a ‘what if’ project at the moment. If you think it’s really dumb or cool, I’d be really interested to hear your thoughts.
Generally, whenever a browser loads a new image, it will make a new HTTP request to the server.
This isn’t an X is better than Y post. I love Express, I still think it’s a really great module and I’ve used it successfully in many projects.
That being said, I’m hearing good things about Hapi.js (referred to as Hapi from hereon in) recently which is another HTTP server framework for Node.js. So I figured it was time to check it out. As most people who I imagine come to Hapi, I have experience with Express and I’m wondering how it differs.
Freshbooks is a great tool as a freelancer, for managing your billing and sending invoices. It is however lacking in a few places for me.
One thing I really want to see when I log in is how many days have elapsed since I sent each invoice out. Yes I could work this out from the dates, but I don’t have the time quite often so things start slipping.
Luckily there’s an API we can use, and I knocked up this Ruby script in 10 minutes to give me a nicely formatted view of all my active invoices and the days since I created them.
Edit (12-2016): This article has been updated for React 0.14 and ES2015
React looks set to be the hot front end technology of 2014 with some even calling 2014 the Year of React. So I thought I’d introduce it with a tutorial and hopefully learn something myself too. Here’s what we’ll be building:
I’m going to show you how to create a complex, interactive web component with React. To this end, I will be creating a 5 band resistance calculator.
TL;DR A lot of the restrictions imposed on the HTML5 audio element by iOS can be overcome by using the Web Audio API.
If you’ve ever built a web based game that requires sound effects, you’ve no doubt felt the frustration of getting what is trivial to implement on desktop browsers to work smoothly on iOS devices.
Initally the obvious way to implement audio is to use the HTML5 <audio> element.
I had an old DVD player lying around that wasn’t working anymore so I stripped the infrared sensor from it (Note this is not a standard IR phototransistor/diode, it has a modulated, logic-level output).
I found the fantastic Arduino-IRremote library by Ken Shirriff. This library abstracts away all the processing you need to start getting commands from your remote. It also has decoders for the most popular IR protocols which will strip out any signal headers and return just the data bits.
If you’re anything like me, you visit Hacker news at least 4 times a day and you spend a lot of time in the terminal.
I usually open the Hacker News site in my browser and decide if any of the headlines catch my attention, I thought it would be cool if I could see a summary of the new featured posts in my terminal and only open them in a browser if I wanted to read them, so I made this simple tool.