Skip to content

Instantly share code, notes, and snippets.

View joelataylor's full-sized avatar

Joel Taylor joelataylor

View GitHub Profile
@joelataylor
joelataylor / fractions.php
Last active August 29, 2015 14:19
OAMM WordPress to Fraction Calculation
public function to_fraction($float) {
$whole = floor( $float );
$decimal = $float - $whole;
if ($decimal == 0) return $whole;
$valid_decimals = array(
'1/8' => 0.125,
'1/4' => 0.25,
'1/3' => 0.333,
@joelataylor
joelataylor / server-setup.md
Last active January 11, 2016 02:24
Server Setup Notes
@joelataylor
joelataylor / sever-setup.md
Last active August 29, 2015 14:25
Local Dev Setup

Install PHP 5.6 with OpenSSL (fixes Curl issue on Yosemite)

brew install --with-apache --with-homebrew-curl --with-homebrew-openssl --without-snmp php56

Now plugins: brew install php56-mcrypt php56-apcu php56-redis php56-memcached php56-xdebug

@joelataylor
joelataylor / git_techniques.md
Created September 2, 2015 19:23
Git/GitHub Tips
@joelataylor
joelataylor / featured_image.php
Created September 10, 2015 12:48
WP Require Featured Image on Post
Attribute Type Description
value string The IP address value
@joelataylor
joelataylor / commands.md
Last active February 9, 2019 13:03
Docker commands

Update WP domains

docker exec -it globalx_wordpress_1 /bin/bash wp --allow-root search-replace 'https://www.globalxfunds.com' 'http://globalxfunds.test:8888'

or run externally

docker exec globalx_wordpress_1 bash -c "wp --allow-root search-replace 'https://www.globalxfunds.com' 'http://globalxfunds.test:8888'"