Skip to content

Instantly share code, notes, and snippets.

@ngearing
ngearing / .htaccess
Last active February 1, 2018 01:09
Wordpress htacces for local dev
# Credits: https://stevegrunwell.com/blog/keeping-wordpress-under-version-control-with-git/
# ADD THIS IN YOUR UPLOADS DIRECTORY
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) http://{SITE_URL}/wp-content/uploads/$1
</IfModule>
@ngearing
ngearing / installvagrant
Last active June 8, 2017 00:43 — forked from rrgrs/installvagrant
installs brew, virtualbox, and vagrant in osx
if ! type "brew" > /dev/null; then
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
brew install git cask brew-cask-completion &&
brew cask install vagrant virtualbox &&
vagrant plugin install vagrant-berkshelf vagrant-hostmanager vagrant-hostsupdater vagrant-omnibus vagrant-share vagrant-vbguest;
@ngearing
ngearing / sips-web-optimise.sh
Last active December 14, 2020 00:40
sips resize and compress images quickly
#!/bin/bash
# cd into the directory with the images you want to resize then run this.
# install slugify with brew install slugify
mkdir resized
sips -Z 1920 -s formatOptions 65 -s format jpeg * --out resized/
slugify -acdtu resized/*
@ngearing
ngearing / acf-pro-db-update.php
Created March 9, 2017 03:28
ACF Pro update db script works on manageWP
<?php
include $_SERVER['DOCUMENT_ROOT'].'/wp-content/plugins/advanced-custom-fields-pro/acf.php';
include $_SERVER['DOCUMENT_ROOT'].'/wp-content/plugins/advanced-custom-fields-pro/admin/install.php';
$acf_admin = new acf_admin_install();
$updates = acf_get_db_updates();
$message = '';
@ngearing
ngearing / acf-pro-license-update.php
Created March 1, 2017 02:56
ACF Pro License update ManageWP
<?php
$pro_license = maybe_unserialize(base64_decode(get_option('acf_pro_license')));
if (!$pro_license || $pro_license['url'] != home_url()) {
$save = array(
'key' => 'license_here',
'url' => home_url()
);
$save = maybe_serialize(base64_encode($save));