Skip to content

Instantly share code, notes, and snippets.

View koic's full-sized avatar

Koichi ITO koic

View GitHub Profile
@koic
koic / diff_migration.sh
Last active August 26, 2016 09:38
Difference between schema and migrate files
bundle exec rake db:migrate:status | sed 's/\s\{1,\}/ /g' | cut -f3 -d ' ' > tmp/schema.txt
# Remove the header of above file
ls db/migrate | sed 's/db\/migrate//g' | cut -f1 -d '_' > tmp/file.txt
diff tmp/schema.txt tmp/file.txt
@koic
koic / helm_ag_package_installed_by_el_get.md
Last active April 18, 2016 06:01
helm-ag package installed by El-Get

Problem

Warning (emacs): Unable to activate package `helm-ag'.
Required package `helm-1.7.7' is unavailable

A Solution

@koic
koic / ruby2_3_0_with_older_did_you_mean.md
Last active April 7, 2016 16:12
Ruby 2.3.0 with older did_you_mean

Problem

何かの拍子で 2.3.0 に旧バージョンの did_you_mean を入れていたらしい。。。

$ ruby -v -e 'def hi; hi; end; hi'
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin13]
/Users/koic/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/interception-0.5/lib/cross_platform.rb:66: 
warning: method redefined; discarding old start
/Users/koic/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/interception-0.5/lib/interception.rb:113: w
@koic
koic / remake_gh_archive_file.sh
Last active February 23, 2016 04:37
Remake archive file for migrate from GH.com to GH:E
mkdir foo
cp migration_archive.tar.gz foo/
cd foo
git init
tar zxvf migration_archive.tar.gz
rm migration_archive.tar.gz
git add *
git commit -m * 'Initial commit'
rm users_*.json teams_*.json organizations_*.json
git commit . -m 'Remove org info'
@koic
koic / extreme_fish_bowl_cheat_sheet.md
Last active February 1, 2016 10:01
"Extreme Fish Bowl" Cheat Sheet

"Extreme Fish Bowl" Bootstrap Cheat Sheet

1. bundle init

$ bundle init

2. Add rspec to Gemfile

@koic
koic / test_find_by_created_at.rb
Created January 5, 2016 04:40
Test case of AR 4.2.5 and Oracle (oracle-enhanced/issues/755)
# Activate the gem you are reporting the issue against.
gem 'activerecord', '4.2.5'
gem 'activerecord-oracle_enhanced-adapter', '1.6.5'
require 'active_record'
require 'minitest/autorun'
require 'logger'
require 'active_record/connection_adapters/oracle_enhanced_adapter'
# Ensure backward compatibility with Minitest 4
Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test)
@koic
koic / cflt_for_rubykaigi2015.md
Last active November 16, 2015 12:10
CFLT for RubyKaigi 2015 (@koic)

CFLT for RubyKaigi 2015

Title

Agile Software Development with Edge Ruby

Abstract

Ruby / Rails をもちいたソフトウェア開発の中で、Ruby の開発バージョン (発表時 2.3.0-dev) を取り入れているお話をします。本番環境は本番環境、開発環境は開発環境ということで、明日から個人ではじめられる話です。 プログラミングを楽しくする言語 Ruby のことをもっと知りたいという気持ちを持ち帰って頂ければ幸いです。

@koic
koic / gist:5104a190c3f3f997056b
Last active May 11, 2016 10:17
Install log of rabbit 2.1.8 on Mac OS X (10.9)
$ ruby -v ✖ ✹ ✭
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin13]
$ PKG_CONFIG_PATH=/usr/local/opt/libffi/lib/pkgconfig gem install rabbit
Fetching: glib2-3.0.5.gem (100%)
Building native extensions. This could take a while...
Successfully installed glib2-3.0.5
Fetching: gobject-introspection-3.0.5.gem (100%)
Building native extensions. This could take a while...
Successfully installed gobject-introspection-3.0.5
Fetching: gio2-3.0.5.gem (100%)
module Readline
def readline
# ...
end
module_function :readline
def self.input=(input)
# ...
end
@koic
koic / gist:ea337f39012cd9efa775
Last active September 6, 2016 11:18
Example codes for Hamamatsu Ruby Kaigi 01 Lightning Talks https://www.slideshare.net/koic/reading-1st-druby
#
# artist.rb
#
class Artist
def initialize(name)
@name = name
end
attr_reader :name
end