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
| % cat tmp/define_method_test.rb | |
| class Foo | |
| def foo | |
| :foo | |
| end | |
| define_method(:bar) { :foo } | |
| end | |
| def time(method_name, count, &block) | |
| start = Time.now |
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
| diff --git a/Headers/iTerm/PTYTextView.h b/Headers/iTerm/PTYTextView.h | |
| index 54c192c..a75f0bc 100644 | |
| --- a/Headers/iTerm/PTYTextView.h | |
| +++ b/Headers/iTerm/PTYTextView.h | |
| @@ -100,6 +100,8 @@ typedef struct PTYFontInfo PTYFontInfo; | |
| BOOL CURSOR; | |
| BOOL colorInvertedCursor; | |
| + BOOL doCommandBySelectorCalled; | |
| + |
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
| class Amida | |
| attr_reader :width, :height, :matrix | |
| def initialize(size) | |
| @size = size | |
| @width = size - 1 | |
| @height = @width * 2 | |
| @matrix = Array.new(@height) { Array.new(@width) } | |
| end | |
| def gen(num) |
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 | |
| hub clone https://github.com/dproject21/yaruo_tdd_triangle | |
| hub clone https://github.com/mataki/fast_spork_runner | |
| hub clone https://github.com/randym/axlsx | |
| hub clone https://github.com/todesking/okura |
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
| $ cat let.rb | |
| describe do | |
| let!(:a) { puts 'first let' } | |
| before { puts 'before' } | |
| let!(:b) { puts 'second let' } | |
| it { true.should be_true } | |
| end | |
| $ rspec let.rb |
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 method_missing(*args) | |
| args[0].to_s | |
| end | |
| p a |
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 gh_link(id_and_name) | |
| name = id_and_name.split('/').last | |
| "<a href='http://github.com/#{id_and_name}'>#{name}</a>" | |
| 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
| #検証したいUserクラス | |
| class User < ActiveRecord::Base | |
| belongs_to :room | |
| def wait(room) | |
| room.wait | |
| self.room = room | |
| end | |
| 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
| alias b="bundle" | |
| alias bi="bundle install" | |
| alias bu="bundle update" | |
| alias be="bundle exec" | |
| alias bo="bundle open" | |
| alias s='spring' | |
| alias g="git" | |
| alias r="rails" |
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
| ken = 'けん' | |
| prefixes = %w(さん くん ちゃん) | |
| loop do | |
| if (ken + (prefix = prefixes.sample)).size < 140 | |
| ken << prefix | |
| else | |
| break | |
| end | |
| end |