Skip to content

Instantly share code, notes, and snippets.

View ambercouch's full-sized avatar

Richard Arnold ambercouch

View GitHub Profile
sudo chown -R bitnami:daemon public
sudo find public -type d -exec chmod 775 {} \;
sudo find public -type f -exec chmod 664 {} \;
sudo chmod 640 public/wp-config.php
cp -a /source/. /dest/
@ambercouch
ambercouch / axio-snippet.js
Last active February 18, 2020 12:21
Fix Shopify slate and browsersync issue and axio issue
return axios('https://v.shopify.com/slate/track', axiosConfig).catch(() => {});
@ambercouch
ambercouch / WP-define-site
Last active February 2, 2020 04:48
Define your site url in wp-config.php
/**
* When developing locally define these constants in your wp-config.php instead to your database.
* This saves time when moving your database.
*/
if (!defined('WP_SITEURL')) {
define('WP_SITEURL', 'http://' . $_SERVER['SERVER_NAME']);
}
if (!defined('WP_HOME')) {
define('WP_HOME', 'http://' . $_SERVER['SERVER_NAME']);
@ambercouch
ambercouch / bbd-geo-ip.html
Created October 28, 2019 09:13
BBD Geo ip
<script type="text/javascript">
$(document).ready(function(){
$('a[href^="#"]').on('click',function (e) {
e.preventDefault();
var target = this.hash;
var $target = $(target);
$('html, body').stop().animate({
'scrollTop': $target.offset().top
}, 900, 'swing', function () {
window.location.hash = target;
@ambercouch
ambercouch / gist:6dfa83826724aa76006373b859574d3a
Last active September 26, 2019 11:52
Install Composer On Webfaction
ln -s `which php72` ~/bin/php
export PATH=$HOME/bin:$PATH
cd bin
curl -sS https://getcomposer.org/installer | php72
echo -e "\n# Composer\nalias composer=\"php72 \$HOME/bin/composer.phar\"" >> $HOME/.bash_profile
source $HOME/.bash_profile
@ambercouch
ambercouch / conditional.php
Last active May 22, 2019 10:33
Wordpress widget logic contidional code to use in widgets
<?php
//Paste the code below into the widget logic field of you widget and edit the page IDs as needed
//The code below will display your widget on pages 8,9 and 10 and any page that is a child of page 8
global $post; return (is_page(array(8,9,10)) || in_array($post->post_parent, array(8)));
//The code below will display you widget on pages that us the faq-page.php template file
global $post; return (get_page_template_slug( $post->ID ) == 'page-templates/faq-page.php');
@ambercouch
ambercouch / track-tel-mailto.js
Last active October 8, 2018 16:29
Track tel: and mailto: click with Google Analytics and jQuery
jQuery(document).ready(function(){
//set up the vars
var eCat = 'contact',
eAct = '',
eLabel = window.location.pathname;
//target href attributes that begin tel:
jQuery(document).on('click','[href^="tel:"]', function(e) {
@ambercouch
ambercouch / Increase phpMyAdmin upload limit
Last active September 18, 2018 15:08
phpMyAdmin on Scotchbox
vagrant ssh
sudo su
nano /etc/php/7.0/apache2/php.ini
#use the sort cut to find the setting 'memory_limit' and update
[ctrl]+[w]memory_li
memory_limit 1024M
#use the sort cut to find the setting 'post_max_size' and update
[ctrl]+[w]post_max
@ambercouch
ambercouch / php7-svg-xml-support.sh
Last active September 17, 2018 09:11
Add XML support to your server to fix the issues with Vagrant/Scotchbox and the WordPress SVG Support plugin
# ssh to your vagrant server (scotchbox)
vagrant ssh
# swich to super user account (administrator / root)
sudo su
# update apt-get
apt-get update
# install the latest version of xml support for php7
apt-get install php7.0-xml
# install the latest version of xml support for php7