Skip to content

Instantly share code, notes, and snippets.

View kazuhisa's full-sized avatar

Yamamoto Kazuhisa kazuhisa

View GitHub Profile
class DS
def get_mouse_info(id)
"Dual Optical"
end
def get_mouse_price(id)
40
end
def get_keyboard_info(id)
require './data_source'
require './boring'
computer = Computer.new(1,DS.new)
puts computer.mouse
puts computer.keyboard
puts computer.cpu
$("input.input_search").live("focus",function(){
$(this).attr({"MaxLength":2000});
});
+--------------------------------------------------+
|Name | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
+--------------------------------------------------+
|Yui |x |9 /|2 3|2 3|2 3|2 3|2 3|2 4|2 4|2 / X|
+--------------------------------------------------+
|Mio |x |9 /|2 3|2 3|2 3|2 3|2 3|2 4|2 4|2 / X|
+--------------------------------------------------+
|Ritsu |x |9 /|2 3|2 3|2 3|2 3|2 3|2 4|2 4|2 / X|
+--------------------------------------------------+
|Azusa |x |9 /|2 3|2 3|2 3|2 3|2 3|2 4|2 4|2 / X|
@kazuhisa
kazuhisa / Gemfile
Last active December 11, 2015 23:48
Railsでarproxy + fluent-loggerを使ってSQLのログを記録してみた
# add
gem "arproxy"
gem "fluent-logger"
・好きな言語は?
・好きなメソッドは?
・好きなアニメは?
・好きなガンダムシリーズは?
・githubアカウントは?
・英語しゃべれる?
・最近気になるテクノロジーは?
・最近行った勉強会は?
・最近登壇した勉強会は?
・iPhone落とした事ある?
class Rental
attr_reader :movie, :days_rented
def initialize(movie, days_rented)
@movie, @days_rented = movie, days_rented
end
def charge
result = 0
case movie.price_code
@kazuhisa
kazuhisa / relation_patch.rb
Created September 11, 2013 14:57
Rails4.0.0でJoinしたテーブルに対してreadonly(false)が効かないのはバグです。4.1系で解消されるはずなので、次のパッチをconfig/initializersにでも入れておくといいよ。
# -*- coding: utf-8 -*-
module ActiveRecord
class Relation
def initialize(klass, table, values = {})
@klass = klass
@table = table
@values = values
@loaded = false
end