Skip to content

Instantly share code, notes, and snippets.

🤠

Joey Blake joeyblake

🤠
Block or report user

Report or block joeyblake

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am joeyblake on github.
  • I am joeyblake (https://keybase.io/joeyblake) on keybase.
  • I have a public key whose fingerprint is DE24 0AE3 4CCD 38A5 2BF6 CF41 96F2 ADE8 0680 4686

To claim this, I am signing this object:

@joeyblake
joeyblake / .gitignore
Created Oct 10, 2017 — forked from salcode/.gitignore
See https://salferrarello.com/wordpress-gitignore/ for the latest version of my WordPress .gitignore file
View .gitignore
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore
@joeyblake
joeyblake / r-debug.php
Created May 17, 2017 — forked from Rarst/r-debug.php
R Debug (set of dump helpers for debug)
View r-debug.php
<?php
/*
Plugin Name: R Debug
Description: Set of dump helpers for debug.
Author: Andrey "Rarst" Savchenko
Author URI: http://www.rarst.net/
License: MIT
*/
/**
View grids-with-array-chunk.php
//row markup
$row = '<div class="row-fluid">%s</div>'
//$posts = whatever you are trying to put in a grid.
$span_divs = array();
foreach ( $posts as $post ) {
//make a span box
$span_divs[] = sprintf( "<div class="span4">%s</div>" , $post);
}
//chunk the array of grid items into a number if items
View gist:775fdf6db9aa6f452698
git submodule update --init --recursive
View osx-for-hackers.sh
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
@joeyblake
joeyblake / gist:519673dec628784f689e
Created Feb 20, 2015
Mapping Multiple authors on a WordPress data import browser snippet
View gist:519673dec628784f689e
jQuery('select[name*="user_map"]').each(function(idx, el){
var $select = jQuery(el),
$parent = jQuery(el).parent().parent(),
$strong = $parent.find('strong'),
name = $strong.text().split(' (')[0].trim(),
val = $select.find('option').filter(function () { return jQuery(this).html() == name; }).val();
if ( val !== undefined ) {
$select.val(val);
} else {
@joeyblake
joeyblake / gist:2f7264d3070d51732fa8
Created Nov 1, 2014
SharePress replace open graph meta data filter
View gist:2f7264d3070d51732fa8
//Add this to your theme's functions.php file
//Modify the function to add the custom field value you are looking for
add_filter('sharepress_og_tags', 'my_sharepress_og_tags');
function my_sharepress_og_tags( $og ) {
global $post;
$stripped_quotes = str_replace( '"', '', $og['og:title'] );
$og = array_merge($og, array(
'og:title' => $strip_quotes
@joeyblake
joeyblake / gist:11402110
Created Apr 29, 2014
Redirect all subdomains to main domain: ExpressJS/Ghost
View gist:11402110
/*
* redirect all subdomains example
* example domain name testsite.com
*/
// split the incoming host to get the first element
var incoming = req.headers.host.split('.')[0];
// check if it matches your domain
if ( incoming !== 'testsite' ) {
@joeyblake
joeyblake / gist:9622208
Created Mar 18, 2014
Customizing SharePress og:meta tags with custom fields
View gist:9622208
//Add this to your theme's functions.php file
//Modify the function to add the custom field value you are looking for
add_filter('sharepress_og_tags', 'my_sharepress_og_tags');
function my_sharepress_og_tags( $og ) {
global $post;
$custom_value = get_post_meta($post->ID, 'your custom field name', true);
$og = array_merge($og, array(
'og:title' => $og['og:title'] . " " . $custom_value
You can’t perform that action at this time.