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 performance( $visible = false ) { | |
$stat = sprintf( '%d queries in %.3f seconds, using %.2fMB memory', | |
get_num_queries(), | |
timer_stop( 0, 3 ), | |
memory_get_peak_usage() / 1024 / 1024 | |
); |
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: Disable ePanel on Frontend | |
Description: Hides/removes the stupid Elegant Themes ePanel | |
Author: bradparbs | |
Author URI: http://bradparbs.com/ | |
*/ | |
function disable_epanel_on_frontpage(){ | |
?><style>#et-control-panel{ display: none !important; }</style><?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
$page = get_page_by_title( 'Home' ); | |
$post_id_home = get_post($page->ID); | |
$content = $post_id_home->post_content; | |
$content = apply_filters('the_content', $content); | |
$content = str_replace(']]>', ']]>', $content); | |
echo $content; |
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 reset --hard [sha of commit] | |
$ git push -f origin HEAD^:master |
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 brrad_geocode($street_address,$city,$state){ | |
$street_address = str_replace(" ", "+", $street_address); //google doesn't like spaces in urls, but who does? | |
$city = str_replace(" ", "+", $city); | |
$state = str_replace(" ", "+", $state); | |
$url = "http://maps.googleapis.com/maps/api/geocode/json?address=$street_address,+$city,+$state&sensor=false"; | |
$google_api_response = wp_remote_get( $url ); | |
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
class BradBot < RTanque::Bot::Brain | |
NAME = 'brad_bot' | |
include RTanque::Bot::BrainHelper | |
TURRET_FIRE_RANGE = RTanque::Heading::ONE_DEGREE * 5.0 | |
def tick! | |
## main logic goes here | |
# use self.sensors to detect things | |
# use self.command to control tank |
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
class BradBot < RTanque::Bot::Brain | |
NAME = 'brad_bot' | |
include RTanque::Bot::BrainHelper | |
TURRET_FIRE_RANGE = RTanque::Heading::ONE_DEGREE * 5.0 | |
def tick! | |
## main logic goes here | |
# use self.sensors to detect things | |
# use self.command to control tank |
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 wolf_admin_styles() { | |
echo '<style type="text/css"> | |
a[href*="yoast.com"] img{ display: none; } | |
</style>'; | |
} | |
add_action('admin_head', 'wolf_admin_styles'); |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Test</title> | |
<style> | |
ul{ | |
display: inline-block; | |
height: inherit; | |
} |
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 bo_get_out_of_here_yoast_what_are_you_doing() { | |
return 'low'; | |
} | |
add_filter( 'wpseo_metabox_prio', 'bo_get_out_of_here_yoast_what_are_you_doing'); |
OlderNewer