This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mamptowordpress { | |
dir=/Applications/MAMP/conf/apache | |
rm $dir/httpd.conf | |
ln -s $dir/httpd-wordpress.conf $dir/httpd.conf | |
stopMAMP | |
# startMAMP | |
echo "Happy Wordpress Developing!" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function cdtheme { | |
dir=${PWD##*/} | |
cd wp-content/themes/$dir | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('wp_head', 'show_template'); | |
function show_template() { | |
global $template; | |
print_r($template); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(window).resize(function(){ | |
waitForFinalEvent(function(){ | |
yourFunction(); | |
}, 500, "unique id"); | |
}); | |
/************************************** | |
*// Wait For It... | |
**************************************/ | |
var waitForFinalEvent = (function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************** | |
*// Dynamic Word Wrapping | |
**************************************/ | |
function wrapWords() { | |
var element = document.getElementById('element-id'); // grab entry-title element | |
if (element != null) { // make sure it is on this page | |
var string = element.innerHTML; // grab its contents | |
string = string.replace(/<(?:.|\n)*?>/gm, ''); // strip it of any html elements (i.e. a <br> from previous run through) | |
var array = string.split(" "); // break the string into an array of words | |
element.innerHTML = ""; // delete the element's contents |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#set -x | |
# Shows you the largest objects in your repo's pack file. | |
# Written for osx. | |
# | |
# @see https://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/ | |
# @author Antony Stubbs | |
# set the internal field spereator to line break, so that we can iterate easily over the verify-pack output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# bash completion for the `wp` command | |
_wp_complete() { | |
local cur=${COMP_WORDS[COMP_CWORD]} | |
IFS=$'\n'; # want to preserve spaces at the end | |
local opts="$(wp cli completions --line="$COMP_LINE" --point="$COMP_POINT")" | |
if [[ "$opts" =~ \<file\>\s* ]] | |
then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Grabs the current git branch for prompt | |
function current_git_branch { | |
BRANCH="$(git symbolic-ref HEAD 2>/dev/null | awk -F/ {'print $NF'})" | |
if [ "$BRANCH" == "" ] | |
then | |
echo "-" | |
else | |
echo "$BRANCH" | |
fi | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0 info it worked if it ends with ok | |
1 verbose cli [ 'node', | |
1 verbose cli '/usr/local/bin/npm', | |
1 verbose cli 'dist-tag', | |
1 verbose cli 'add', | |
1 verbose cli 'how-to-node@1.0.1', | |
1 verbose cli 'testing' ] | |
2 info using npm@2.11.2 | |
3 info using node@v0.12.2 | |
4 verbose dist-tag add testing to how-to-node@1.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
------------------------ | |
-- Hammerspoon Init -- | |
------------------------ | |
-- Global Variables | |
gutter = 20 | |
editor = "Atom" | |
-- Welcome Messages | |
hs.hotkey.bind({"cmd", "ctrl"}, "W", function() |
OlderNewer