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
#Where <ref> should be replaced with a branch name, tag name, or commit hash. | |
git ls-tree -rt <reference> | grep 'commit [0-9A-z]' |
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
<section class="span12"> | |
<section class="span8"> | |
<!-- VIDEO ARTICLE --> | |
<article class="content-container post span12"> | |
<section class="content-body clearfix"> | |
<div class="content-video"> | |
<!-- YOU HAVE TO INCLUDE PARAMETER 'wmode=opaque' OR VIDEO OVERLAPS SITE --> |
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
## | |
# Creates an alias called "git hist" that outputs a nicely formatted git log. | |
# Usage is just like "git log" | |
# Examples: | |
# git hist | |
# git hist -5 | |
# git hist <branch_name> | |
# git hist <tag_name> -10 | |
## | |
git config --global alias.hist "log --pretty=format:'%C(yellow)[%ad]%C(reset) %C(green)[%h]%C(reset) | %C(red)%s %C(bold red){{%an}}%C(reset) %C(blue)%d%C(reset)' --graph --date=short" |
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 | |
SYNC_BIN_PATH=`dirname $(readlink -f $0)` | |
TMP_PATH="$SYNC_BIN_PATH/tmp" | |
REPO_PLUGINS="$SYNC_BIN_PATH/uxwpress/plugins/*" | |
NEW_REPO_PLUGINS="$SYNC_BIN_PATH/plugins" | |
for i in $REPO_PLUGINS | |
do | |
CURRENT_PLUGIN_NAME=`basename "$i"` |
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 Unremove ## | |
# Adds an alias called "unrm" to retrieve a pile or path deleted at any point in the repositories history. | |
# Usage: | |
# git unrm [path] | |
# git unrm path/to/file | |
git config --global alias.unrm '!COMMIT=$(git log -1 --pretty=%h -- "$1"); git checkout $COMMIT^ -- "$1"; echo "File: $1, was restored from commit $COMMIT"; git show -s $COMMIT' |
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 | |
/** | |
* Allows WP_Query to use a 'since' argument to query for | |
* relative date queries. | |
* | |
* Usage: Query posts from last 30 days | |
* $query = new WP_Query('since' => '-30 days'); | |
* | |
* @uses strtotime() | |
* @author Eddie Moya |
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 /** NOTE: This is the example from the Codex, which think is BAD. **/ | |
// Create a new filtering function that will add our where clause to the query | |
function filter_where( $where = '' ) { | |
// posts in the last 30 days (hardcoded) | |
$where .= " AND post_date > '" . date('Y-m-d', strtotime('-30 days')) . "'"; | |
return $where; | |
} | |
//Requires immediate additiona and removal of the filter for intended use. |