Skip to content

Instantly share code, notes, and snippets.

View bradp's full-sized avatar
🏖️
beach vibes

Brad Parbs bradp

🏖️
beach vibes
View GitHub Profile
@bradp
bradp / ugh.php
Created January 14, 2014 05:04
dont_do_this
<?php
//dis like the best code ever
function register()
{
if (!empty($_POST)) {
$msg = '';
if ($_POST['user_name']) {
if ($_POST['user_password_new']) {
@bradp
bradp / something.php
Created August 6, 2013 19:49
get_out_of_here_yoast_what_are_you_doing
<?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');
@bradp
bradp / untitled.html
Last active December 19, 2015 04:29
Inline-block Ul height example for J
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test</title>
<style>
ul{
display: inline-block;
height: inherit;
}
@bradp
bradp / remove-yoast-images.php
Created June 3, 2013 18:47
Removes Yoast SEO advertisment images in the WordPress dashboard
function wolf_admin_styles() {
echo '<style type="text/css">
a[href*="yoast.com"] img{ display: none; }
</style>';
}
add_action('admin_head', 'wolf_admin_styles');
@bradp
bradp / brad_bot.rb
Created March 29, 2013 22:17
brad_bot_make_circles
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
@bradp
bradp / brad_bot.rb
Created March 29, 2013 22:06
Rtanque First bot
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
@bradp
bradp / gist:4999343
Last active September 5, 2022 20:36
WordPress function to convert address to Lat/Long
<?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 );
@bradp
bradp / gist:4247352
Created December 9, 2012 22:50
Remove commit from Github.com
$ git reset --hard [sha of commit]
$ git push -f origin HEAD^:master
@bradp
bradp / themefile.php
Created October 24, 2012 18:07
Display WordPress Page by title
$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;
@bradp
bradp / mu-removeepanel.php
Created October 24, 2012 17:13
Hides the ePanel on any Elegant Themes, drop into mu-pluings in /wp-content/
<?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