This file contains hidden or 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
| #!/usr/bin/env ruby | |
| # 円周率の中から、日付とみなせる10桁の部分文字列を発見する | |
| # (http://d.hatena.ne.jp/hyuki/20090314#pi) | |
| # PI_STRは、円周率の小数第1位~500位を文字列で表したもの | |
| # from ftp://pi.super-computing.org/pub/pi10m/pi10m.ascii.01of10 | |
| PI_STR = ( | |
| "14159265358979323846264338327950288419716939937510"+ | |
| "58209749445923078164062862089986280348253421170679"+ |
This file contains hidden or 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
| // Twitterのページ中の「@koziro_P」をすべて「@こじろーきゅん」に置換 | |
| // 使い方:以下のコードをコピーし、ブラウザのアドレスバーに貼り付けてEnter | |
| javascript:(function(){document.body.innerHTML=document.body.innerHTML.replace(/>koziro_P?/g,'>こじろーきゅん')})(); | |
| // 3/24 0:45(JST)更新:「@koziro_P」のほか「@koziro_」も置換対象に追加。 |
This file contains hidden or 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/sh | |
| EDITOR=cat crontab -e 2>/dev/null |
This file contains hidden or 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/sh | |
| # Twitterクライアント P3:PeraPeraPrv | |
| # (http://sites.google.com/site/peraperaprv/)を | |
| # 最新版に更新する | |
| # | |
| # PeraPeraPrv.jarのあるディレクトリにこのファイルを置き、 | |
| # 最新版に更新したいときに実行する。 | |
| # Remove all old files and download P3 archive |
This file contains hidden or 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
| {てってってー言語 http://chiraura.hhiro.net/tettette/} | |
| {内容はこんなところです。} | |
| ー\d00006\d00012てー {0番目の値に6を、1番目の値に12をセットする。} | |
| {方針としては、4番目の値に最終的な結果を格納する。} | |
| てっててーてっててー {ポインタを0に戻す} | |
| てってっててー | |
| {足し算の回数カウントのため、0番目の値を1減らす} | |
| てっー |
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| # -*- coding: utf-8 -*- | |
| require 'rubygems' | |
| require 'open-uri' | |
| require 'json' | |
| require 'time' | |
| # @bombtterの忙しさ(爆発要求からかかった時間)を表示 | |
| def main |
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| # モンモールの問題 | |
| # http://blog.livedoor.jp/maraigue/archives/884785.html | |
| MAX = 20 | |
| # 順列を計算する | |
| class Integer | |
| def P(other) # a.P(b) と書くことで aPb を計算できるようにする |
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| # 与えられた文字列の先頭が "#" であるか判定 | |
| def comment?(str) | |
| str[0] == "#"[0] | |
| end |
This file contains hidden or 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
| #!/usr/bin/env ruby1.9 | |
| # -*- coding: utf-8 -*- | |
| # 要 Ruby1.9 | |
| class Yayoi | |
| def *(other); self; end | |
| def <(other); puts other; false; end | |
| end | |
| ζ = Yayoi.new |
This file contains hidden or 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 h,x,b; | |
| if(location.href.match(/^https?:\/\/(m\.|explore\.)?twitter\.com\/([0-9A-Z_a-z]+)\/status/)){ | |
| h="RT+@"+RegExp.$2+":+"; | |
| }else{ | |
| alert("Not in a tweet page!"); | |
| return; | |
| } | |
| x=(document.getElementsByTagName("body"))[0].innerHTML.match(/<span class="?entry-content"?>(.+?)<\/span>/ig); | |
| if(x && x.length==1){ |