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
// 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]); | |
} |
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
// 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); |
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
// ==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') { |