A timeline of the last four years of detecting good old window.localStorage
.
October 2009: 5059daa
String.prototype.linkify_tweet = function() { | |
var tweet = this.replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig,"<a href='$1'>$1</a>"); | |
tweet = tweet.replace(/(^|\s)@(\w+)/g, "$1<a href=\"http://www.twitter.com/$2\">@$2</a>"); | |
return tweet.replace(/(^|\s)#(\w+)/g, "$1<a href=\"http://search.twitter.com/search?q=%23$2\">#$2</a>"); | |
}; |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Jed Schmidt <http://jed.is> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
#pragma mark - Transparent Modal View | |
-(void) presentTransparentModalViewController: (UIViewController *) aViewController | |
animated: (BOOL) isAnimated | |
withAlpha: (CGFloat) anAlpha{ | |
self.transparentModalViewController = aViewController; | |
UIView *view = aViewController.view; | |
view.opaque = NO; | |
view.alpha = anAlpha; |
#!/usr/bin/python | |
# Python program that can send out M-SEARCH messages using SSDP (in server | |
# mode), or listen for SSDP messages (in client mode). | |
import sys | |
from twisted.internet import reactor, task | |
from twisted.internet.protocol import DatagramProtocol | |
SSDP_ADDR = '239.255.255.250' |
/* | |
Compliant with Twitter's Developer Display Requirements: | |
https://dev.twitter.com/terms/display-requirements | |
*/ | |
var linkify_result = function (tweet /* tweet object from the results array */) { | |
var subs = [], | |
last_offset = 0, | |
new_tweet = '', | |
entity, | |
replace = { |
A timeline of the last four years of detecting good old window.localStorage
.
October 2009: 5059daa
Ever wonder what happens when you save a file in vim? There's quite a lot more
happening than open
, write
, and close
. I found this out while working on
some code to monitor changed files using the node.js fs.watch
API, which abstracts
(or obscures) Mac OS X's kqueue API.
To find out exactly what vim
is doing when saving a file, we'll use a tool
included with DTrace that reports on another process's system calls. We need
the process ID of vim, which is already open and editing my file: