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
find . -type f -newer '[filename]' -print0 | xargs -0 -I {} cp {} [dirname] | |
# replace strings in a file without creating a backup. the -i parameter would create a backup if you so desired | |
sed -i '' 's/techliminal/localhost/g' [filename] | |
# find all the javascript files and list them | |
find . -name *.js -print | xargs ls -l | |
# change the owner of all the javascript files | |
# Looks like the sudo has to be on the xargs / chown part of the operation |
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
———————————————————————————————————————————————————————————————————————————————————————————————————— | |
BBEdit / BBEdit-Lite / TextWrangler Regular Expression Guide Modified: 2018/08/10 01:19 | |
———————————————————————————————————————————————————————————————————————————————————————————————————— | |
NOTES: | |
The PCRE engine (Perl Compatible Regular Expressions) is what BBEdit and TextWrangler use. | |
Items I'm unsure of are marked '# PCRE?'. The list while fairly comprehensive is not complete. |
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
# author: sdls | |
# source: http://wordpress.org/support/topic/p2p-admin-view-sort-by-drop-down#post-3446538 | |
function restrict_posts_by_relation() { | |
global $typenow; | |
$post_type = 'yourfirstposttype'; // change HERE | |
$related_post = 'yoursecondposttype'; // change HERE | |
$related_post_drop_down = 'related_'. $related_post. '_post'; | |
if ($typenow == $post_type) { |
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
default_run_options[:pty] = true # Must be set for the password prompt from git to work | |
# WebFaction user account | |
# This is the server user account | |
set :server_user, "<server_username>" | |
# Server Domain | |
set :domain, "<domain_name>" | |
set :user, server_user | |
# Repository 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
<?php | |
define( 'WP_TESTS_PATH', '<Enter the path to your unit-tests checkout>' ); | |
$GLOBALS['wp_tests_options'] = array( | |
'active_plugins' => array( '<plugindir/<plugin>.php' ), | |
); | |
require rtrim( WP_TESTS_PATH, DIRECTORY_SEPARATOR ) . DIRECTORY_SEPARATOR . 'bootstrap.php'; |
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 wptest() { | |
TESTROOT=/Users/nacin/Sites/tests | |
ARGS="--colors $@" | |
FORCE=0 | |
DEBUG=0 | |
REPLACE=$(echo $ARGS | sed -e 's/ -f\>//') | |
if [ "$ARGS" != "$REPLACE" ]; then | |
FORCE=1 | |
ARGS=$REPLACE |
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
// | |
// Make these columns sortable | |
// | |
function business_sortable_columns() { | |
return array( | |
'images' => 'images', | |
'title' => 'title', | |
"parking" => "parking" | |
); | |
} |
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 business_save_post($post_id, $post){ | |
// verify if this is an auto save routine. | |
// If it is our form has not been submitted, so we dont want to do anything | |
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) | |
return; | |
// verify this came from the our screen and with proper authorization, | |
// because save_post can be triggered at other times | |
if ( isset( $_POST[ 'business_noncename' ] ) && !wp_verify_nonce( $_POST['business_noncename'], plugin_basename( __FILE__ ) ) ) |
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 | |
/***** | |
All new versions will be posted at | |
https://github.com/rmccue/Rotor_WPPlugin | |
Please use that repository instead of this Gist. | |
******/ |
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 | |
/** | |
* Plugin Name: MMC Parks and Features | |
* Description: This plugin demonstrates how to route parent/child URLs like http://example.com/parks/yosemite/half-dome/in WordPress 3.3 | |
* Author: Mike Schinkel | |
* Author URL: http://about.me/mikeschinkel | |
* Notes: | |
* To answer http://lists.automattic.com/pipermail/wp-hackers/2011-November/041486.html | |
* Assumes a metabox that sets $post->post_parent field for a park feature with it's park's $post->ID. | |
* |
NewerOlder