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
$('.pds-input-label').on('click', function(){ | |
window["PD_prevote" + jQuery('.PDS_Poll') | |
.attr('id') | |
.substring(13)](this); | |
}); |
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
## ls -l on vagrant wp-content/plugins/ | |
drwxr-xr-x 1 www-data vagrant 238 Jan 4 05:49 debug-bar | |
drwxr-xr-x 1 www-data vagrant 238 Jan 4 05:49 debug-bar-cron | |
drwxr-xr-x 1 www-data vagrant 340 Jan 7 2013 debug-bar-extender | |
drwxr-xr-x 1 www-data vagrant 170 Jan 4 05:49 debug-bar-hook-explorer | |
drwxr-xr-x 1 www-data vagrant 442 Jan 4 05:49 developer | |
## ls -l on local wp-content/plugins/ | |
drwxr-xr-x 7 jeremyfelt staff 238 Jan 3 21:49 debug-bar | |
drwxr-xr-x 7 jeremyfelt staff 238 Jan 3 21:49 debug-bar-cron |
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
repo_to_repo() { | |
local DEVENV="/Users/jeremyfelt/Development/wordpress-main/wp-content/themes/vip/" | |
echo $DEVENV | |
rsync -rv --delete --exclude='.idea' --exclude='.svn' $DEVENV$1/* $DEVENV$2 | |
cd $DEVENV$2 | |
svn status | grep '^!' | awk '{print $2}' | xargs svn rm | |
svn status | grep '^?' | awk '{print $2}' | xargs svn add | |
} |
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
/** | |
* Stolen from http://thanpol.as/javascript/you-dont-need-dom-ready/ - Good read! | |
* / | |
// get the current time difference between page | |
// load and when this func was invoked | |
function getTimeDiff() { | |
return new Date().getTime() - performance.timing.navigationStart; | |
} | |
var $log, jqLoaded = false; |
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
import tweepy | |
from BeautifulSoup import BeautifulSoup as parser | |
import urllib | |
import sys | |
consumer_key='' | |
consumer_secret='' | |
access_token='' | |
access_token_secret='' |
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 | |
/** | |
* Post to a P2 from the command line (OSX at least) | |
* | |
* Easier with something like this in your .bash_profile: | |
* | |
* status_update() { | |
* php ~/Development/tools/status-update.php "$1" "$2" | |
* } |
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 | |
$xml_data = file_get_contents( 'test.xml' ); | |
$xml_parsed = simplexml_load_string( $xml_data, 'SimpleXMLElement', LIBXML_NOCDATA ); | |
foreach ( $xml_parsed->channel->item as $item ) { | |
echo $item->children('content', true)->encoded; | |
} |
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_filter( 'get_edit_post_link', 'jf_edit_post_link', 10, 2 ); | |
function jf_edit_post_link( $admin_url, $post_id ) { | |
$this_screen = get_current_screen(); | |
if ( 'dashboard' !== $this_screen->base ) | |
return $admin_url; | |
return get_permalink( $post_id ); |
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
-- Project Config File: | |
1) import_db: auto | automatically import database and symlink on vagrant up or project import command if DB does not yet exist | |
2) import_db: never | Never import database | |
3) import_db: always | Always import DB, even if it removes and then overwrites existing symlinked DB | |
# Primary vagrant directory includes the most common setup for your | |
# projects via Vagrantfile and provisioning. Any time a project is | |
# added to the "project" directory, it can be imported in with a | |
# project-import command in vagrant ssh. The Vagrantfile and provisioning | |
# in each project directory is ignored (see below scenario) |
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
1. Site files in www/mynewsite | |
2. SQL dump (if needed) in database/backups/database_name.sql | |
3. CREATE DATABASE and GRANT PRIVILEGES statements for new DB name in database/init-custom.sql | |
4. nginx config at /config/nginx-config/sites/my.site.name.conf | |
5. nginx config should have a unique server name and point to the www/mynewsite directory | |
6. vagrant reload | |
7. edit hosts file to point 192.168.50.4 to my.site.name |