How to install PHP 7.2 on Mac OSX

How install the latest stable version of PHP 7.2 on OSX using homebrew. As of this writing PHP 7.2 is still not the official production release, but you can still install it on OSX. The motivation for writing this post was because I wanted to upgrade from the PHP 5.6 on my mac book to the latest stable version for WordPress development on OSX. WordPress is phasing out support for older versions of PHP.

Perl and Prolog

I just started playing with the perl module Language::Prolog::Yaswi which allows you to interface with SWI Prolog. It has a few quirks, but it seems to work well. I could not get the consult to work as expected using paths outside the current directory. To get around this limitation, I could simple read the contents of a file located outside the current directory. Then simple call the swi_inline to consult the code.

how to backup and restore postgresql database

How to backup and restore postgresql database 9.6 Having regular backups of your database is important as you might already know. You might even have a development environment that you want to load with production data. Here is quick overview of how you can backup your postgresql database and restore it. This will also work if you are backing it up from Ubuntu linux and restoring it to Mac OSX.

Go sql examples

Go sql examples using sqlx Assume you have two models a type Business and a type Widget in a one to many relationship. I want to demonstrate two ways that you can load the widgets into a business object using sqlx. I am using postgresql.

How to remove an old version of postgresql from OSX with multiple versions installed

Here is a short tutorial on how to remove older versions of PostgreSQL database from OSX when you have multiple versions installed. If you follow one of the popular answers on StackOverFlow you may accidentally delete an important file for your other newer versions of PostgreSQL running on your Mac. These instructions assume you installed the database with the EnterpriseDB installer. Here are the steps you need to follow: First, make a backup of the database if you need any data or schema.

11 Steps to making a business website

How to make a business website in 11 steps The purpose of a business website should be to get more customers for your business. This can take different forms depending on what your business does. If you are a brick and mortar shop, and you do not sell anything online, your goal is to get new customers to come into your store. If you only sell online, your goal is to get people to buy from your website.

Golang YAML to map

How to convert a YAML file to a map[string]string in Go Use go-yamlconfigfileproject to convert simple yaml config files to maps in Go. When you want to store secrets for your project, you should never keep them in source control. There have been too many documented cases of secrets being leaked because of this. If you are using public version control like github, people can simple scan through your history to find things you may have accidentally released to the public internet.

How to process xml with invalid utf-8 bytes in Go including ISO 8859 1 encodings

I recently had to process a large number of xml files that were not UTF-8 encoded. They also happened to include characters that were outside the valid ASCII range. I did not really want to keep these invalid characters, and this solution will work for that use case. If you do need to keep non-ascii characters, this simple solution will not work for you. The trick to making this work is to create a wrapper around the io.

Go Closures as Struct Members

How to store closures at runtime inside struct members in the Go programming language. I will also show you how you can change the closure stored as a member inside of your struct at runtime. I have used Perl for many years, and you can easily pass around closures and dynamically redefine classes at run time. You can even create entire classes at run time, I have done this, and it makes some really interesting patterns.

How to compile libvips on OSX from source for image processing

Here are the steps needed to compile libvips from source. If you try to install it from homebrew, you will most likely run into a number of errors regarding the dependency gtk-doc. This will frustrate you, and you might abandon the effort. I will show you how to install the latest stable libvips without having to install gtk-doc I normally do not like to use dependencies like this in my Go project, but the performance of image processing needs to be really good as this type of computing tends to use a ton of resources on a server.