Skip to content

Instantly share code, notes, and snippets.

View DevinWalker's full-sized avatar
🌱
Coding for good

Devin Walker DevinWalker

🌱
Coding for good
View GitHub Profile
@DevinWalker
DevinWalker / iterm2-solarized.md
Created January 7, 2022 22:57 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@DevinWalker
DevinWalker / resize_local_machine.sh
Created July 23, 2019 23:00 — forked from claygriffiths/resize_local_machine.sh
Resize Local by Flywheel VirtualBox image
# Steps we will take:
# 1. Change Local (Docker Machine) image type (this will take a bit)
# 2. Resize image
# 3. Resize partion
#
# Also see: https://docs.docker.com/articles/b2d_volume_resize/
# IMPORTANT: Make sure Local is not running!
VM_NAME="local-by-flywheel"
NEW_DISK_SIZE=50000
@DevinWalker
DevinWalker / wp-config.php
Created December 11, 2017 17:11 — forked from emgk/wp-config.php
WP Debug Configurations
define('WP_DEBUG', true);
define('SCRIPT_DEBUG',true);
if ( WP_DEBUG ) {
// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', true );
@ini_set( 'log_errors', 'On' );
@ini_set( 'display_errors', 'Off' );
@ini_set( 'error_reporting', E_ALL );
@ini_set( 'error_log', 'php_error.log' );
@DevinWalker
DevinWalker / setup-phpunit.sh
Created May 26, 2017 20:46 — forked from keesiemeijer/setup-phpunit.sh
Setup PHPUnit for use in the Local by Flywheel app
#!/usr/bin/env bash
# ===============================================================================
# Script to install PHPUnit in the Local by Flywheel Mac app
# These packages are installed
#
# PHPUnit, git, subversion, composer, curl and wget
#
# WordPress and the WP_UnitTestCase are installed in the /tmp directory
# The $WP_CORE_DIR and $WP_TESTS_DIR variables are added to the .bashrc file
@DevinWalker
DevinWalker / Beanstalk_to_GitHub
Created October 9, 2015 17:19
Move Git Repository from Beanstalk to GitHub with full repository history
#Example moving the DPSG Global Library
# 1 Checkout the Beanstalk Repo
git clone --bare git@codeandtheory.beanstalkapp.com:/dpsg-global-library.git
# 2 Push into your desired GitHub repo. (Please note that you must create the github repo prior to this step)
git push --mirror git@github.com:codeandtheory/dpsg-global-library.git

Simple Optin form example for WordPress

This is a simplified showcase of how you can easily build your own Optin form in WordPress.

It can connect to any API that supports cURL (most of them do). There is no error reporting implemented. It uses exit intent detection script called Ouibounce, which needs to be enqueued in your functions.php

<?php
/**
* start the customisation
*/
function custom_woo_before_shop_link() {
add_filter('woocommerce_loop_add_to_cart_link', 'custom_woo_loop_add_to_cart_link', 10, 3);
add_action('woocommerce_after_shop_loop', 'custom_woo_after_shop_loop');
}
add_action('woocommerce_before_shop_loop', 'custom_woo_before_shop_link');
@DevinWalker
DevinWalker / 0_reuse_code.js
Created December 23, 2013 07:03
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@DevinWalker
DevinWalker / functions.php
Last active May 13, 2017 16:11 — forked from dougedgington/functions.php
WooCommerce force SSL entire shop
<?php
/*
Author: Doug Edgington
Description: modified version of Woocomemrce SSL functionality, forces ssl on Woocommerce pages and two additional custom pages
*/
function dee_ssl_template_redirect() {
if ( ! is_ssl() ) {
if ( is_checkout() || is_account_page() || is_woocommerce() ) {
@DevinWalker
DevinWalker / .gitignore
Created September 25, 2012 01:51 — forked from redoPop/.gitignore
Template .gitignore file for WordPress projects
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your