Skip to content

Instantly share code, notes, and snippets.

View kakutani's full-sized avatar

Kakutani Shintaro kakutani

View GitHub Profile
@kakutani
kakutani / Annotation.md
Last active September 26, 2019 13:35 — forked from ursm/Gemfile
Raw Gemfile on Idobata (master - 5adeddb)

Idobata Gemfile プレゼント

tl;dr IdotabaのGemfileは"全プレ"になりました。ご笑納ください。→ Gemfile

プレゼントについてのお詫び

rebuild.fmのep36でお知らせさせていただきました、Idobataの最新版Gemfileプレゼントをお届けいたします。 過日はIdobata会議01への多数のご参加ありがとうございました。おかげさまで盛況なミートアップとなりました。 (当日会場を提供いただいたEngine Yardさまのブログにて、Idobata会議01当日の様子がまとめられています。ありがとうございます!)

@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
describe 'to_branch' do
it do
to_branch(
:a => [:b, :c],
:b => [:d],
:c => [:d]
).should == [
[:a, :b, :d]
[:a, :c, :d]
]
@kakutani
kakutani / gist:287512
Created January 27, 2010 03:29 — forked from ursm/gist:274806
require "rack/openid"
require "warden"
use Rack::OpenID
use Warden::Manager do |manager|
Warden::Strategies.add(:openid) do
def authenticate!
if resp = env["rack.openid.response"]
case resp.status
when :success
require 'mongo_mapper'
conf = YAML.load_file(File.join(Rails.root, 'config', 'database.yml'))[Rails.env]['mongodb']
MongoMapper.connection = Mongo::Connection.new(*conf.values_at('host', 'port').push(:logger => Rails.logger))
MongoMapper.database = conf['database']
if defined?(PhusionPassenger)
PhusionPassenger.on_event(:starting_worker_process) do |forked|
MongoMapper.database.connect_to_master if forked
end
From 57bbc6ec737c07e0455f54a4664e109e598b9e5d Mon Sep 17 00:00:00 2001
From: KAKUTANI Shintaro <shintaro@kakutani.com>
Date: Thu, 26 Nov 2009 11:06:37 +0900
Subject: [PATCH] fix 'rvm install shyouhei' was broken.
thanks to fistsvck!
see http://gist.github.com/243181
Signed-off-by: KAKUTANI Shintaro <shintaro@kakutani.com>
---
@kakutani
kakutani / gist:8408
Created September 2, 2008 13:38 — forked from walf443/gist:8407
# benchmarking yaml_waml converting string.
require 'benchmark'
require 'yaml'
class String
def is_binary_data?
false
end
end
@kakutani
kakutani / screen.rb
Created August 28, 2008 16:55 — forked from yoshuki/screen.rb
##
# Autotest::Screen is test result notify GNU Screen's statusline.
#
# === screenshots
# * <img src="http://f.hatena.ne.jp/images/fotolife/s/secondlife/20061109/20061109015543.png" />
# * <img src="http://f.hatena.ne.jp/images/fotolife/s/secondlife/20061109/20061109015522.png" />
#
# == SYNOPSIS
# require 'autotest/screen'
# # Autotest::Screen.statusline = '%H %`%-w%{=b bw}%n %t%{-}%+w (your statusline)'