Skip to content

Instantly share code, notes, and snippets.

# https://github.com/rails/rails/issues/9855#issuecomment-28874587
#
# config/initializers/mysqlpls.rb
require 'active_record/connection_adapters/abstract_mysql_adapter'
module ActiveRecord
module ConnectionAdapters
class AbstractMysqlAdapter
NATIVE_DATABASE_TYPES[:string] = { :name => "varchar", :limit => 191 }
end
@toshiwo
toshiwo / ruby_2.0.0p247
Created August 3, 2013 16:08
RubyMotionで Time.at を使おうとした際の挙動について。 Ruby2.0での挙動も乗せておきました。(1.9.3-p448でも同様でした)
irb(main):001:0> '9241205101'.to_i
=> 9241205101
irb(main):002:0> '9241205101'.to_i.class
=> Fixnum
irb(main):003:0> Time.at('9241205101'.to_i)
=> 2262-11-04 18:25:01 +0900
@toshiwo
toshiwo / gist:5501132
Created May 2, 2013 09:18
el-get用のlocal recipe
(setq el-get-sources
'(
(:name motion-mode
:website "https://github.com/ainame/motion-mode"
:description "[local] motion-mode provide the simple dictionary code-completion on RubyMotion"
:type git
:url "https://github.com/ainame/motion-mode.git"
:branch "master"
)
));
# spec_helper.rb
if ENV['COVERAGE']
require "simplecov"
SimpleCov.start do
add_filter "/spec/"
add_filter "/vendor/bundle/"
end
end
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!"