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
# TAW Bash Profile | |
# @author: Travis A. Wagner | |
# @website: http://travisawagner.com | |
# -- BASE --# | |
# Set default blocksize for ls, df, du | |
# http://hints.macworld.com/comment.php?mode=view&cid=24491 | |
export BLOCKSIZE=1k |
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
<?php | |
/** | |
* Generate WordPress Pages | |
* @example: taw_generate_pages('page one', 'Page Two', 'page-three'); | |
*/ | |
function taw_generate_pages($names) { | |
if (!$names) { return false; } | |
$list = func_get_args(); | |
foreach ($list as $item) { |
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
language: node_js # use 'generic' if not compiling anything | |
node_js: | |
- "node" | |
cache: npm | |
env: | |
global: | |
- DEVELOPMENT_PATH="/full/path/to/dev/deployment/directory" | |
- PRODUCTION_PATH="/full/path/to/production/deployment/directory" | |
- SSH_USER="username" | |
- SSH_HOST="example.com" |
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
#!/usr/bin/env bash | |
# NOTE: this file needs to have write and execute permissions (chmod u+x ./deploy.sh) | |
set -e | |
DEV_PATH="/home/wpe-user/sites/corpmember3/wp-content" | |
PRO_PATH="/home/wpe-user/sites/corpmember/wp-content" | |
DEV_SSH="[email protected]" | |
PRO_SSH="[email protected]" | |
DEPLOY_IGNORE="./.deployignore" |
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_filter( 'wp_trim_excerpt', 'awesome_excerpt', 10, 2 ); | |
function awesome_excerpt($text, $raw_excerpt) { | |
if( ! $raw_excerpt ) { | |
$content = apply_filters( 'the_content', get_the_content() ); | |
$text = substr( $content, 0, strpos( $content, '</p>' ) + 4 ); | |
} | |
return $text; | |
} |
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
<?php | |
function parse_args( $args, $defaults = '' ) { | |
if ( is_object( $args ) ) { | |
$r = get_object_vars( $args ); | |
} elseif ( is_array( $args ) ) { | |
$r =& $args; | |
} else { | |
parse_str( $args, $r ); | |
} |
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
<?php | |
/** | |
* Class: Example Module | |
* | |
* @package projectname | |
* @subpackage modules | |
*/ | |
/** | |
* Example Module |
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
<?php | |
/** | |
* Add WordPress User | |
* | |
* @package taw | |
*/ | |
/** | |
* Add WordPress Admin User | |
*/ |
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
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done |
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
<?php | |
/** | |
* Automatically loads plugins in folders | |
* | |
* @package mu-plugin-autoloader | |
*/ | |
$dirs = array_filter( glob( WPMU_PLUGIN_DIR . '/*' ), 'is_dir' ); | |
foreach ( $dirs as $dirpath ) { | |
$regex = '/([^\/]+$)/'; |
OlderNewer