Skip to content

Instantly share code, notes, and snippets.

View theblanchard's full-sized avatar

John Blanchard theblanchard

View GitHub Profile
@theblanchard
theblanchard / index.rb
Last active December 16, 2015 01:49
A basic search using the YP API.
# This would be the main landing page - I don't know how to connect the dots though
require 'rubygems'
require 'sinatra'
get '/' do
erb :index
end
__END__
@theblanchard
theblanchard / keybase.md
Created March 31, 2014 04:24
Keybase.io Proof

Keybase proof

I hereby claim:

  • I am theblanchard on github.
  • I am theblanchard (https://keybase.io/theblanchard) on keybase.
  • I have a public key whose fingerprint is 1683 EDE2 4D13 E228 2BD2 950D 8FF1 C022 6ABA 83C1

To claim this, I am signing this object:

@theblanchard
theblanchard / blink.css
Created March 19, 2015 04:05
Make it blink!
@theblanchard
theblanchard / Contract Killer 3.md
Last active August 29, 2015 14:17
Contract Killer

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

@theblanchard
theblanchard / admob.js
Last active August 29, 2015 14:28
Ad Mob Banners In PhoneGap Apps
$("#contentPage").live("pagebeforehide", function() {
AdMob.hideBanner();
});
$("#contentPage").live("pageshow", function() {
initApp();
});
function initApp() {
if (AdMob) {
@theblanchard
theblanchard / index.md
Last active August 29, 2015 14:28
Task List in Markdown
  • Task One
  • Task Two
@theblanchard
theblanchard / is_child.php
Last active September 3, 2015 22:29 — forked from ericrasch/is_child.php
WordPress conditional function to check if a page is a parent/child/ancestor. In other words, if the page is within a tree of another page, show the code. Other code I've seen either only work with IDs, only check if it's a child, or detect all subpages (even outside of the direct tree).
/* =BEGIN: Check If Page Is Child
Source: http://bavotasan.com/2011/is_child-conditional-function-for-wordpress/
---------------------------------------------------------------------------------------------------- */
function is_child( $page_id_or_slug ) { // $page_id_or_slug = The ID of the page we're looking for pages underneath
global $post; // load details about this page
if ( !is_numeric( $page_id_or_slug ) ) { // Used this code to change a slug to an ID, but had to change is_int to is_numeric for it to work.
$page = get_page_by_path( $page_id_or_slug );
$page_id_or_slug = $page->ID;
}
@theblanchard
theblanchard / superfeedr.js
Created October 12, 2015 16:34
Superfeedr Shim for Google Feed API
/*
This is a shim that matches the Google Feed API into Superfeedr's feed API.
See blog.superfeedr.com/google-feed-api-alternative/ for details.
*/
window.google = {
feeds: {
Feed: {
@theblanchard
theblanchard / apple-mq.css
Created March 23, 2016 16:30 — forked from AllThingsSmitty/apple-mq.css
iPhone 6/6 Plus and Apple Watch CSS media queries
/* iPhone 6 landscape */
@media only screen and (min-device-width: 375px)
and (max-device-width: 667px)
and (orientation: landscape)
and (-webkit-min-device-pixel-ratio: 2)
{ }
/* iPhone 6 portrait */
@media only screen
and (min-device-width: 375px)
@theblanchard
theblanchard / style.css
Created August 5, 2016 19:39
Often used CSS margin and padding styles
/* Custom margin & padding styles */
.mr0 {
margin-right: 0 !important
}
.ml0 {
margin-left: 0 !important
}