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
// ==UserScript== | |
// @name favlevel | |
// @namespace http://www.hatena.ne.jp/hitode909/ | |
// @description show favotter level | |
// @include http://twitter.com/* | |
// @include https://twitter.com/* | |
// @require http://code.jquery.com/jquery-1.3.2.min.js | |
// ==/UserScript== | |
(function() { |
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
import scala.collection.mutable.HashMap | |
import java.lang.Math | |
class Vector(var x:Int, var y:Int) { | |
override def toString = { | |
"("+ x + "," + y + ")" | |
} | |
override def equals(that: Any): Boolean = | |
that.isInstanceOf[Vector] && { |
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
# -*- coding: utf-8 -*- | |
def getnewline(line, rule) | |
(0..(line.size-1)).map { |i| | |
rule[line[i-1..i+1].join.to_i(2)] # 端がおかしくなりそう | |
} | |
end | |
token = ARGV.first.to_i || raise | |
rule = (0..7).map{|i| token[i]} |
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
// ==UserScript== | |
// @name count div | |
// @namespace http://www.hatena.ne.jp/hitode909/ | |
// @description count div | |
// @include * | |
// @require http://code.jquery.com/jquery-latest.js | |
// ==/UserScript== | |
(function(){ | |
console.log($('div').length); |
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
// ==UserScript== | |
// @name useful | |
// @namespace http://www.hatena.ne.jp/hitode909/ | |
// @description useful | |
// @include http://twitter.com/* | |
// @require http://code.jquery.com/jquery-latest.js | |
// ==/UserScript== | |
(function(){ | |
GM_registerMenuCommand('useful - clear cache', function () { |
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
<html> | |
<head> | |
<script type="text/javascript"> | |
Painter = { | |
draw: function(to) { | |
for(var x=0; x<16; x++) { | |
for(var y=0; y<16; y++) { | |
this.plot([x,y], this.color()); | |
} | |
} |
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
diff -rc uim-1.5.6_original/fep/uim-fep.c uim-1.5.6/fep/uim-fep.c | |
*** uim-1.5.6_original/fep/uim-fep.c 2009-08-09 18:00:46.000000000 +0900 | |
--- uim-1.5.6/fep/uim-fep.c 2009-08-09 19:12:26.000000000 +0900 | |
*************** | |
*** 382,388 **** | |
} | |
if (gnu_screen) { | |
! g_opt.status_type = BACKTICK; | |
s_master = PROC_FILENO; |
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 "webrick" | |
require "inline" | |
require "ruby-growl" | |
class Numeric | |
def near?(with) | |
(self - with).abs < 10 | |
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
# color setting | |
def find_color(s) | |
return 0 unless defined? Termtter::Client::get_group_of | |
groups = Termtter::Client::get_group_of s.user.screen_name | |
if groups.include? :me | |
3 | |
elsif config.plugins.keyword.keywords.find{|k| k === s.text } | |
31 | |
elsif groups.size > 0 | |
35 |
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
require 'sinatra' | |
# tiny counter bot | |
$count = 0 | |
get '/' do | |
$count+=1 | |
puts $count | |
$count.to_s | |
end |