ES6 gave us classes and object inheritance in JavaScript. However, it’s still missing any concept of “privacy” in OO terms. Here’s a hacky workaround to, maybe, make things work.
Mocking Time in Unit Tests
Some operations in PHP introduce uncertainty around your code’s behavior. In those situations, it’s helpful to insert helper functions that make your code more reliable and easier to test.
Building a Phone Routing System
In this walkthrough, I build a phone redirection system using Twilio to automatically forward frequent wrong numbers to the business with a support line 2 digits transposed from me.
Securing Forms Without Captcha
Captchas are a terrible user experience. They put the onus of spam protection on the visitor filling out the form and, personally, show me how lazy you are as a site administrator. There are a hundred different ways you can protect your site from spam on the server side – why would you forego these […]
WordPress Plugin Structure
The power of WordPress lies in its pluggable infrastructure. Unlike other content management applications which require you to edit the core code of the system to make changes, WordPress supports plugins. These smaller applications tie in to a rich API provided by WordPress that allows you to change just about everything about the application and customize […]
jQuery as a Global Event Bus
Some time ago, I made a mistake. Rather than taking the time to truly understand how events worked in jQuery, I built my own JavaScript library to handle event delegation. It worked, but why reinvent the wheel? It turns out jQuery is perfectly capable of serving as a global event bus for all of your […]