Skip to content

Instantly share code, notes, and snippets.

View davidmh's full-sized avatar
🐧
I may be slow to respond.

David Mejorado davidmh

🐧
I may be slow to respond.
View GitHub Profile
@davidmh
davidmh / custom-post-type-archive-menu-links.php
Last active October 14, 2016 08:11 — forked from helgatheviking/custom-post-type-archive-menu-links.php
Adds Custom Post Type archives to the WordPress-powered menus. Compatible with WP 3.8
<?php
/*
Plugin Name: Custom Post Type Archive Menu Links
Plugin URI: http://codeseekah.com/2012/03/01/custom-post-type-archives-in-wordpress-menus-2/
Description: Easily Add Custom Post Type Archives to the Nav Menus
Version: 1.1
Author: soulseekah
Author URI: http://codeseekah.com
License: GPL2
@davidmh
davidmh / gist:6228319
Last active June 26, 2018 15:57
iTerm Tab & Window Titles with zsh and git. original: http://timbabwe.com/2012/05/iterm_tab_and_window_titles_with_zsh
function precmd() {
if command git rev-parse --git-dir > /dev/null 2>&1; then
window_label=$(git rev-parse --show-toplevel)
tab_label=$(echo $window_label | awk -F\/ '{print "[git] " $NF}')
else
window_label=${PWD/${HOME}/\~}
tab_label=$window_label
fi
echo -ne "\e]2;${window_label}\a"
echo -ne "\e]1;${tab_label: -24}\a"
@davidmh
davidmh / gist:5689418
Last active December 17, 2015 23:29
Fast Next/Prev Post Links for large databases. http://wordpress.stackexchange.com/q/101435/
<?php # -*- coding: utf-8 -*-
namespace WPSE;
/* Plugin Name: Fast Next/Prev Post Links
* Plugin URI: http://wordpress.stackexchange.com/q/101435/
*/
add_action(
'fast_prev_post_link',
__NAMESPACE__ . '\fast_prev_post_link',
10,