This file contains hidden or 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 -v -rbigdecimal -e '%w[Infinity NaN].each{|s| v = BigDecimal.new(s); i = v.to_i rescue $!.class; print "#{v}: ";p i}' |
This file contains hidden or 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
def f | |
send(:__method__) | |
end | |
puts f |
This file contains hidden or 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
From 57bbc6ec737c07e0455f54a4664e109e598b9e5d Mon Sep 17 00:00:00 2001 | |
From: KAKUTANI Shintaro <[email protected]> | |
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 <[email protected]> | |
--- |
This file contains hidden or 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 '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 |
This file contains hidden or 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
-# -*- coding: utf-8 -*- | |
%h2 浅草jpmobile会議01 | |
%div (適宜更新していきます) | |
%p Asakusa.rbプレゼンツ!! | |
%p jpmobileをruby 1.9対応させていくにあたって、m17nに詳しい成瀬さんに相談してみてはどうかという試みです。 | |
%h2 参加してほしい方 |
This file contains hidden or 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
:erb | |
オブジェクト倶楽部2010新春イベント<br /> | |
『オブラブアレグザンダー祭り』<br /> | |
<br /> | |
<div style="font-size:14px;line-height:1.5;"> | |
「アレグザンダーを考える。パタン・ランゲージ、漸進的開発、そして生成の原則へ」<br /> | |
<br /> | |
オブジェクト倶楽部では、デザインパターンやアジャイルプロセスの原点であるアレグザンダーに再び着目し、これからのソフトウェア開発が向うべき方向性へのヒントを持ち帰っていただきたいと考えています。<br /> | |
ソフトウェアパターンムーブメントのキーパーソンであり、パターンやオブジェクト指向についての数多くの著作を記しているJames.O.Coplien氏と、アレグザンダーに師事した経験をもつ建築・町づくりの第一人者である中埜博氏/笹川万国氏をお招きします。<br /> | |
Coplien氏には「ソフトウェア開発とパターンと生成の原則」に関する講演を、中埜/笹川両氏にはアレグザンダーのパターンと生成の原則を体感できるワークショップを実施いただく予定です。また、自分も語りたい!という方々のために、ライトニングトークスもご用意しています。<br /> |
This file contains hidden or 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
#!/bin/bash | |
# taken from http://d.hatena.ne.jp/libkazz/20100108/1263024229 | |
title="05.レクチャー後編, 中埜博 笹川万国" | |
input=/Users/shintaro/Desktop/alexander/nakano-3.mp4 | |
output=/Users/shintaro/Desktop/alexander/$title | |
offset=0 #頭だし秒数 | |
last=1904 #動画最後の秒数 | |
overlap=2 | |
term=600 # 10分 |
This file contains hidden or 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 "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 |
This file contains hidden or 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
describe 'to_branch' do | |
it do | |
to_branch( | |
:a => [:b, :c], | |
:b => [:d], | |
:c => [:d] | |
).should == [ | |
[:a, :b, :d] | |
[:a, :c, :d] | |
] |
This file contains hidden or 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
#!/bin/sh | |
REPO=$1 | |
newgrp src | |
GIT_DIR=/var/cache/git/$REPO git --bare init --shared | |
cd /var/cache/git/empty | |
git push ../$REPO master |