From Spaghetti To MVC

A step by step example based explanation of transitioning a web page into an MVC based application.

Protecting Actionable Links from CSRF Attacks

For a long time, I didn't protect my actionable links from CSRF attacks. By actionable links, I mean links that will modify data on the server, e.g. "delete product", "publish post", "like". I'd always written these as regular "a href" links, but this can be a very easy to manipulate attack.

So Long WordPress

This blog has been powered by WordPress for somewhere close to 5 years. However, as of this morning, it is powered by my own blogging platform, OpenPub. This was something that I had been meaning to do for awhile, but never had the time. WordPress is a monster of a legacy codebase. I found that as I wanted to add new features, I was forced to rely on third party plugins or digging into the inner workings of WordPress. ...

Object Composition

A quote from David West, author of Object Thinking, on object composition, which I would've disagreed with a few years ago now really resonates with me. SRP is an important principal, that while we may not apply it religiously helps to make code more maintainable.

Auto Dependency Resolution for IOC

Ever wondered how Laravel determines which objects to pass into your classes. This guide explains how automatic dependency resolution works by showing you how to make a basic IoC container. This relies heavily on php reflection api.