Skip to content

Instantly share code, notes, and snippets.

View richtaur's full-sized avatar
👁️
valadria.com

Matt Hackett richtaur

👁️
valadria.com
View GitHub Profile
@richtaur
richtaur / Jim's Crazy Javascript Code.html
Created September 19, 2011 06:26
JavaScript by my friend Jim back in 2001
<SCRIPT LANGUAGE="JavaScript">
<!--
//////////////// Rollover code //////////////////////
function MM_findObj(n, d) { //v3.0
var p,i,x;
if (!d) d = document;
if ((p = n.indexOf("?")) >0&&parent.frames.length) {
d = parent.frames[n.substring(p + 1)].document;
n = n.substring(0, p);
@richtaur
richtaur / November 5, 2006
Created September 18, 2011 21:26
TEAMOCIL.rtf
RT363
Matt Hackett
TEAMOCIL
MAN
Honey (coughing)! Honey, I think I'm dying.
WOMAN
@richtaur
richtaur / what the hell is this???
Created September 16, 2011 08:38
alfredo_pizza_crisps.js
{
"name": "Alfredo Pizza Crisps",
"ingredients": [{
"name": "mozzarella cheese",
"amount": 1,
"substitutes": null
}, {
"name": "fresh basil",
"amount": 1,
"substitutes": null
@richtaur
richtaur / array pattern.js
Created April 8, 2011 04:13
Iterates through an array with a reference to each property
var things = [
'a',
'b',
'c'
];
for (var i = 0, thing; thing = things[i]; ++i) {
console.log(i, thing);
}
@richtaur
richtaur / My Precious
Created April 2, 2011 17:58
My new MacBook <3
MBP 15.4/CTO
• PROCESSOR: 2.2GHz Quad-core Intel Core i7
• MEMORY: 8GB 1333MHz DDR3 SDRAM - 2x4GB
• HARD DRIVE: 256GB Solid State Drive
• OPTICAL DRIVE: 8x Double-Layer SuperDrive
• DISPLAY: 15"HR Antiglare WS Display
// BEFORE:
#import "WebViewExampleAppDelegate.h"
@implementation WebViewExampleAppDelegate
@synthesize window;
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// Insert code here to initialize your application
// BEFORE:
#import <Cocoa/Cocoa.h>
@interface WebViewExampleAppDelegate : NSObject <NSApplicationDelegate> {
NSWindow *window;
}
@property (assign) IBOutlet NSWindow *window;
@richtaur
richtaur / page_layout.html
Created February 23, 2011 00:19
quick HTML/CSS example
<style>
li {
border-bottom: 1px solid #fff;
}
li img {
float: left;
margin-right: 1em;
}
li strong {
display: block;
@richtaur
richtaur / detect_flash.js
Created February 16, 2011 18:25
Might detect flash, I think maybe perhaps.
if (navigator.plugins["Shockwave Flash"] === undefined) {
// No flash, could do like
location.href = "index_no_flash.html";
} else {
// Flash is a go!
}
@richtaur
richtaur / Audio.canPlayType.js
Created January 26, 2011 09:09
detect if Audio can play mp3
/*
Note: you could instead use "new Audio()" here,
but the client will throw an error if it doesn't support Audio,
which makes using "document.createElement" a safer approach.
*/
var audio = document.createElement('audio');
if (audio && audio.canPlayType) {
if (!audio.canPlayType('audio/mpeg;')) {
// Here you know you CANNOT use .mp3 files