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 / Preferences.sublime-settings
Created April 24, 2014 23:23
Sublime 2 Settings
{
"alignment_chars":
[
"=",
":"
],
"alignment_space_chars":
[
"=",
":"
{
"folders":
[
{
"follow_symlinks": true,
"name": "my-theme",
"path": "htdocs/wp-content/themes/my-theme-name"
},
{
"follow_symlinks": true,
@bradp
bradp / instructions.txt
Created July 24, 2015 00:59
CSS 3 columns
1. Install Custom CSS plugin (http://plugins.wordpress.org/css)
2. Add this css:
#wp-realtime-sitemap-pages ul:first-child {
-webkit-column-count: 3;
-moz-column-count: 3;
column-count: 3;
}
@bradp
bradp / say
Last active September 17, 2015 14:41
say
voices=(
Agnes
Albert
Alex
Alice
Alva
Amelie
Anna
Bad
Bahh
@bradp
bradp / gist:2863967
Created June 3, 2012 15:53
WordPress Database Query Output Monitor
<?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
);
@bradp
bradp / gist:2e71455f9795fb2e6b2d
Last active October 6, 2015 11:27
Nginx + HHVM Configuration
# You may add here your
# server {
# ...
# }
# statements for each of your virtual hosts to this file
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
@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
@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 / 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 / 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