Skip to content

Instantly share code, notes, and snippets.

View michaelfox's full-sized avatar
🦊

Michael Fox michaelfox

🦊
  • Kirschbaum Development Group
View GitHub Profile
@michaelfox
michaelfox / robots.txt
Created November 5, 2010 01:08
Boilerplate Robots.txt Template
# www.robotstxt.org/
# www.google.com/support/webmasters/bin/answer.py?hl=en&answer=156449
User-agent: *
Disallow: /admin
# Development
Disallow: /
# Allow: /
@michaelfox
michaelfox / quix-chrome-search.js
Created October 8, 2010 05:23
JavaScript to use Quix as a search engine in Google Chrome
javascript:Quix();function Quix()%7Bvar e=encodeURIComponent;var t=window.getSelection?window.getSelection():(document.getSelection?document.getSelection():(document.selection?document.selection.createRange().text:''));var c="%s";if(t!='')%7Bif(c)%7Bc+=' '+t}else%7Bc=''+t}}if(c)%7Bvar u='http://quixapp.com/go/?c='+e(c)+'&t='+(document.title?e(document.title):'')+'&s=http://github.com/michaelfox/Quix-Commands/raw/master/quix.txt'+'&v=080'+'&u='+(document.location?e(document.location):'');d=''+document.location;if(d.substr(0,4)!='http')%7Bwindow.location=u+'&mode=direct'}else%7Bheads=document.getElementsByTagName('head');if(c.substring(0,1)==' ')%7Bvar w=window.open(u+'&mode=direct');w.focus()}else if(heads.length==0)%7Bwindow.location=u+'&mode=direct'}else%7Bq=document.getElementById('quix');if(q)%7Bq.parentNode.removeChild(q)}sc=document.createElement('script');sc.src=u;sc.id='quix';sc.type='text/javascript';void(heads[0].appendChild(sc))}}}}
@michaelfox
michaelfox / chrome-shortcut-manager-settings.js
Created October 8, 2010 05:20
My settings for Chrome shortcut manager extension
// ==UserScript==
// @ShortcutManager
// @name Quix
// @namespace http://www.michaelfox.name
// @key Ctrl+q
// @include *
// ==/UserScript==
javascript:Quix();function%20Quix()%7Bvar%20e=encodeURIComponent;var%20t=window.getSelection?window.getSelection():(document.getSelection?document.getSelection():(document.selection?document.selection.createRange().text:''));var%20c=window.prompt('Quix:%20Type%20%60help%60%20for%20a%20list%20of%20commands:');if(t!='')%7Bif(c)%7Bc+='%20'+t;%7Delse%7Bc=''+t;%7D%7Dif(c)%7Bvar%20u='http://www.quixapp.com/go/?c='+e(c)+'&t='+(document.title?e(document.title):'')+'&s=https://dl.dropbox.com/s/jpc1gu600xunbs5/quix.txt'+'&v=081'+'&u='+(document.location?e(document.location):'');d=''+document.location;if(d.substr(0,4)!='http')%7Bwindow.location=u+'&mode=direct';%7Delse%7Bheads=document.getElementsByTagName('head');if(c.substring(0,1)=='%20')%7Bvar%20w=window.open(u+'&mode=direct');w.focus();%7Delse%20if(heads.length==0)%7Bwindow.location=u+'&mode=direct';%7Delse%7Bq=document.getEle
<?php
/**
* generate a subhead with an anchor tag
*
* Usage:
* echo subhead("How it Actually Works");
* Prints:
* <h2 id="how-it-actually-works">How it Actually Works</h2>
*
* @param string $name