Thinking About Probabilistic Filters
I've been a big fan of probabilistic filters such as Bloom, and (more so) Cuckoo filters for a while now. I've put them to great use in my personal projects, as well as in major data processing projects at work. They fall into a neat class of data structures that let you trade certainty for performa…
Read More / Comment »
Fully Implementing PSR-16 Simple Cache is Less Than Simple
Foreword: Please note this falls firmly into "nitpick" territory rather than shining light onto any sort of major issue. I just thought it was an interesting gotcha and wanted to share.
I work on an application with a proprietary caching layer. Recently I wanted to build a PSR-16 "Simple Cache" ada…
Read More / Comment »
Best Way to Run Unsigned Binaries in Terminal on macOS
With the introduction of Apple Silicon, macOS became much stricter about running unsigned binaries. It even refuses to execute them in the Terminal. This can be frustrating as many precompiled tools, once easily downloadable from sources like GitHub, may no longer work as expected.
By default, if y…
Read More / Comment »
Go’s New Iterators Smell a Little Funny, but They’re Still Good
Go's new Iterators were released on August 13th with Go 1.23. They're pretty useful.
They've had just a minute to marinate. In some parts of the community they've been an unpopular addition, however I don't particularly mind them. The old alternatives seem a little more "Go" to me, but the new ite…
Read More / Comment »
Three-Step Debugging: A Methodical Approach
I've been working as a developer for almost twenty years now. In that time I have had the pleasure of helping many developers, and helping them debug code. Some were new to the field, had vastly more experience than me.
While some are naturally somewhat gifted at debugging, it's important to unders…
Read More / Comment »
Releasing my tools under the MIT License was probably a mistake
For basically as long as I can remember, I have been a staunch defender of permissive licenses over the more copyleft variety. I want you to use things I've written. On top of that I don't believe it's my place to force you to then open source things you have written that expand upon my source code…
Read More / Comment »
Trouble with TypeScript Timeouts: How to Fix It
The tl;dr is this:
You can fix the problem by replacing number with ReturnType
Similarly you can replace number with ReturnType
if you are seeing the problem with setInterval.If you want to know more about it, read on.
I've run into this problem a number…
Read More / Comment »
Read Browser File Inputs with Go WebAssembly
I have been playing with WebAssembly since Go added support for it in 2017.
For a very long time now, I've been wanting to be able to accept files from an end user and process them with Go on their local machine. Basically I just want to read files from file inputs. I knew it had to be possible, b…
Read More / Comment »
git gc - You're not going to need it
tl;dr
I recommend every developer turn off automatic garbage collection in git. It's one of the first things I do setting up a new machine - and you should do so too.
For a happier life, go to your terminal right now and run:
$ git config --global gc.auto 0
I promise you won't regret it.
The fu…
Read More / Comment »
Go Modules have a v2+ Problem
Go has a problem. Go modules place a strange naming requirement on modules version 2 or greater. Module names on modules v2+ must end in the major version ala …/v2, and communication of this rule has been weak. It's non-obvious, and the community at large does not understand it.
I have seen many ve…
Read More / Comment »
Use a GIF as a Zoom Virtual Background
It's not ideal, but until the whole SharedArrayBuffer debacle settles down, it's probably the best I can do right now.
Stuck in boring Zoom meetings? Have the perfect gif you want to use as your "Zoom Virtual Background", but Zoom won't let you use animated gifs?
Here's a tool to convert GIFs to M…
Read More / Comment »
Go Binary Sizes Have Been Pretty Stable
In 2013 I wrote an unintentionally inflammatory post: Go Binary Sizes Are Growing out of Control. I had imagined no one would read it, but it took off. I wrote it because I noticed my binaries getting larger as I upgraded versions of Go and found it curious.
Much has changed since then; biggest of…
Read More / Comment »
Using mkcert to Set Up Local SSL on macOS's Built in Apache
A little under a year ago I wrote a walkthrough: Set up a Self Signed Certificate on macOS's Built in Apache.
Recently a new tool showed up called mkcert has come and made life way easier.
It's a wonderful tool that instead of building Self-Signed Certificates, sets your local machine up with a ce…
Read More / Comment »
Fix Missing Headers Compiling on macOS Mojave
While trying to compile PHP extensions after installing macOS Mojave, I was butting up against a ton of missing header file errors including php.h and zlib.
After several hours of beating my head against my desk and Googling/Stack Overflowing I found the solution.
Ends up you just need to force re…
Read More / Comment »
Set up a Self Signed Certificate on macOS's Built in Apache
I recently purchased a .app domain for a side project; .app domains are interesting as they require SSL at all times.
I like to set up my dev environments as subdomains of my actual domain, such as local.donatstudios.com. It makes working with CORS and cookies a lot simpler for applications with A…
Read More / Comment »
GitHub Shouldn't Allow Username Reuse
To prevent developers from pulling down potentially unsafe packages, we now retire the namespace of any open source project that had more than 100 clones in the week leading up to the owner’s account being renamed or deleted.
This is a decent half step but I'd still love to see either permalinks o…
Read More / Comment »
Static Analysis: It's Simply Critical
I am someone who spends large portions of their time working in weakly typed languages. Namely, PHP and JavaScript. I argue that static analysis is a must-have when working with any weakly typed language. It is nearly impossible to make reliable code without it.
Static analysis makes up for the mi…
Read More / Comment »
Falsehoods Programmers Believe About CSVs
Much of my professional work for the last 10+ years has revolved around handling, importing and exporting CSV files. CSV files are frustratingly misunderstood, abused, and most of all underspecified. While RFC4180 exists, it is far from definitive and goes largely ignored.
Partially as a companion…
Read More / Comment »
CSV: An Encoding Nightmare
It would appear in a recent update Microsoft has added support for safely reading and writing UTF-8 CSVs to Excel. There is a new format in the save dialog CSV UTF-8 (Comma delimited) which is distinct from Comma Separated Values which is also still in there.
In my testing it appears to safely bot…
Read More / Comment »
I Am Done With the Mac App Store
In that same time range I had a handful of Apps purchased from the App store suddenly and mysteriously stop working. They just quit. No dialog, no error mesasage, nothing at all. Apps I paid for and depend on just stopped working.
The thing they all these Apps have in common is they are no longer a…
Read More / Comment »
Fix Played Tracks with Empty Playcount in iTunes
I have a quite large iTunes library, and I’m rather anal about keeping my metadata clean and up to date. In an earlier release of iTunes 12 there was a bug. Every so often after a song played, the Play Count would fail to increment, but the Last Played would update.
Searching my library, I found 7…
Read More / Comment »
Numberphilia
There's been a fair deal of hubbub in the community about version numbers, including what is and isn't Semantic Versioning, what qualifies as a breaking change and how to use version numbers.
Underscore.js released a second digit "minor update" that was actually a breaking update for some people. T…
Read More / Comment »
Install PHP's Built In Extensions in macOS
Should you run into errors related to missing php.h or other .h files, you should check out my post on fixing missing headers on macOS Mojave.
These directions are for working with the native installation of PHP. Your results may vary if you are using a brew, MAMP or otherwise installed version of…
Read More / Comment »
Configure Apache for PHP in OS X / macOS
Every time I would upgrade OS X it took probably 45 minutes of fiddling with my Apache configuration to get it working properly. I'm writing this article in the hopes of saving myself and others some time.
The Setup
For the following examples, {username} represents your username.
Firstly, if you…
Read More / Comment »
Require a Remote Zip File with Composer
I previously showed you how to Load a Github Gist with Composer, but sometimes you need to install code that isn't isn't even in a public facing VCS.
I for instance wanted to use a library only distributed by Zip.
It's actually fairly easy! In your composer.json file, you simply add a repositories…
Read More / Comment »
All Glory to __invoke
Lost in the shiny new features (see: namespaces and closures) PHP 5.3 also added the __invoke method. While not plainly apparent, it is secretly an amazingly useful 'magic method' .
If you're not taking advantage of __invoke, you should be. Why? It provides a uniform execution points for objects t…
Read More / Comment »
PHP Has Grown Up, You Should Too
Over the weekend I went to a talk on Scala. The speaker said variety of harsh, inflammatory, and mostly wrong things about PHP and the PHP community.
One such example:
The PHP community doesn't care about things like lambdas, they just care about getting a site up as fast as possible.
This is j…
Read More / Comment »
Using Beyond Compare 4 Mac Beta with Git
A little over a year ago I wrote a post about using Beyond Compare on Mac via Wine. A native version is now in beta and open to everyone! If you haven't tried Beyond Compare, I suggest you do. If you have you already know how awesome it is.
I've been testing the Alpha for many months now and thoug…
Read More / Comment »
Go Binary Sizes Are Growing out of Control
Note: This is not intended as a "Go Sucks" post. I love Go. I am not saying the developers are lazy or dumb or any of the things Reddit has implied. I am not implying I could build a better compiler. Rob Pike and the Go team are geniuses whom I look up to. The tone of this was intended to be a light…
Read More / Comment »
Load a Github Gist with Composer
Composer is amazing for pulling in packages, but what if you find a Gist that isn't Composer aware? Fear not, as Composer has the magical ability to pull in repositories not explicitly set up in Packagist by defining them in the "repositories" section.
But what if you wanted to load a single class…
Read More / Comment »
Installing the PHP "memcached" Extension
⚠️ Warning: These instructions are outdated
This article was written for OS X Mavericks and should not be followed on modern versions of macOS. It remains available for historical reference only.
For development on modern macOS, use a Homebrew-installed version of PHP. shivammathur/php is a good p…
Read More / Comment »
How to: Disable macOS System Integrity Protection
If you are running OS X El Capitan or newer you will need to disable System Integrity Protection to modify system files and directories.
To disable System Integrity Protection, boot into recovery mode by restarting and then holding ⌘R as you hear the startup chime. Then start the Terminal from the…
Read More / Comment »
CoffeeScript's Scoping is Madness
CoffeeScript is a programming language that compiles to JavaScript. Its mission is to "expose the good parts of JavaScript in a simple way". I've heard a lot of interest in it lately from various channels.
After a coworkers departure, I inherited maintenance on our deployment bot, and it was writ…
Read More / Comment »
The Joys of UNIX Keyboards
I fell in love with a dead keyboard layout.
A decade or so ago while helping a friends father clean out an old building, we came across an ancient Sun Microsystems server. We found it curious. Everything about it was different from what we were used to. The command line was black text on a white ba…
Read More / Comment »
Use Beyond Compare as a Git Diff/Merge Tool in OS X
I switched from Windows to Mac for work a little over a year ago (I've been using Macs at home for years) and there is one program I still could not live without - Scooter Software's wonderful Beyond Compare. I've tried every single diff tool available and none have lived up to Beyond Compare. It t…
Read More / Comment »
Static::? More like Lies::
In my professional work, we have a system that utilizes __call and __callStatic for caching of certain method calls. We have been running into a problem where calling an undefined method via :: within the class itself will trigger __call rather than the expected __callStatic.
The Problem
The follo…
Read More / Comment »
Late Definition of PHP Class Members
Working on a class in our application, I discovered that it was being included before a number of constants it used for its members were even defined. Puzzled on how this had never been a problem I started to experiment; echoing the member at the bottom of the class file after the class closed show…
Read More / Comment »
Web Developer Resumé/Interview Advice
As Lead Developer at my previous company I interviewed many Developers. I wanted to provide some advice to Developers on how to come off more positively.
For the purposes of this post I, me and all other pronouns referring to myself refer to a hiring professional.
Some Basics Up Front
Google your…
Read More / Comment »
Simple Single Pass Doubly Linked Flat Tree Building Algorithm
A hierarchy is a common structure, especially for structuring pages in web development. A problem with hierarchies is they often need to be flattened to be stored in a relational database, and then expanded again after being pulled out.
An Example Hierarchy
Top level item
Sub Item
Sub Sub Item…
Read More / Comment »
Simple WPF VB.Net JumpList Example
Today I decided to spruce up a VB.Net application I wrote in
college and still use almost daily. In the process of converting it
from .Net 2 to .Net 4 I wanted to add a splash of Windows 7 goodness; there were some
very simple operations I wanted to add to JumpLists. The problem I ran into with…
Read More / Comment »
Opinion: Google Killed the Internet
Googles Page Speed “Optimizations” Make Learning Difficult
If you, as I, grew up during the web bubble we call the 90’s and were interested at all in web development my guess is that you probably didn’t learn most of your skills from a book or a class. You probably would run across a site that ha…
Read More / Comment »
Grid Style Sheets vs. The Semantic Web
Grid Style Sheets Must Die
I have been aware of Grid Style Sheets for quite a while, but I long ago dismissed them as a fad like CSS Resets. Recently though it came to my attention that OSCommerce 2.3 switched to the 960 Grid Style to replace its table based layout system. I spend most of my deve…
Read More / Comment »
Fast Patches with Git
In my work, I deal with a lot of very similar codebases - and often if I fix something in one project I'll want to fix it in many others. For a long time this has meant popping open Beyond Compare, which works, but isn't the simplest solution.
I use git on my projects - but they're not similar eno…
Read More / Comment »
A Balanced Look at GZIP and the User Experience
With Google recently starting to involve load time in search rankings, there has been a lot of talk about GZIP. Google Webmaster Tools exclaims "Compressing the following resources with gzip could reduce their transfer size by XKB:". Many people listen to this, and go out looking for a quick fix…
Read More / Comment »
There Isn't an App for… - Part 1: PhpED
“There Isn't an App For That” - Windows Apps I haven't been able to replace in Mac OS X
For a very long time I was a Windows guy, I was once a DOS guy. I switched nearly exclusively to Mac for my home use about 4 years ago. I’ve been very happy with it. Its stable, well engineered, and - my favorit…
Read More / Comment »
Donat Studios Officially Launches
After much ado, Donat Studios is finally live!
There are a few things left to complete. Eventually setting up the documentation and public git repository for CorpusPHP will certainly take up a fair amount of time. I'm still not quite sure what to put in my portfolio, I was thinking of for the time…
Read More / Comment »
JSONP: Take It With a Grain of Salt
I don’t want anyone take this the wrong way. I love JSON. It is so much simpler to parse than XML, and is an all around exceptional way to represent data. I have one caveat though, and that is “JSON with Padding” or “JSONP” as it goes by.
Building this site I wanted to bring in images from my Flick…
Read More / Comment »

Comments
Nothing yet. Say the first thing.
Sign in to join the conversation.