Skip to content

Instantly share code, notes, and snippets.

View noahduncan's full-sized avatar

Noah Duncan noahduncan

  • MojoTech
  • Boulder, CO
  • 03:32 (UTC -06:00)
View GitHub Profile
@noahduncan
noahduncan / config_dev.yml
Last active December 13, 2017 15:13
Symfony2 Swiftmailer Config for Mailcatcher
swiftmailer:
transport: smtp
host: localhost
port: 1025
username: null
password: null
@noahduncan
noahduncan / getQueryParams.js
Created November 28, 2016 23:25
Get Query Params
function getQueryParams(qs) {
qs = qs.split('+').join(' ');
var params = {};
var tokens;
var re = /[?&]?([^=]+)=([^&]*)/g;
while (tokens = re.exec(qs)) {
params[decodeURIComponent(tokens[1])] = decodeURIComponent(tokens[2]);
}
@noahduncan
noahduncan / .bashrc
Last active January 18, 2017 19:56
Autoload Interactive PHP Shell
alias iphp="php -d auto_prepend_file=~/.phpinitscript.php -a"
@noahduncan
noahduncan / .bashrc
Last active April 17, 2018 14:47
Automatic cleanup of merged git branches
function gcleanup ()
{
# default to local cleanup
loc=true
OPTIND=1
while getopts "ahlr" opt; do
case "$opt" in
a) # delete both
rem=true;
@noahduncan
noahduncan / functions.php
Last active July 26, 2023 12:34
Automatically Sync ACF Fields on dev environments
<?php
/*
Plugin Name: Zing ACF Auto Sync
Plugin URI:
Description: Plugin that automatically syncs the database with local json for .test urls
Version: 20180419
Author: Noah Duncan <noah@zingstudios.com>
*/
/* Put in /wp-content/mu-plugins/zing-acf-auto-sync/zing-acf-auto-sync.php if you want as a plugin */