Skip to content

Instantly share code, notes, and snippets.

@hitode909
hitode909 / favlevel.user.js
Created July 4, 2009 13:15
Twitterのタイムラインにふぁぼられ具合を表示するGreasemonkey
// ==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() {
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] && {
# -*- 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]}
// ==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);
// ==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 () {
<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());
}
}
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;
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require "webrick"
require "inline"
require "ruby-growl"
class Numeric
def near?(with)
(self - with).abs < 10
end
# 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
require 'sinatra'
# tiny counter bot
$count = 0
get '/' do
$count+=1
puts $count
$count.to_s
end