Skip to content

Instantly share code, notes, and snippets.

View udzura's full-sized avatar

Kondo Uchio udzura

View GitHub Profile
@udzura
udzura / setup.sh
Last active January 27, 2016 11:19 — forked from satococoa/setup.sh
Mac OS X 上での Homebrew + rbenv + ruby-build + ruby + rails の環境構築(Xcode, Comamnd Line Tools のインストールを済ませてから。)
# Homebrew のインストール
# 公式 (http://brew.sh/) に載っているコマンドです
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Ruby のビルドに必要なものをインストール
brew install openssl readline rbenv ruby-build # 時間がかかります
# rbenv 用の設定を .bash_profile に書き込む
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
@udzura
udzura / prepend_hacked.rb
Last active December 14, 2015 04:29 — forked from sonots/method_chain
class Moge
def moge1; p "Moge#moge1"; end
def moge2; p "Moge#moge2"; end
end
module OverwrapMoge
def moge1
super
# It's a fancy ruby wolrd
self.class.instance_method(:moge2).bind(self).call
@udzura
udzura / gist:4192133
Created December 3, 2012 02:03 — forked from holysugar/gist:4192128
後置 while にする?
def generate_name
begin
name = Digit.generate(6)
end while Image.exists?(name: name)
name
end
def generate_name
loop do
name = Digit.generate(6)
@udzura
udzura / shibuya-el-position-paper.md
Created August 19, 2012 08:42 — forked from ainame/shibuya-el-position-paper.md
shibuya.elのポジションペーパー

Shibuya.el#1 ポジションペーパー

Personal

  • 名前(任意)
    • KONDO Uchio
  • Twitter or Facebookのアカウント or HN等
    • @udzura
  • http://blog.udzura.jp
@udzura
udzura / gist:3161776
Created July 23, 2012 02:49 — forked from cjbottaro/gist:1128108
unDRY rspec code
describe Object do
context "extented with MyModule" do
before(:all){ subject.extend(MyModule) }
it "should define #some_method" do
subject.should respond_to(:some_method)
end
end
end
describe Class do
@udzura
udzura / blog_template.rb
Created October 21, 2011 05:43 — forked from toshiwo/blog_template.rb
start padrino
project :test => :shoulda, :renderer => :haml, :stylesheet => :sass, :script => :jquery, :orm => :activerecord
#default routes
APP_INIT = <<-APP
get "/" do
"Hello World!"
end
get :about, :map => '/about_us' do
render :haml, "%p This is a sample blog created to demonstrate the power of Padrino!"