This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
I've never been a fan of JavaScript frameworks. | |
These three functions are all I ever really need! | |
*/ | |
/* convenient DOM element lookup */ | |
function $(el){ | |
return document.getElementById(el); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// BTOverlayView.h | |
@interface BTOverlayView : NSView { | |
NSWindow *mainWindow; | |
NSPoint initialLocation; | |
NSTrackingArea *tArea; | |
BOOL frameChanged; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (var i = 0; i < 10; i++){ | |
elements[i].addEventListener('click', function(){ | |
alert(i); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function makeAlerter(x){ | |
return function(e){ | |
alert(x); | |
}; | |
} | |
for (var i = 0; i < 10; i++) | |
elements[i].addEventListener('click', makeAlerter(i)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for x in entrySelectors: | |
datetext = x.select('.//pubDate/text()').extract() | |
datetext = u'0000-00-00 00:00:00+00:00' if len(datetext)<1 else dateutil.parser.parse(datetext[0]) | |
templist = x.select('.//link["nytimes.com/"]/text()').extract() | |
if len(templist)>0 : | |
def cb(tx): | |
return lambda r: self.check_call(r, tx) | |
links.append(templist[0]) | |
#tx = str(copy.deepcopy(datetext)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
slides = [ | |
function(){ | |
spinner(spinnerContainer); | |
}, | |
function(){ | |
setOpacity("bootScreen", 1); | |
}, | |
function(){ | |
setOpacity("blah", 0); | |
setOpacity("blahblah", 0.5); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
slide(function(){ | |
spinner(spinnerContainer); | |
}); | |
slide(function(){ | |
setOpacity("bootScreen", 1); | |
}); | |
slide(function(){ | |
setOpacity("blah", 0); | |
setOpacity("blahblah", 0.5); | |
doSomethingElse("yaddayadda", 42); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Written on 04/20/10 by Carter Allen | |
# Copyright Opt-6 Products, LLC, 2010 | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma mark Actions | |
- (IBAction)callMyMom:(id)sender | |
{ | |
// Update the text view, disable the button | |
[textView insertText:@"Time to call Mom!\n"]; | |
[self disableButton:sender]; | |
// We're going to make an NSDictionary containing | |
// the button, so we can pass it to our timer | |
NSDictionary *userInfo = [NSDictionary dictionaryWithObject:sender forKey:@"button"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Put this in your .profile | |
# Now, the `ts` command will give you the UNIX timestamp | |
alias ts="date +%s" |