Skip to content

Instantly share code, notes, and snippets.

View mcaskill's full-sized avatar
🥃

Chauncey McAskill mcaskill

🥃
View GitHub Profile
@mcaskill
mcaskill / varexport.php
Last active December 22, 2022 05:22 — forked from stemar/varexport.php
PHP var_export() with short array syntax (square brackets) indented 2 spaces.
<?php
/**
* PHP var_export() with short array syntax (square brackets) indented 2 spaces.
*
* @todo Fix edge case where if a string value has `=>\n[` it will get converted to `=> [`.
*
* @link https://www.php.net/manual/en/function.var-export.php
*
* @param mixed $expression
* @param bool $return
@mcaskill
mcaskill / sphp.sh
Last active September 22, 2022 02:33 — forked from rhukster/sphp.sh
Easy Brew PHP version switching
#!/bin/bash
# Creator: Phil Cook
# Modified: Andy Miller (2020-11-27)
# Modified: Chauncey McAskill (2022-09-21)
osx_major_version=$(sw_vers -productVersion | cut -d. -f1)
osx_minor_version=$(sw_vers -productVersion | cut -d. -f2)
osx_patch_version=$(sw_vers -productVersion | cut -d. -f3)
osx_patch_version=${osx_patch_version:-0}
osx_version=$((${osx_major_version} * 10000 + ${osx_minor_version} * 100 + ${osx_patch_version}))
@mcaskill
mcaskill / wp-ajax.php
Last active December 4, 2023 11:21 — forked from yllus/admin-ajax.php
WordPress : A drop-in replacement for admin-ajax.php that is optimized for visitor-only AJAX requests.
<?php
/**
* WordPress Ajax Process Execution
*
* This file is a near-identical copy of {@see wp-admin/admin-ajax.php} from WordPress v6.3.0.
*
* Differences:
* 1. Constant `WP_ADMIN` is set to FALSE, by default.
* 2. WordPress action 'admin_init' is replaced with custom action 'ajax_init'.
* 4. Custom actions hooked on 'admin_init' are not executed.
@mcaskill
mcaskill / wp-without-hooks.php
Last active January 18, 2019 17:09 — forked from westonruter/01-common-example.php
WordPress \ Hooks : Temporarily disable hooks while executing a given callback.
<?php
/**
* Call the callback with one or all handlers disabled for the given action or filter.
*
* Temporarily disables the specified hook, or all hooks, from a specified filter or action
* before calling $callback.
*
* @link https://gist.github.com/westonruter/6647252
*
@mcaskill
mcaskill / git-multi-status.md
Last active December 7, 2015 17:51 — forked from mzabriskie/README.md
View a summary of the status for multiple repositories.

Name

git-multi-status — View a summary of the status for multiple repositories.

Usage

git-multi-status [<options>…​] [--] [<path>…​]