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'); |
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 | |
//dis like the best code ever | |
function register() | |
{ | |
if (!empty($_POST)) { | |
$msg = ''; | |
if ($_POST['user_name']) { | |
if ($_POST['user_password_new']) { |
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: Global Post Exclusion | |
* Description: Uses global variables to store post IDs and remove them from other queries. | |
*/ | |
/** | |
* Filters queries on pre_get_posts to exclude posts that are excluded. | |
* | |
* @param object $query current WP Query |
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 | |
// Filter is in wpforms/src/Forms/Token.php - get_valid_tokens(); | |
// Create our array of times to check before today. A user with a longer | |
// cache time can extend this. A user with a shorter cache time can remove times. | |
$valid_token_times_before = apply_filters( | |
'wpforms_form_token_check_before_today', | |
[ | |
( 2 * DAY_IN_SECONDS ), // Two days ago. |
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
#!/usr/bin/env zsh | |
#local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" | |
setopt promptsubst | |
autoload -U add-zsh-hook | |
PROMPT_SUCCESS_COLOR=$FG[117] | |
PROMPT_FAILURE_COLOR=$FG[124] | |
PROMPT_VCS_INFO_COLOR=$FG[242] |
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
#Get the size of each table, ordered by largest to smallest | |
SELECT table_name AS "Tables", | |
round(((data_length + index_length) / 1024 / 1024), 2) "Size in MB" | |
FROM information_schema.TABLES | |
WHERE table_schema = "YOU+TABLE+NAME+HERE" | |
ORDER BY (data_length + index_length) DESC; | |
#Get the size of the entire DB | |
SELECT table_schema "DB Name", | |
Round(Sum(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB" |