I hereby claim:
- I am kingkool68 on github.
- I am kingkool68 (https://keybase.io/kingkool68) on keybase.
- I have a public key whose fingerprint is 23B6 C578 8286 FD7B 9E83 4C10 3B56 93AA 987B D9BF
To claim this, I am signing this object:
<?php | |
/* | |
Plugin Name: Pew Scripts | |
Description: Scripts that are used on multiple sites can be registered and maintained in one place through this plugin. | |
Version: 1.2 | |
Author: Russell Heimlich | |
Author URI: http://www.russellheimlich.com | |
*/ | |
function pew_register_global_scripts() { |
function chris_coyiers_super_awesome_feed_image_magic( $content ) { | |
$doc = new DOMDocument(); | |
$doc->LoadHTML( $content ); | |
$images = $doc->getElementsByTagName('img'); | |
foreach ($images as $image) { | |
// Set the new attribute. | |
$image->setAttribute( 'style', 'max-width:480px;' ); | |
} | |
jQuery( document ).ready( function($) { | |
var csv = "data:text/csv;charset=utf-8,"; | |
var csvData = []; | |
$('#content .post').each(function() { | |
$this = $(this); | |
csvData.push( [this.href, $this.find('h2').text(), $this.find('.meta span:last-of-type').text() ] ); | |
}); | |
for( i=0; i < csvData.length; i++ ) { | |
var row = '"' + csvData[i].join('","') + '"'; |
I hereby claim:
To claim this, I am signing this object:
<?php | |
/* | |
* Base | |
* | |
*/ | |
// basic XFBML load into footer | |
function psc_fb_load_args() { | |
/* | |
global $sfc_comm_comments_form; |
<?php | |
/** | |
* Plugin Name: Only Certain Logins Allowed | |
* Description: Only let certain usernames do anything... | |
* Version: 1.0 | |
* Author: Russell Heimlich | |
* Author URI: https://twitter.com/kingkool68 | |
*/ | |
function only_certain_logins_allowed() { |
<?php | |
/* Short and sweet */ | |
define('WP_USE_THEMES', false); | |
require('./wp-blog-header.php'); | |
$url = 'https://api.uber.com/v1/estimates/price'; | |
$args = array( | |
/* | |
'headers' => array( | |
'Authorization' => $some_token_goes_here |
<?php | |
function api_footnotes( $content ) { | |
$post_id = get_the_ID(); | |
//Need to correct wpautop() which smart-quoteify's the " in the numoffset argument. | |
$content = preg_replace('/numoffset=”(\d+)″/i', 'numoffset="$1"', $content); | |
//Microsoft has some weird space characters that Mac/Unix systems don't have. What the next line does is replace the weird space characters with a real space character which makes the regex work... | |
$content = str_replace('[ref ', '[ref ', $content); | |
<?php | |
/** | |
* Helper conditionals to run code in certain environments. | |
*/ | |
if ( ! defined( 'RH_ENV' ) ) { | |
$hostname = $_SERVER['HTTP_HOST']; | |
if ( isset( $_SERVER['HTTP_X_FORWARDED_HOST'] ) && ! empty( $_SERVER['HTTP_X_FORWARDED_HOST'] ) ) { | |
$hostname = $_SERVER['HTTP_X_FORWARDED_HOST']; | |
} |