Skip to content

Instantly share code, notes, and snippets.

Kuniaki IGARASHI igaiga

Block or report user

Report or block igaiga

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@igaiga
igaiga / gist:9225482
Last active Aug 29, 2015
MySQL5.6 build in Linux
View gist:9225482
$ tar xvzf mysql-5.6.12.tar.gz
$ cmake -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
$ make
$ sudo make install
.bash_profile などでmysqlへパスを通す
```
# PATH
export PATH=$PATH:/usr/local/mysql/bin
View string_boolean.rb
class String
def true?
downcase == "true"
end
def false?
!true?
end
def to_boolean
true?
end
@igaiga
igaiga / highlight.rb
Created Apr 13, 2014
jekyll highlight
View highlight.rb
module Jekyll
module Tags
class HighlightBlock < Liquid::Block
def render_codehighlighter(context, code)
#The div is required because RDiscount blows ass
<<-HTML
<div>
<pre class='#{@lang}'><code class='#{@lang}'>#{h(code).strip}</code></pre>
</div>
HTML
@igaiga
igaiga / test.rb
Created Apr 23, 2014
module private
View test.rb
module Mod
private
def mod_a
p "mod_a!"
end
end
class Foo
include Mod
def public_a
View test.rb
require "test/unit"
class TestFoo < Test::Unit::TestCase
def test_foo
@obj = [[1,2],[3,4]]
assert_equal([[1, 2, "a"], [3, 4, "a"]],
@obj.map {|x| x << "a" })
proc = Proc.new {|x| x << "b" }
assert_equal([[1, 2, "a", "b"], [3, 4, "a", "b"]],
@obj.map(&proc))
View gist:11360639
class Account
def self.create(params, provider)
case provider
when "facebook"
Facebook.new(params)
when "google_oauth2"
Google.new(params)
end
end
end
@igaiga
igaiga / def_grep.rb
Created Apr 30, 2014
grep_test_line.rb
View def_grep.rb
# ruby のテストからdef test_XXX のXXXを抽出
require "ap"
File.open("test_enum.rb") do |file|
include_def_lines = file.readlines.grep(/def/)
def_names = []
include_def_lines.each do |line|
line =~ /def test_+(.*)$/
match = $1
def_names << match if match
end
View layout.html
<div class="post">
{{ content }}
</div>
View gist:5c1979788fff6c325fd8

(仮) じぐそう x いがいが kceffect

概略

高専カンファレンスとお互いの節目のイベントを振り返り、それぞれの立場で何を考えてたかを対談的に話す。ざっくり過去、現在、未来の3部構成で、6:2:2くらいの割合。

節目のイベント

  • 003Tokyo - いがいが初の実行委員長的ポジション
  • 004Fukui - 初の高専開催。じぐそう:ust staff いがいが:客
@igaiga
igaiga / render_time_tag.rb
Created Jun 3, 2014
Jekyll template sample. placed in _plugins. see also http://jekyllrb.com/docs/plugins/.
View render_time_tag.rb
module Jekyll
class RenderTimeTag < Liquid::Tag
def initialize(tag_name, text, tokens)
super
@text = text
end
def render(context)
"#{@text} #{Time.now}"
end
end
You can’t perform that action at this time.