Find your php.ini version in terminal

php --ini


OSX Web Development

Simpler way of adding for CakePHP3 on OSX with Mamp

In a Nutshell we just need to do get the full binary package of PHP and install it on OSX, this version comes with, and we will copy it out of its install directory and drop it into our PHP version.

Get & Install the Binary Package

This website provides the packages so we just pick the version we want to use and run their install script:

curl -s | bash -s 5.6

This would install php 5.6 and we we can copy the file out of the install directory and drop it in our PHP folder.

PHP 5.6.31:

cp /usr/local/php5-5.6.31-20170817-164511/lib/php/extensions/no-debug-non-zts-20131226/ /Applications/MAMP/bin/php/php5.6.31/lib/php/extensions/no-debug-non-zts-20131226

In this example I am using Mamp so I should drop it into the extensions/no-debug-non-zts-20131226 folder of my PHP version.  These are the same version of PHP so the path should be the same, its just that Mamp holds its PHP binary files in the MAMP app.

PHP 7.3.8:

cp /usr/local/php5-7.3.8-20190811-205217/lib/php/extensions/no-debug-non-zts-20180731/ /Applications/MAMP/bin/php/php7.3.8/lib/php/extensions/no-debug-non-zts-20180731/


Enable the extension

Find the php.ini file for the version of php you want to use in my case I was using php5.6.31 (you can tell from copy/paste terminal line), and under “Extensions” add the line:

And restart Mamp, and your extension should now be installed!

Set PHP version for Terminal – Required for CakePHP / Composer based installs

Frustratingly, terminal often runs a different version of PHP when installing with composer, so for example, CakePHP refuses to install because its running a version of PHP that doesn’t have installed.  Check your version of PHP in terminal by typing:

php -v

if it is a different version that the one you want, set the correct one by using an alias in your .bashrc file.

sudo nano ~/.bashrc

Add the line (Replace php path with your path):

alias php="/Applications/MAMP/bin/php/php5.6.31/bin/php"

Then finally reload your bashrc file with:

source ~/.bashrc

You also may need to use this guide to include the php version to terminal if the above doesn’t work:


Brand Brand Guidelines

Digital Brand Guideline Examples

A place to post examples of digital brand guidelines:

Flor Brand Guide

Google Material Design Guidelines

Youtube Brand Resources

AUDI Digital Brand guidelines

Web Development

WordPress: Additional Admin Columns with ACF

In functions.php, add the following and change [post_type] for the post type of the table you want to alter.

If you have used ACF,  you can find the post type in the ur e.g.

  • /wp-admin/edit.php?post_type=jobs
// Add the custom columns to the [post_type] post type:
add_filter( 'manage_[post_type]_posts_columns', 'set_custom_edit_[post_type]_columns' );
function set_custom_edit_[post_type]_columns($columns) {
    unset( $columns['author'] );
    $columns['yourFieldKey'] = __( 'yourFieldName', 'your_text_domain' );

    return $columns;

// Add the data to the custom columns for the [post_type] post type:
add_action( 'manage_[post_type]_posts_custom_column' , 'custom_[post_type]_column', 10, 2 );
function custom_[post_type]_column( $column, $post_id ) {
    switch ( $column ) {

        case 'yourFieldKey' :
            // Job Store
            if ( 'yourFieldKey' === $column ) {
                $data = get_field('yourFieldKey', $post_id);

                if ( ! $data ) {
                    _e( 'N/A' );
                } else {
                    echo $data->post_title;


// Make Title Clickable
add_filter( 'manage_edit-[post_type]_sortable_columns', '[post_type]_sortable_columns');
function [post_type]_sortable_columns( $columns ) {
    $columns['yourFieldKey'] = 'yourFieldKey';
    return $columns;

// Make data sortable
add_action( 'pre_get_posts', 'posts_orderby' );
function posts_orderby( $query ) {
    if( ! is_admin() || ! $query->is_main_query() ) {

    if ( 'yourFieldKey' === $query->get( 'orderby') ) {
        $query->set( 'orderby', 'meta_value' );
        $query->set( 'meta_key', 'yourFieldKey' );



Smooth Scroll to Anchor

Add the class “scrollto” to the you <a> tag and add the following to your javascript.

// Smooth Scroll
$(document).on('click', 'a', function(event){
    if ( $( this ).hasClass( "scrollto" ) ) {
        $('html, body').animate({
            scrollTop: $($.attr(this, 'href')).offset().top
        }, 500);

Example link

<a href="#content" class="scrollto">My Link</a>


Web Development

Custom posts per page on Archive and Search in WordPress

Add the following to Functions.php in your theme or child-theme amd alter the posts_per_page argument value.

 * Control the number of search results
function custom_posts_per_page( $query ) {
    if ( $query->is_archive() || $query->is_search() ) {
        set_query_var('posts_per_page', 12);
add_action( 'pre_get_posts', 'custom_posts_per_page' );


Web Development

List all ports in use

netstat -lp

List all services using a specific port

netstat -lp | grep 3306


Web Development

Ignore contents of folder with .gitignore

In some cases you might want to keep a folder, but ignore the contents. For example, say we have the following folder structure:


to keep the “tmp” folder in the repo and keep it empty add the following .gitignore file inside the tmp folder:

# Ignore all files in this folder.

So essentially the new structure should be:


If you still have issues after adding this file, sometimes you need to clear your .git cache

Web Development

Clear .git cache

git rm -r --cached .
git add .
git commit -am 'git cache cleared'
git push origin master


Web Development

Redirect entire domain to HTTPS

Add the following to your .htaccess file

<IfModule mod_rewrite.c>
	RewriteEngine On

	RewriteCond %{SERVER_PORT} 80 
	RewriteRule ^(.*)$$1 [R,L]