Skip to content

Instantly share code, notes, and snippets.

View todesking's full-sized avatar
💀

todesking todesking

💀
View GitHub Profile
@todesking
todesking / gist:381869
Created April 28, 2010 08:25
Contract for Java
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.Map;
@todesking
todesking / gist:382237
Created April 28, 2010 14:49
Register twitter's oauth info to Pit repo
#!/usr/bin/ruby
# this script based on http://d.hatena.ne.jp/shibason/20090802/1249204953
require 'rubygems'
require 'pit'
require 'oauth'
print 'Pit name: '
pit_name=gets.chomp.strip
@todesking
todesking / atnd_user_link.user.js
Created June 22, 2010 10:28
add external link to atnd user
@todesking
todesking / corpse.rb
Created July 2, 2010 15:11
「行旅死亡人データベース」のスクレイパ
require 'rubygems'
require 'uri'
require 'net/http'
require 'nokogiri'
class Corpse
def initialize(uri=URI.parse('http://theoria.s284.xrea.com/corpse/index.html'))
@uri=uri
@contents=nil
end
@todesking
todesking / redmine_add_100percent_done_button.user.js
Created July 6, 2010 11:49
Add 'Close as 100% done' button to Redmine
// ==UserScript==
// @name redmine_add_100percent_done_button
// @namespace http://d.hatena.ne.jp/gnarl/
// @include */issues/*
// ==/UserScript==
(function() {
// options
var SET_DUE_DATE_IF_EMPTY=true;
@todesking
todesking / redmine_set_default_values_on_new_ticket.user.js
Created July 6, 2010 12:33
Set default values on creating Redmine ticket
// ==UserScript==
// @name redmine_set_default_values_on_new_ticket
// @namespace http://d.hatena.ne.jp/gnarl/
// @include */issues/new*
// ==/UserScript==
(function() {
var SET_ASSIGNED_TO_IF_ONLY_ONE_USER=true;
var DEFAULT_TRACKER='2';
@todesking
todesking / gist:573510
Created September 10, 2010 11:57 — forked from sorah/gist:573131
1.upto(100){|i|puts i%3>0?i%5<1?:Buzz:i:i%5>0?:Fizz:'FizzBuzz'}
@todesking
todesking / vividvim.vim
Created September 27, 2010 12:56
More vivid, interactive vim
let s:color='#ff0000'
function! s:fire()
if s:color == '#ff0000'
let s:color = '#0000ff'
elseif s:color == '#0000ff'
let s:color = '#00ff00'
elseif s:color == '#00ff00'
let s:color = '#ff0000'
endif
@todesking
todesking / twit_update_list.rb
Created October 1, 2010 04:38
Twitのお気に入りIDタブの設定を公式リストと同期させる
# Twitのお気に入りIDタブをlistと同期させる
# 使用法
# - リストと同期したいお気に入りIDタブの名前を list:リスト名 にする
# - Twitを終了する
# - このファイルをTwitのインストールフォルダに置き、実行するとリストがTwitに反映される
# - Twitを再起動
#
# 依存gem: Pit,twitter
# Pitに、'ユーザ名@twitter'という名前で以下の項目を登録しとく必要がある(てきとうにがんばってください)
# - consumer_token
@todesking
todesking / excel.rb
Created October 6, 2010 13:53
Wrapper for Excel OLE object
require 'win32ole'
require 'kconv'
module Excel
class OLEWrapper
def initialize obj
@obj=obj
end
def raw_obj
@obj