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 replace_nbsp_in_posts() { | |
global $wpdb; | |
$query = " | |
UPDATE {$wpdb->posts} | |
SET post_content = REPLACE(post_content, CHAR(160), ' ') | |
WHERE post_content LIKE '%" . chr(160) . "%' | |
"; |
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
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /index.php [L] |
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: WDS JetPack Popular Posts | |
Plugin URI: http://www.webdevstudios.com | |
Description: Query for popular posts by views using JetPack by Automattic. | |
Version: 1.0 | |
Author: WebDevStudios | |
Author URI: http://www.webdevstudios.com | |
License: GPLv2 | |
Text Domain: wds-popular-posts |
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: Enhance Insurance - Taxonomy Term In Permalink | |
Plugin URI: http://www.webdevstudios.com | |
Description: Add CPT taxonomy terms to permalink | |
Version: 1.0.0 | |
Author: WebDevStudios | |
Author URI: http://www.webdevstudios.com | |
License: GPLv2 |
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
/* | |
Nothing special here. My car still has a CD player, I make mix cds to listen to when driving places. Felt like copying down the tracklist of each one for my fake band "Achoo and the Sneezes". Because I'm a nerd, I jsonified the lists. | |
*/ | |
{"albums":[{ | |
"album": "33 1/3 Monkeys Without Creativity is Deprivation", | |
"tracks":[ | |
"James - Out To Get You", | |
"Pigeonhed - Fire's Coming Down", | |
"Oingo Boingo - Stay", | |
"Smashing Pumpkins - 1979", |
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
color_classes = ['green','purple','violet','teal','pink']; | |
(function() { | |
const initLinks = function() { | |
const div = document.querySelector('#mydiv'); | |
console.log(div) | |
div.addEventListener('mouseover',function(){ | |
color_classes.forEach(color =>{ | |
div.classList.remove(color); | |
}); | |
div.classList.add(randomFrom(color_classes)); |
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
//$sec_header is supposed to be $gistgit | |
$gistgit = wp_remote_retrieve_body( wp_remote_get('https://api.github.com/users/'. $user .'/gists', array('timeout' => 10))); | |
if( is_wp_error($gistgit)) { | |
$error_string = $sec_header->get_error_message(); | |
echo '<div id="message" class="error"><p>' . $error_string . '</p></div>'; | |
wp_die(''); | |
} |
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 //RIP Randall Mario Poffo | |
function macho_man_randy_savage() { | |
static $elbow_drops = 3; | |
if(!$elbow_drops) return 'oooooooooooooooohhhhhhhhhhhhhhhh yeeeeeeeeeeeeeeeeaaaaaaaahhhhhh'; | |
$elbow_drops--; | |
} | |
//will show phrase on 4th call and every call after. | |
echo macho_man_randy_savage(); |