Skip to content

Instantly share code, notes, and snippets.

View ppworks's full-sized avatar
🏠
Working from home

Naoto Koshikawa ppworks

🏠
Working from home
View GitHub Profile
@ppworks
ppworks / nokogiri-warning.md
Created April 17, 2014 00:18
Get rid of Nokogiri LibXML warning
WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.9.1

or

WARNING: Nokogiri was built against LibXML version 2.9.1, but has dynamically loaded 2.9.0
@ppworks
ppworks / file0.txt
Created April 10, 2014 00:14
rails4.1にしたときのherokuのdatabase.yml設定 ref: http://qiita.com/ppworks/items/a30ebda446c0204ca6ca
staging:
url: <%= ENV["DATABASE_URL"] %>
production:
url: <%= ENV["DATABASE_URL"] %>
@ppworks
ppworks / file0.txt
Created March 13, 2014 06:28
friendly_idのslugがセットされるタイミングっていつなの ref: http://qiita.com/ppworks/items/cdf98639665bc586cbac
before_validation :set_xxxx
extend FriendlyId # extendはもっと上でもいいのでおこのみで
friendly_id :slug_candidates, use: :slugged
rails console
@ppworks
ppworks / application_helper.rb
Created November 15, 2013 08:06
link_to_ifにブロック渡した時の挙動が欲しいのと違う ref: http://qiita.com/ppworks/items/9bf917edf0d4927b15bd
module ApplicationHelper
def link_to_if_with_block(condition, options = nil, html_options = nil, &block)
if condition
link_to(options, html_options, &block)
else
capture(&block)
end
end
end
@ppworks
ppworks / file0.txt
Created November 13, 2013 03:59
herokuのメンテナンス画面はiframeで表示しているだけ ref: http://qiita.com/ppworks/items/79a69abe8147431c271e
heroku maintenance:on
@ppworks
ppworks / diff.md
Created October 15, 2013 23:42
cocificoとyocificoの差分とりました
cocifico="c\no\nc\ni\nf\ni\nc\no"
yocifico="y\no\nc\ni\nf\ni\nc\no"
echo $cocifico
@ppworks
ppworks / file0.txt
Created October 11, 2013 04:40
carriewaveでExifの回転情報をいい感じにする ref: http://qiita.com/ppworks/items/ae479c036d25b3e7b120
class ImageUploader < CarrierWave::Uploader::Base
include CarrierWave::MiniMagick
process :fix_rotate
def fix_rotate
manipulate! do |img|
img.auto_orient
yield(img) if block_given?
img
end
@ppworks
ppworks / Gemfile
Last active December 22, 2015 17:49
Bootstrap3対応
gem 'simple_form', git: 'git://github.com/zlx/simple_form', branch: 'feature/integration_bootstrap3'
gem 'twitter-bootstrap-rails', git: 'git://github.com/seyhunak/twitter-bootstrap-rails.git', branch: 'bootstrap3'
@ppworks
ppworks / file0.rb
Created September 3, 2013 08:12
次の○曜日の日付を取りたい〜 ref: http://qiita.com/ppworks/items/001ee7f6b6de31dc8d33
Time.current.beginning_of_week(:friday).since(1.week)