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
[STDOUT, STDERR].each do |io| | |
io.instance_eval do | |
def puts_with_format(*arg) | |
print "[#{Time.now.strftime("%Y-%m-%d %H:%M:%S")} ##{$$}] " | |
puts_without_format *arg | |
end | |
alias puts_without_format puts | |
alias puts puts_with_format | |
end | |
end |
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 "rubygems" | |
require "rest-client" | |
OFFSET = 700 | |
STEP = 100 | |
def exist?(url) | |
res = RestClient.head url | |
res.code == 200 | |
rescue |
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
set nocompatible " be iMproved | |
filetype off " required! | |
set rtp+=~/.vim/bundle/vundle/ | |
call vundle#rc() | |
" let Vundle manage Vundle | |
" required! | |
Bundle 'gmarik/vundle' |
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
<?xml version="1.0" encoding="utf-8" standalone="no"?> | |
<a:fontScheme name="mirakui" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"> | |
<a:majorFont> | |
<a:latin typeface="Stone Sans ITC TT"/> | |
<a:ea typeface=""/> | |
<a:cs typeface=""/> | |
<a:font script="Jpan" typeface="小塚ゴシック Pr6N H"/> | |
<a:font script="Hang" typeface="맑은 고딕"/> | |
<a:font script="Hans" typeface="宋体"/> | |
<a:font script="Hant" typeface="新細明體"/> |
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
{ | |
"name": "Chrome Keyconfig", | |
"version": "1.13.1", | |
"normal_actions": { | |
"j": { | |
"name": "scroll down", | |
"args": [] | |
}, | |
"k": { | |
"name": "scroll up", |
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
// ==UserScript== | |
// @name DMM Util | |
// @description DMM Utility | |
// @match http://www.dmm.co.jp/* | |
// ==/UserScript== | |
(function() { | |
function replaceImg(img) { | |
var src = img.src | |
img.onload = function(){ | |
img.width = img.naturalWidth; |
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 "rubygems" | |
require "benchmark" | |
require "imlib2" | |
N = (ARGV.shift || 1).to_i | |
def bench(title) | |
puts "\nBenchmark: #{title} (#{N} times)" | |
Benchmark.bm(7, ">total:", ">avg:") do |bm| |
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
# source: http://d.hatena.ne.jp/umezo/20100508/1273332857 | |
local COMMAND="" | |
local COMMAND_TIME="" | |
function precmd() { | |
if [ "$COMMAND_TIME" -ne "0" ] ; then | |
local d=`date +%s` | |
d=`expr $d - $COMMAND_TIME` | |
if [ "$d" -ge "5" ] ; then | |
COMMAND="$COMMAND " |
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
import sys | |
import re | |
import yaml | |
if len(sys.argv) != 2: | |
print 'Usage: python %s <mod_name>' % sys.argv[0] | |
quit() | |
mod_name = sys.argv[1] | |
mod = __import__(mod_name) |
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 'rubygems' | |
require 'net/imap' | |
require 'kconv' | |
require 'pit' | |
require 'logger' | |
class ImapFetcher | |
def initialize(pit_name) | |
@pit = Pit.get( |