markoshust's blog

Tue, 01/30/2018 - 16:50

Performance Tuning Docker for Mac

Submitted by markoshust Tue, 01/30/2018 - 16:50

There are many various improvements you can make to Docker for Mac to fine-tune performance, especially when working with large application filesystems such as those with Magento or Zend Framework.

Step 1: Computer, Cores & RAM

I'm absolutely resolved that a dual-core machine with 8GB RAM will just simply not cut it. My MacBook Air just spins fans, and fswatch events get delayed or stop working just because there is not enough computing power to go around.

Wed, 10/25/2017 - 13:35

Migrate large amounts of data in Laravel with Artisan Console and Chunk

Submitted by markoshust Wed, 10/25/2017 - 13:35

I've recently had to create a script to migrate a large amount of data post-deployment. This presented a couple issues; one being that the script needed to be performant, another being that since it took at least a few minutes to run on a couple hundred thousand rows, I needed to display the status of the script for devops so it didn't appear to be hungup or failed.

Wed, 09/13/2017 - 11:59

Enable Bootstrap 4 in Laravel 5.5

Submitted by markoshust Wed, 09/13/2017 - 11:59

Laravel 5.5 just recently got released, and ships with the current stable version of Bootstrap, which is version 3. However, Bootstrap 4 recently hit beta, and should now be solid enough to start development with, especially for new Laravel projects that are just now getting started.

Bootstrap 4 can be easily enabled following these steps. First, remove the Laravel-supplied version of bootstrap-sass from npm:

npm uninstall --save-dev bootstrap-sass

Fri, 08/25/2017 - 16:21

PHP 7's null coalesce operator usage with Objects and Arrays

Submitted by markoshust Fri, 08/25/2017 - 16:21

PHP 7 introduced the null coalesce operator. Basically, it's syntactical sugar and shorthand when checking for the existence of a variable and then falling back to some value.

For example, this small script outputs bar, because $foo is not yet defined.

echo $foo ?? 'bar';

It's the same thing as writing the following, just much more readable and succinct:

Thu, 03/02/2017 - 09:15

Making Docker for Mac Faster with the Overlay2 Filesystem

Submitted by markoshust Thu, 03/02/2017 - 09:15

By default, Docker for Mac ships with the default filesystem being aufs. This is a fairly antiquated filesystem and is quite slow if you deal with lots of files and filesystem reads and writes. You can see the results of a filesystem benchmark to compare.

The easiest task to do to get better filesystem performance in Docker is to switch to the overlay2 filesystem. This achieves better performance by optimizing how layers are created and managed.

Tue, 08/23/2016 - 12:04

The JavaScripter's Guide to Rational Development

Submitted by markoshust Tue, 08/23/2016 - 12:04

JavaScript Fatigue is a real thing, and there must be rules & processes in place to help prevent it from happening to you. These are my thoughts.

Learn, don't apply

Learn new libraries, npm packages, and development methodologies, but don't apply them to your current projects until best practices are formed. This might take some time, hence the next rule...

Sun, 08/14/2016 - 05:08

Create and deploy a NodeJS Express app with Docker

Submitted by markoshust Sun, 08/14/2016 - 05:08

I'll show you a stupid fast and simple way to create an express app with NodeJS, then deploy it with Docker. All you need is a simple text editor.

Install NodeJS & Docker

Install node with n:

npm i -g n
n latest

Install Docker by pulling out the appropriate build from

App setup

Let's now get our express app setup. Create a new directory and initialize your package.json file: