Skip to content

Instantly share code, notes, and snippets.

View michaelfox's full-sized avatar
🦊

Michael Fox michaelfox

🦊
  • Kirschbaum Development Group
View GitHub Profile
<?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
@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 / analytics-multiple-accounts-async.html
Created December 6, 2010 22:22
Google Analytics JavaScript Snippet for Multiple Accounts Using the Asynchronous Code
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-65432-1']);
_gaq.push(['_trackPageview']);
/**
* add a second GA Account
* @see http://code.google.com/apis/analytics/docs/gaJS/gaJSApi_gaq.html
@michaelfox
michaelfox / Custom.css
Created January 4, 2011 21:15
Google Chrome Custom User Stylesheet
/**
*
* ___ __ _
* / __|__ _ _ __ _ __ / _(_)_ _ ___
* | (__/ _` | ' \| '_ \ _| | '_/ -_)
* \___\__,_|_|_|_| .__/_| |_|_| \___|
* |_|
**/
/* Remove "Entered the room" -- "left the room" type messages */
body.chat table.chat #chat tr.timestamp_message + tr.timestamp_message,
@michaelfox
michaelfox / DOM Monster.js
Created March 5, 2011 15:54
A largely un-curated "dump" of JavaScript Bookmarklets
javascript:(function(){var%20script=document.createElement('script');script.src='http://mir.aculo.us/dom-monster/dommonster.js?'+Math.floor((+new Date)/(864e5));document.body.appendChild(script);})()
@michaelfox
michaelfox / gleebox.conf.json
Created September 1, 2011 22:09
My GleeBox Settings for Google Chrome (http://thegleebox.com)
{
"searchEngine": "http://www.google.com/search?q=",
"commandEngine": "quix",
"quixUrl": "https://dl.dropbox.com/s/jpc1gu600xunbs5/quix.txt",
"searchBookmarks": true,
"scrollingSpeed": "500",
"outsideScrolling": false,
"shortcutKey": "71",
"upScrollingKey": "87",
"downScrollingKey": "83",
@michaelfox
michaelfox / textmate_update_system_bundles.php
Created September 19, 2011 15:14
TextMate Update System Bundles (old)
#!/usr/bin/env php
<?php
$system_support_dir = '/Library/Application Support/TextMate';
$system_bundles_dir = $system_support_dir . "/Bundles";
$official_bundles = array(
"ActionScript" => "https://github.com/textmate/actionscript.tmbundle",
"Apache" => "https://github.com/textmate/apache.tmbundle",
"AppleScript" => "https://github.com/textmate/applescript.tmbundle",
@michaelfox
michaelfox / email-regex.md
Created June 14, 2012 20:49
HTML5 Email Regex Pattern

See html5.org/r/6884

/^[a-zA-Z0-9.!#$%&'*+-/=?\^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/
@michaelfox
michaelfox / brettquix.txt
Created June 28, 2012 13:43 — forked from ttscoff/brettquix.txt
Brett's Quix File
@Brett's searches
@Brett's custom searches
go https://duckduckgo.com/?q=%21%20%s Open first result (DuckDuckGo)
b https://duckduckgo.com/?q=%21%s Bang search (DuckDuckGo)
grep https://www.cueup.com/?q=%s&fq=1 Greplin
ss https://duckduckgo.com/site:%d%20%s Current site (DuckDuckGo)
bt https://duckduckgo.com/site:brettterpstra.com%20%s BrettTerpstra.com (DuckDuckGo)
gh http://github.com/search?q=%s&type=Everything&repo=&langOverride=&start_value=1 Search GitHub (everything)
hints http://hints.macworld.com/search.php?query=%s&keyType=all&datestart=&dateend=&topic=0&type=stories&results=50&mode=search Search Mac OS X Hints
mu http://www.macupdate.com/find/mac/%s Search MacUpdate (Software)
@michaelfox
michaelfox / .htaccess
Created November 8, 2012 21:46
Force WWW
<IfModule mod_rewrite.c>
# Force www
RewriteEngine on
RewriteCond %{HTTPS} (on)?
RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
RewriteRule ^ http(?%1s)://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>