Skip to content

Instantly share code, notes, and snippets.

// NSDictionaryをループする
NSDictionary *dict =
[NSDictionary dictionaryWithObjectsAndKeys:
@"futaba", @"name", [NSNumber numberWithInt:4], @"age",
@"white", @"color", nil];
for (id key in dict) {
NSLog(@"key: %@, value: %@\n",
key,
[dict objectForKey:key]);
}
// via http://github.com/hatena/hatena-bookmark-xul/blob/master/chrome/content/common/05-HTMLDocumentCreator.js
function createDocumentFromString(source){
var doc;
try {
doc = document.cloneNode(false);
doc.appendChild(doc.importNode(document.documentElement, false));
} catch(e) {
doc = document.implementation.createHTMLDocument ?
document.implementation.createHTMLDocument('hogehoge') :
document.implementation.createDocument(null, 'html', null);
// ==UserScript==
// @name twitter.AutoPager
// @namespace http://ss-o.net/
// @version 0.1
// @include http://twitter.com/*
// @include https://twitter.com/*
// ==/UserScript==
(function autopager(unsafeWindow,loaded){
if (!loaded && window.opera && document.readyState == 'interactive') {