My name is Matthew Davies. I'm a software engineer, among many other things.

Welcome to my web home, where you can find my various ramblings on a wide range of topics, including (but not limited to) JavaScript, AngularJS, web development in general.

Recent Posts:


Mar 17, 2017

Google recently released guetzli, a JPEG encoder that claims 20%-30% smaller compressed images, while still retaining the same image quality. I thought this looked pretty cool, so I gave it a try. It seems to work quite well. I was able to compress a 2.7MB image down to 1MB. The only downside was that guetzli took almost 20 minutes to compress the image. I hope Google improves the speed of the tool, but it’s worth a shot if you have some images that need compressing.

Web tools are the problem

May 23, 2015

Peter-Paul Koch on the ever growing overcomplication of web tools: Why all the cruft?… Tools don’t solve problems any more, they have become the problem. Marco Arment on Marco.org: Most times I land on a Stack Overflow page with a simple Javascript question, the highest-voted answer is “Just include [framework X] and then call this function,” even though a few posts beneath it is a perfectly suitable, standalone 10-line function.

Angular Service Providers with config

May 22, 2015

Simple example of an Angular service provider with configuration option(s): var app = angular.module("app", []); app.service('service', function() { var service = function (enabled) { this.enabled = enabled } service.prototype.isEnabled = function() { return this.enabled } return service }) app.provider('MyCoolService', function () { var enabled; return { setEnabled: function (isEnabled) { enabled = isEnabled; }, $get: function (service) { return new service(enabled) } }; }); app.config(function (MyCoolServiceProvider) { MyCoolServiceProvider.setEnabled(true) }); app.controller("Controller", function ($scope, MyCoolService) { $scope.

Google Chrome 41 update

Mar 6, 2015

Cool updates to Google Chrome today. More recently I have been doing cross-browser testing in Firefox. One of the features of the Firefox inspector is a nice little highlight that shows up on elements that have changing properties: Chrome recently added this feature in the latest update (v41) As you can see, it is a very useful tool for any web developer using Chrome’s (or Firefox’s) inspector. Thank you Google :)

Running Docker on OS X

Feb 5, 2015

Recently I started using Docker for my side projects and for the Valley Hackathon a couple weeks ago. I really like the flexiblity and encapsulation that it offers, in contrast to tools like Vagrant. However, on a Mac, Docker runs on boot2docker, a tiny image built just to run Docker containers within VirtualBox. This can cause some problems with features such as shared folders, since the Docker container loads volumes from within the boot2docker machine, not your OS X machine.

Blog migration

Nov 13, 2014

I recently switched this blog over from my old Blogger blog. I have been on Blogger for many years, but I never really loved it. Several months ago, I discovered Jekyll and GitHub Pages. Jekyll is a static blogging blogging/website engine that has all the convenience of a dynamic website, but with the speed of a static HTML website. I started using Jekyll and quickly realized that I had to move my blog over to Jekyll.