Skip to content

Instantly share code, notes, and snippets.


Jeff Behnke topdown

View GitHub Profile
topdown /
Created Mar 7, 2019 — forked from hgrimelid/
php: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.61.dylib

After upgrading to Node v.10.9.0 via Homebrew the following error message was thrown from PHP:

dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.61.dylib
  Referenced from: /usr/local/bin/php
  Reason: image not found

Reinstall PHP to fix, for me that's:

topdown / Git push deployment in 7 easy
Created Feb 22, 2017 — forked from thomasfr/Git push deployment in 7 easy
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook
View Git push deployment in 7 easy
topdown / WP_DEBUG.php
Created Jan 7, 2017
For public debugging logs to file in wp_content
View WP_DEBUG.php
//For public debugging logs to file in wp_content
//add the following to your wp-config.php by the bottom of the file where is says /* That's all, stop editing! Happy blogging. */
define('WP_DEBUG', true);
define('WP_DEBUG_DISPLAY', false);
define('WP_DEBUG_LOG', true);
define('SCRIPT_DEBUG', true);
define('JETPACK_DEV_DEBUG', true);
define( 'SAVEQUERIES', true );
topdown / contact-form-7-url-filter.php
Last active Dec 25, 2016
Using contact form 7 action url filter
View contact-form-7-url-filter.php
add_filter('wpcf7_form_action_url', 'wpcf7_custom_form_action_url');
function wpcf7_custom_form_action_url($url) {
global $post;
// Change the value of $id_to_change to the post id where the form is
$id_to_change = 1;
topdown / display-rewrites.php
Created Oct 25, 2016
For debugging WP rewrite rules
View display-rewrites.php
function jb_show_rewrite_rules() {
$rules = get_option('rewrite_rules');
$n = 0;
$html = '<table><tr><th style="width: 5%;">#</th><th style="width: 35%;">Key</th><th style="width: 60%;">Rule</th></tr>';
foreach ( $rules as $key => $value ) {
$html .= '<tr><td>' . ++$n . '</td><td>' . $key . '</td><td>' . $value . '</td></tr>';
} // end foreach
View disable-heartbeat.php
// Also available in a plugin
add_action( 'init', 'stop_heartbeat', 1 );
function stop_heartbeat() {
topdown /
Created Aug 5, 2016
This file is a custom provision script for VVV that skips all updates and update checks
# Customized by Jeff Behnke @topdown on GitHub
# This file is a custom provision script for VVV that skips all updates and update checks
# It only does the absolute tasks that I know are needed for vagrant up, vagrant reload, vagrant provision and vv create
# It currently runs vagrant provision tasks in roughly 8 secs.
# You should be using VV for creating sites, then replace its with this one once you have a working VVV system.
topdown / wp-bin-example.php
Last active Jul 10, 2016
Load WordPress hooks, filters and APIs in a bin file for processing forms and other data
View wp-bin-example.php
// Don't load theme data IE css and other features
define( 'WP_USE_THEMES', false );
* Loads the WordPress Environment and Template
* Change PATH_TO_WP to the path of the following file
require( 'PATH_TO_WP/wp-blog-header.php' );
topdown / cron.php
Last active Jul 1, 2016
Custom cron script for WP
View cron.php
// This code can go anywhere as long as its loaded by a plugin or theme
// setup the schedual
if ( ! wp_next_scheduled( 'my_task_hook' ) ) {
wp_schedule_event( time(), 'hourly', 'my_task_hook' );
add_action( 'my_task_hook', 'my_task_function' );
# Not saying this is a fix all, but this is what I had to do to get VVV running properly on my system.
# It failed to install properly do to script errors
# Branch master
# head 7f5411455573bba88d8ce232db957c62b11977f5
# VVV Update issues
vagrant ssh