Using Closures to Create Quasi-Encapsulation in Javascript

It is a well-known fact that JavaScript does not support the full spectrum of object-oriented constructs. Specifically, JavaScript does not allow for encapsulation of properties via a private keyword or the like. In large applications, state management is critical. Improper state management—especially where object state is mutated in uncontrolled ways—can cause many nefarious bugs. Closures Continue reading Using Closures to Create Quasi-Encapsulation in Javascript

Disabling Xdebug on Mac’s PHP CLI

Composer will throw lots of warnings if you run it with xdebug enabled, which gets old fast. Additionally, it’s a lot slower to run composer with xdebug. Both good reasons to disable it. However, Composer’s directions weren’t so helpful for my Early 2015 Macbook Pro. Additionally, I didn’t want to have xdebug disabled for all Continue reading Disabling Xdebug on Mac’s PHP CLI

Free, Automated SSL with a Single AWS EC2 Instance

These instructions apply only on non-load balanced setups. The example files are for Apache, but you could easily modify them for NGINX. If you’re using an Elastic Load Balancer (ELB), then Amazon makes available their certificate manager which can generate and maintain certificates for free. This configuration uses Let’s Encrypt and Certbot to install and automate SSL Continue reading Free, Automated SSL with a Single AWS EC2 Instance

PHP Internals (series): Closure Type Hinting

Type hinting allows you to specify the type of variable you expect to be passed as a parameter to your method. Passing parameters that do not match the specified type throw errors. (By the way, PHP 7 allows type hinting of scalars.) Normally, you will type hint a class or interface. However, you can also Continue reading PHP Internals (series): Closure Type Hinting

Intro to Node.js for LAMP developers

If you are familiar with LAMP stack development, but interested in Node (or MEAN stack) development—this post explains some of the differences to be aware of when switching environments. Node runs in memory on its own server This was for me one of the biggest paradigm shifts in understanding Node. If you are used to Continue reading Intro to Node.js for LAMP developers

How to Be A Programmer: Humanities Edition

If you are a humanities major without any computer science experience, then this post is for you. If you were a humanities major and currently a programmer, then you will probably find this terribly basic. I am not going to approach the question of why you should learn to code (although the reasons are many!). Continue reading How to Be A Programmer: Humanities Edition