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
addEventListener('load', function() { | |
var d = document, | |
contents = d.getElementById('main').getElementsByTagName('dl'), | |
menu = d.getElementById('message_board_menu').getElementsByTagName('li'), | |
now = 0; | |
function modifyTargetHTML(target) { | |
if(!contents[this.n].style.display === 'none') | |
return; | |
contents[now].style.display = 'none'; | |
contents[this.n].style.display = 'block'; |
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
javascript:function AutoCheckURL() { | |
var HostURL = new RegExp(location.hostname + "(\\:[0-9]+)?"), | |
CheckURL = document.links; | |
for(var i = 0; i < CheckURL.length; ++i) | |
if(!HostURL.test(CheckURL[i].href.split('/')[2])) | |
CheckURL[i].target = '_blank'; | |
} | |
AutoCheckURL(); |
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
javascript:(function(n, c) { | |
var c = c.sort(), | |
count = 0, | |
l = n / c[0] + 1; | |
if(c.length === 1) { | |
if(n % c[0] === 0) | |
return 1; | |
return 0; | |
} | |
for(var i = 0; i < l; ++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(str) { | |
for(var i = s = n = ""; i < str.length; ++i) | |
n = str.charCodeAt(i), | |
s += (n <= 64 || (n >= 91 && n <= 96) || n > 122) ? | |
str[i] : | |
String.fromCharCode((97 <= n && n < 110) || (65 <= n && n < 78) ? 13 : -13) + n | |
return s | |
})('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!') |
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
var hash = { 'a' : 'n' , 'b' : 'o' , 'c' : 'p' , 'd' : 'q' , 'e' : 'r' , | |
'f' : 's' , 'g' : 't' , 'h' : 'u' , 'i' : 'v' , 'j' : 'w' , 'k' : 'x' , 'l' : 'y' , | |
'm' : 'z' , 'n' : 'a' , 'o' : 'b' , 'p' : 'c' , 'q' : 'd' , 'r' : 'e' , 's' : 'f' , | |
't' : 'g' , 'u' : 'h' , 'v' : 'i' , 'w' : 'j' , 'x' : 'k' , 'y' : 'l' , 'z' : 'm' , | |
'A' : 'N' , 'B' : 'O' , 'C' : 'P' , 'D' : 'Q' , 'E' : 'R' , 'F' : 'S' , 'G' : 'T' , | |
'H' : 'U' , 'I' : 'V' , 'J' : 'W' , 'K' : 'X' , 'L' : 'Y' , 'M' : 'Z' , 'N' : 'A' , 'O' : 'B' , | |
'P' : 'C' , 'Q' : 'D' , 'R' : 'E' , 'S' : 'F' , 'T' : 'G' , 'U' : 'H' , 'V' : 'I' , 'W' : 'J' , | |
'X' : 'K' , 'Y' : 'L' , 'Z' : 'M' | |
} |
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
require 'Operator/lib/operator' | |
op = Operator::HTTP.new("http://factoryjoe.com/projects/emoticons/") | |
a = op.pick_attribute("img", "src") | |
a.each do | src | | |
h = src.to_s | |
em = Operator::HTTP.new(h) | |
File.open("emo/#{h[h.rindex("-") + 1..h.length]}", "w") { | f | f.write(em.read_all) } | |
em.close |
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
def fib(a, b) | |
return if b > 10000 | |
n = a + b | |
p "#{[:Fizz][n%3]}#{[:Buzz][n%5]}"[/.+/] || n | |
fib(b,n) | |
end | |
fib(0,1) |
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 () { | |
var styleSheets = document.styleSheets; | |
for (var i = 0; i < styleSheets.length; ++i) { | |
var styleSheet = styleSheets[i] | |
, path = styleSheet.href | |
, rules = styleSheet.rules || styleSheet.cssRules; | |
for (var j = 0; j < rules.length; ++j) { | |
var rule = rules[j]; |
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
var a = function () {}; | |
alert(a === a.prototype.constructor); //true | |
var b = new a(); | |
alert(b.constructor === a); //true |
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 a () {} | |
a.prototype = { foo : "b" }; | |
function b () {} | |
b.prototype = a.prototype; | |
var hoge = new b(); | |
for(var key in hoge); | |
alert(key); |