Raw packet logging with iptables and Wireshark

I've been doing a lot of work with Asterisk and SIP recently and have found that viewing the raw SIP packets in Wireshark is an incredibly useful tool when debugging. The logs that Asterisk and various phones provide tend to give fairly cryptic error messages that don't really resemble the issue, plus some problems are caused by a packet not arriving at all due to the other end sending an incorrect media address etc.

Inline styling via classes is just as bad

Something that has really started to bug me about frontend development recently is how it seems so common to stick a class on something that only applies one style. For example

JavaScript library to capture HTML elements being created

I've written about this technique for capturing HTML elements being created before, it's a pretty cool hack using the animation start event and a uniquely named CSS animation to catch newly created elements being added to the document.

HiFiBerry DAC for the Raspberry Pi

For a long time I've been looking for a way to play music from Spotify on my phone through my home stereo system without having to connect it to the amp directly. There are a couple of reasons for this with the main one being that the DAC (the thing that converts digital music to analogue so that it can be sent out via the headphone jack) in all mobile phones is very poor, not a complaint really as they're designed for headphones and to be small, not suitable for use with a nice amplifier at all.

Using tables for layout purposes

Okay let's start off by saying using tables for layout purposes is a terrible idea - the web has largely moved on from that sort of thinking. The focuses on semantics and responsive design have become much more important than "that works" could ever be. The reduction in tables nested in tables nested in tables nested in wrapper tables is a huge step in a very positive direction in my opinion. However, this dodogy HTML did make some layout desires very very easy and some of those are quite awkward with sensible HTML and CSS. Apparently we need some sort of middle-ground compromise. Time for an example.

The second best thing about PHP 7

Following on from the previous theme I've picked out another of my favourite new things in PHP to talk about - general strictness. In current version of PHP there is no way to define the type of thing that a function will return or accept as a parameter - very different to most other languages.

The best thing about PHP 7

With PHP 7 finalised and almost here I thought I'd take a look and pick out a few of my favourite new features that it introduced. I do a lot of my daily work in PHP but do know a few other languages fairly well - there are some things being added that PHP has been lacking for a long time so, to me, this feels like a big catch up.

More realistic local web development server

One of the most common tools used to test and develop web projects is XAMPP. The idea is simple, you run a small web server on your local PC and use it to host a copy of the website you're working on. The problem with this is that it is not that similar to the environment that the site will actually run under, hosting companies very rarely use Windows for starters.

Asterisk for home

Asterisk is an open source phone server used predominately in business to route incoming calls through those awful menus to the person that should know how to deal with them. The usefulness of something that can do pretty much anything you could think of with phone calls is obvious for companies that deal with a large number of calls per day. Something that gets less mentions in using something like Asterisk for a home phone system.

JavaScript Document Mutation Events

Sometimes you get a situation where you need to know when a new element has been added to the page with JavaScript. A common example of this is adding event listeners to a certain type of input then adding more of those inputs - the new ones do not get the event. For a simple example it's obviously easier just to add the event handler when adding the new input so let's assume we're talking about something more complex. There used to be an event for this kind of thing