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
# Rack middleware to insert git commit id into http response header | |
# For Rails, put this script under RAILS_ROOT/config/initializers | |
module Rack | |
class GitCommitHeader | |
def initialize(app) | |
@app = app | |
c = `git rev-parse HEAD`.chomp | |
@commit = (c =~ /^[0-9a-f]{40}$/) ? c : nil | |
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
module MultiParameterAttributes | |
def filter_time(attributes, name) | |
attrs = attributes.collect do |key, value| | |
if key =~ /^#{Regexp.escape(name.to_s)}\((\d+)(\w)\)$/ | |
[$1.to_i, value.send("to_#$2")] | |
end | |
end.compact.sort_by(&:first).map(&:last) | |
Time.zone.local(*attrs) unless attrs.empty? | |
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 'ruby-prof' | |
RubyProf.start | |
result = RubyProf.stop | |
printer = RubyProf::FlatPrinter.new(result) | |
open('rubyprof.txt', 'w+') do |f| | |
printer.print(f, 0) | |
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
;; -*- mode: Emacs-Lisp; coding: utf-8-unix -*- | |
;;; migemo.el - Japanese incremental search trough dynamic pattern expansion | |
;; $Id: migemo.el.in,v 1.8 2006/09/22 08:43:33 shirai Exp $ | |
;; Copyright (C) Satoru Takabayashi | |
;; Author: Satoru Takabayashi <[email protected]> | |
;; Keywords: | |
;; This file is free software; you can redistribute it and/or modify |
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
gem 'rails3-generators' | |
gem 'mongoid', '>= 2.0.0.beta' | |
gem 'bson_ext' | |
gem 'haml' | |
gem 'hirb', :group => :development | |
gem 'what_methods', :group => :development | |
gem 'rspec-rails', '>= 2.0.0.beta', :group => :test | |
gem 'rr', :group => :test |
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
;;; inao-mode.el --- major mode for writing inao manuscripts | |
;; Copyright (C) 2010 SAKURAI Masashi | |
;; Author: SAKURAI Masashi <m.sakurai at kiwanami.net> | |
;; Keywords: outlines, convenience | |
;; This program is free software; you can redistribute it and/or modify | |
;; it under the terms of the GNU General Public License as published by | |
;; the Free Software Foundation, either version 3 of the License, or |
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
# Rack file for local Rubygems server, using YARD | |
require "rubygems" | |
require "yard" | |
libraries = {} | |
Gem.source_index.find_name('').each do |spec| | |
libraries[spec.name] ||= [] | |
libraries[spec.name] << YARD::Server::LibraryVersion.new(spec.name, spec.version.to_s, nil, :gem) | |
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
NOTE: This is English translation of "http://shyouhei.tumblr.com/post/145555071/ruby". | |
The theme of Ruby Kaigi 2011 is "The last RubyKaigi" and the chariman Takahashi apparently got the | |
inspiration from this blog which Urabe san wrote a year ago. I translated this so that non Japanese | |
speaker also understand the context of post RubyKaigi discussions going on in Japanese Ruby community. | |
あえて言うがRuby会議はそろそろ一回終わってみるべき。 | |
RubyKaigi must die (for at least once). | |
Original title: Let me say that Ruby Kaigi should end for now. |
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
昨日、松江のRuby World Conference 2010行ったんです。RWC2010。 | |
そしたらなんか言ってることがめちゃくちゃ偏ってて聞いてられないんです。 | |
で、よく見たらなんかスライド出てて | |
「期間、予算の都合からJavaに関しては実際に物を作ってのデータとりを行わず、 | |
論理的な見積り値の算出にとどめた。見積り値の算出は富士通のファンクションスケール法」 | |
とか書いてあるんです。 | |
もうね、アホかと。馬鹿かと。 | |
お前らな、自社基準の想像上の生産性と比較して検証とかいってんじゃねーよ、ボケが。 | |
論理的な見積り値だよ、論理的な見積り値。 | |
なんかWeb初心者いるし。HTMLやJSに苦戦か。たいへんだな。 |
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
#compdef up | |
segments=$(perl -le '$p=$ENV{PWD};$p =~ tr/\// /; print $p') | |
_arguments "1:first:($segments)" |
OlderNewer