Skip to content

Instantly share code, notes, and snippets.

View kakutani's full-sized avatar

Kakutani Shintaro kakutani

View GitHub Profile
@kakutani
kakutani / The_RubyKaigi_Rises_Trailer.srt
Created July 30, 2012 13:57
SRT subtitle file which makes "The_Dark_Night_Rises-Official Trailer3" to "The RubyKaigi Rises". ( http://www.universalsubtitles.org/en/videos/R12YYcKeuwFe/info/the-dark-knight-rises-official-trailer-3-hd/ )
1
00:00:15,029 --> 00:00:17,700
"お前ら"が来るわ
2
00:00:22,052 --> 00:00:24,800
楽しみにしてるようだね
3
00:00:27,049 --> 00:00:29,041
@kakutani
kakutani / affilication_count_sprk2012.md
Created June 9, 2012 05:36
Affiliation Count on Sapporo RubyKaigi 2012 Spakers

Affiliation Count on Sapporo RubyKaigi 2012 Spakers

(based on hand count by kakutani, they spelled their affiliation in inconsistent way. thanks to sprk2012 team for providing *.yml!)

Company-ish

  • 5: Eiwa System Management, Inc.
  • 4: COOKPAD Inc.
  • 3: Network Applied Communication Laboratory Ltd.
@kakutani
kakutani / gist:1381490
Created November 21, 2011 03:02
module_extended.rb
module M
def foo
puts "foo!"
end
end
class C
def eigen_class
class << self; self end
end
#!/usr/bin/env ruby
unless ARGV.size == 1
puts "specify screenname!"
exit 1
end
username = ARGV.shift
url = "http://api.twitter.com/1/users/profile_image/#{username}.json?size=bigger"
require 'open-uri'
img = open(url).read
@kakutani
kakutani / gist:1210976
Created September 12, 2011 10:29 — forked from jugyo/gist:756962
email_steps_ja.rb
# encoding: utf-8
# from: http://ukstudio.jp/2009/05/11/cucumber_email_spec_for_action_mailer/
Given /^(?:すべてのメールをクリアする|メールボックスが空になっている)$/ do
reset_mailer
end
# Use this step to open the most recently sent e-mail.
When /^メールを開く$/ do
@kakutani
kakutani / nesting.rb
Created August 15, 2011 12:31
nesting
module M
module Q
NESTING1 = Module.nesting
end
end
module M::Q
NESTING2 = Module.nesting
end
@kakutani
kakutani / wordbuf.c.patch
Created August 14, 2011 17:59
wordbuf.c
--- a/src/wordbuf.c 2011-08-15 02:57:05.000000000 +0900
+++ b/src/wordbuf.c 2011-08-15 02:57:17.000000000 +0900
@@ -9,6 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <limits.h>
#include "wordbuf.h"
#define WORDLEN_DEF 64
@kakutani
kakutani / gist:1133493
Created August 9, 2011 06:03
gem contents docdiff
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/docdiff-0.4.0/Makefile
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/docdiff-0.4.0/devutil/JIS0208.TXT
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/docdiff-0.4.0/devutil/char_by_charclass.rb
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/docdiff-0.4.0/devutil/charclass_by_char.rb
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/docdiff-0.4.0/devutil/jis0208.rb
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/docdiff-0.4.0/devutil/testjis0208.rb
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/docdiff-0.4.0/docdiff.conf.example
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/docdiff-0.4.0/docdiff.gemspec
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/docdiff-0.4.0/docdiff.rb
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/docdiff-0.4.0/docdiff/charstring.rb
#!/usr/bin/env ruby
require 'rubygems'
require 'pit'
require 'mechanize'
require 'logger'
require 'uri'
require 'fileutils'
MY_DROPBOX_BASE="/path/to/your/dropbox/folder"
BASE_URL = 'https://esrv.org/jtrapja'
# -*- coding: utf-8 -*-
module Iso2022jpEnforcer
extend ActiveSupport::Concern
included do
default :charset => 'iso-2022-jp'
alias_method_chain :mail, :iso_2022_jp
end
module ClassMethods