Skip to content

Instantly share code, notes, and snippets.

View morganestes's full-sized avatar

Morgan Estes morganestes

View GitHub Profile
@justintadlock
justintadlock / register-post-type.php
Last active August 3, 2026 18:55
Help file when registering post types.
<?php
# Register custom post types on the 'init' hook.
add_action( 'init', 'my_register_post_types' );
/**
* Registers post types needed by the plugin.
*
* @since 1.0.0
* @access public
@yyx990803
yyx990803 / nl.sh
Last active February 21, 2025 05:40
npm list only top level modules.
alias ng="npm list -g --depth=0 2>/dev/null"
alias nl="npm list --depth=0 2>/dev/null"
@jrfnl
jrfnl / wp-config-debug.php
Last active March 13, 2025 10:13
Code to add to wp-config.php to enhance information available for debugging.
<?php
/**
* == About this Gist ==
*
* Code to add to wp-config.php to enhance information available for debugging.
*
* You would typically add this code below the database, language and salt settings
*
* Oh.. and *do* make sure you change the path to the log file to a proper file path on your server (make sure it exists).
*
@willurd
willurd / web-servers.md
Last active August 22, 2026 05:03
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@Rayken
Rayken / wp-console-debug.php
Last active December 17, 2015 22:49
Debugging WordPress with the JavaScript Console
<?php
/**
* WordPress Console Debug
*
* Debug PHP using the JavaScript console.
* Enable this plugin and view your console for more information on how to use it.
*
* @package WP_console_debug
* @author DRSK
* @license WTFPL
@boogah
boogah / Favorite Alfred Workflows.md
Last active December 29, 2017 19:41
My Favorite Alfred Searches & Workflows
@boogah
boogah / euro_unicode_cruft_fix.sql
Last active December 10, 2015 22:58
A fix for European Unicode character weirdness. Other character fixes are available here: https://gist.github.com/1379880
update wp_posts set post_content = replace(post_content,'ä','ä');
update wp_posts set post_title = replace(post_title,'ä','ä');
update wp_comments set comment_content = replace(comment_content,'ä','ä');
update wp_postmeta set meta_value = replace(meta_value,'ä','ä');
update wp_posts set post_excerpt = replace(post_excerpt,'ä','ä');
update wp_terms set name = replace(name,'ä','ä');
update wp_posts set post_content = replace(post_content,'ö','ö');
update wp_posts set post_title = replace(post_title,'ö','ö');
update wp_comments set comment_content = replace(comment_content,'ö','ö');
@kasparsd
kasparsd / wordpress-plugin-svn-to-git.md
Last active June 2, 2025 17:14
Using Git with Subversion Mirroring for WordPress Plugin Development
@moklett
moklett / openconnect.md
Created July 24, 2012 15:21
OpenConnect VPN on Mac OS X

Unfortunately, the Cisco AnyConnect client for Mac conflicts with Pow. And by "conflicts", I mean it causes a grey-screen-of-death kernel panic anytime you connect to the VPN and Pow is installed.

As an alternative, there is OpenConnect, a command-line client for Cisco's AnyConnect SSL VPN.

Here's how to get it set up on Mac OS X:

  1. OpenConnect can be installed via homebrew:

     brew update
    

brew install openconnect

@kuyseng
kuyseng / gist:2792119
Created May 26, 2012 04:01
javascript: indesign get date string
function get_date_string(para_date) {
var date = para_date || new Date();
var day = (date.getDate() > 10 ) ? date.getDate() : ("0" + date.getDate() ),
month = ((date.getMonth()+1) > 10 ) ? (date.getMonth()+1) : ("0" + (date.getMonth()+1) ),
year = (date.getFullYear() > 10 ) ? date.getFullYear() : ("0" + date.getFullYear() ),
hours = (date.getHours() > 10 ) ? date.getHours() : ("0" + date.getHours() ),
minutes = (date.getMinutes() > 10 ) ? date.getMinutes() : ("0" + date.getMinutes() );
return year + month + day + "_" + hours + minutes;
};