Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* The Header template for our theme
*
* Displays all of the <head> section and everything up till <div id="main">
*
* @package WordPress
* @subpackage Twenty_Thirteen
* @since Twenty Thirteen 1.0
*/
@katzgrau
katzgrau / prebid.html
Last active August 18, 2017 15:49
Broadstreet + Prebid Example
<html>
<head>
<script src="//cdn.broadstreetads.com/init-2.min.js" async></script>
<script>window.broadstreet = window.broadstreet || { run: [] };</script>
<script>
// Load the Prebid Javascript Lib
(function () {
var d = document;
var pbs = d.createElement("script");
pbs.type = "text/javascript";
@katzgrau
katzgrau / gist:a9bf0616ab82eb24be09
Created February 28, 2015 17:04
Genesis Featured Post Widget - Infinite Scroll Hack
<?php
/* Special Streetfight Widget */
function infinite_register_widgets() {
register_widget('Infinite_Featured_Post');
}
add_action( 'widgets_init', 'infinite_register_widgets' );
/**
@katzgrau
katzgrau / Array search
Created February 9, 2014 20:27
PHP: Search an array of object for nested property values
@katzgrau
katzgrau / njtransit schedule bash alias
Created August 15, 2012 01:26
A bash alias for the njtransit schedule. NY Penn to Red Bank NJ, but easy to modify.
# Alias
alias njtransit="curl -s 'http://www.njtransit.com/sf/sf_servlet.srv?hdnPageAction=TrainSchedulesFrom' -X POST -d 'selOrigin=105_BNTN&selDestination=130_NJCL&datepicker=`date '+%m%%2F%d%%2F%Y'`&OriginDescription=New+York+Penn+Station&DestDescription=Red+Bank' | grep -oP '\d?\d:\d\d( [A|P]M)?' | awk '{ if(NR % 2 == 1) printf \"%s %s\", \$0, \" / \"; else print \$0 }'"
# Output (latest schedule)
# Departure / Arrival
$ njtransit
04:30 AM / 05:46 AM
05:32 AM / 06:55 AM
@katzgrau
katzgrau / install-chip
Created April 25, 2011 14:44
Install the `chip` command line utility at https://github.com/katzgrau/chip
print "Installing chip to /usr/local/bin .. \n";
print "Downloading ..\n";
print `curl https://raw.github.com/katzgrau/chip/master/chip > /tmp/chip`;
print "chmod-ing to 755 ..\n";
print `chmod 755 /tmp/chip`;
print "Moving to /usr/local/bin ..\n";
print `mv /tmp/chip /usr/local/bin/`;
print "chip installed! Try chip --help\n";
@katzgrau
katzgrau / install-stalk
Created April 25, 2011 14:28
Install the `stalk` command line utility at https://github.com/katzgrau/stalk
print "Installing stalk to /usr/local/bin .. \n";
print "Downloading ..\n";
print `curl https://github.com/katzgrau/stalk/raw/master/stalk > /tmp/stalk`;
print "chmod-ing to 755 ..\n";
print `chmod 755 /tmp/stalk`;
print "Moving to /usr/local/bin ..\n";
print `mv /tmp/divvy /usr/local/bin/`;
print "stalk installed! Try stalk --help\n";
@katzgrau
katzgrau / install-divvy
Created March 30, 2011 19:42
Install the `divvy` command line utility at https://github.com/katzgrau/divvy
print "Installing divvy to /usr/local/bin .. \n";
print "Downloading ..\n";
print `curl https://github.com/katzgrau/divvy/raw/master/divvy > /tmp/divvy`;
print "chmod-ing to 755 ..\n";
print `chmod 755 /tmp/divvy`;
print "Moving to /usr/local/bin ..\n";
print `mv /tmp/divvy /usr/local/bin/`;
print "Divvy Installed! Try divvy --help\n";