Skip to content

Instantly share code, notes, and snippets.

Avatar

Kakutani Shintaro kakutani

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

Idobata Gemfile プレゼント

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

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

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

@kakutani
kakutani / gist:1210976
Created Sep 12, 2011 — forked from jugyo/gist:756962
email_steps_ja.rb
View gist:1210976
# 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
View to_branch_spec.rb
describe 'to_branch' do
it do
to_branch(
:a => [:b, :c],
:b => [:d],
:c => [:d]
).should == [
[:a, :b, :d]
[:a, :c, :d]
]
View gist:287512
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
View mongo_mapper.rb
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
View rvm-install-mput_rework.patch
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>
---
View gist:8408
# benchmarking yaml_waml converting string.
require 'benchmark'
require 'yaml'
class String
def is_binary_data?
false
end
end
View 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)'