Skip to content

Instantly share code, notes, and snippets.

View gavinblair's full-sized avatar

Gavin Blair gavinblair

View GitHub Profile
@gavinblair
gavinblair / hello.go
Created August 23, 2012 11:10
Days until explode($pizza)->event[2]!
package explodepizza
import(
"fmt"
"net/http"
"time"
)
func init() {
http.HandleFunc("/", handler)
@gavinblair
gavinblair / formulas.txt
Created August 3, 2012 14:57
What time today will all these bugs be done?
=if(roundup(HOUR(GoogleClock())+1+G1)>24; "Another Day";if(roundup(HOUR(GoogleClock())+1+G1)>12; concatenate(roundup(HOUR(GoogleClock())+1+G1)-12;"pm"); concatenate(roundup(HOUR(GoogleClock())+1+G1);"am")))
G1
=sum(D:D)
D column contains the Estimated Time Remaining for each bug
@gavinblair
gavinblair / .htaccess
Created July 20, 2012 18:34
force download of pdf files
<FilesMatch "\.(pdf)$">
Header set Content-Type application/octet-stream
Header set Content-Disposition "attachment"
</filesMatch>
@gavinblair
gavinblair / .htaccess
Created July 20, 2012 18:29
don't cache these files
# we're using appcache to cache our stuff.
<filesMatch "\.(html|htm|js|css|jpg|png|appcache)$">
Header set Cache-Control "no-cache"
</filesMatch>
javascript:(function(){$('*').css({ "font-family": "Comic Sans MS", "color": "yellow", "text-transform": "uppercase" });})();
Chew your food, at least 25 times per bite.
@gavinblair
gavinblair / gist:2955973
Created June 19, 2012 19:12
Google Spreadsheets - today?
=IF(OR(NETWORKDAYS(A3,NOW())=1, NETWORKDAYS(A3,NOW())=0),"YES","NO")
@gavinblair
gavinblair / errors.php
Created May 4, 2012 20:05
Error Reporting: I'm always trying to remember how to do this
<?php
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
@gavinblair
gavinblair / script.js
Created April 30, 2012 15:47
disable scrolling
// left: 37, up: 38, right: 39, down: 40,
// spacebar: 32, pageup: 33, pagedown: 34, end: 35, home: 36
var keys = [37, 38, 39, 40];
function preventDefault(e) {
e = e || window.event;
if (e.preventDefault)
e.preventDefault();
e.returnValue = false;
}
@gavinblair
gavinblair / gist:2512556
Created April 27, 2012 20:12
Really simple programming project ideas
var ideas = [
"Calculator",
"To-Do List",
"Address Book",
"Nickname Generator",
"Text-Based RPG",
"Password Generator",
];