Skip to content

Instantly share code, notes, and snippets.

View morganestes's full-sized avatar

Morgan Estes morganestes

View GitHub Profile
@wpsmith
wpsmith / clean-posts-comments.sql
Created February 15, 2014 21:59
SQL: Remove strange characters from posts and comments.
UPDATE wp_posts SET post_content = REPLACE(post_content, '“', '“');
UPDATE wp_posts SET post_content = REPLACE(post_content, '”', '”');
UPDATE wp_posts SET post_content = REPLACE(post_content, '’', '’');
UPDATE wp_posts SET post_content = REPLACE(post_content, '‘', '‘');
UPDATE wp_posts SET post_content = REPLACE(post_content, '—', '–');
UPDATE wp_posts SET post_content = REPLACE(post_content, '–', '—');
UPDATE wp_posts SET post_content = REPLACE(post_content, '•', '-');
UPDATE wp_posts SET post_content = REPLACE(post_content, '…', '…');
UPDATE wp_comments SET comment_content = REPLACE(comment_content, '“', '“');
@webaware
webaware / flxmap-no-rocketscript.php
Last active January 31, 2020 16:29
stop CloudFlare Rockscript messing up WP Flexible Map plugin!
<?php
/*
Plugin Name: Flxmap No Rocketscript
Plugin URI: https://gist.github.com/webaware/8949605
Description: stop CloudFlare Rockscript messing up the map plugin!
Version: 3
Author: WebAware
Author URI: http://webaware.com.au/
@ref: http://wordpress.org/support/topic/map-wont-appear
@beaugunderson
beaugunderson / Default (OSX).sublime-keymap
Created January 23, 2014 23:22
Sublime Text macros for converting to and from 2 and 4 space indentation
[
{
"keys": ["ctrl+2"],
"command": "run_macro_file",
"args": {
"file": "Packages/User/to-2.sublime-macro"
}
},
{
"keys": ["ctrl+4"],
@rxaviers
rxaviers / gist:7360908
Last active April 20, 2025 03:24
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
#!/bin/bash
# args
MSG=${1-'deploy from git'}
BRANCH=${2-'trunk'}
# paths
SRC_DIR=$(git rev-parse --show-toplevel)
DIR_NAME=$(basename $SRC_DIR)
DEST_DIR=~/Sites/wp-plugins/$DIR_NAME/$BRANCH
@justintadlock
justintadlock / register-post-type.php
Last active January 8, 2025 22:04
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 April 20, 2025 00:42
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