Skip to content

Instantly share code, notes, and snippets.

☕️

akira yamada arika

☕️
Block or report user

Report or block arika

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
View manual_import_migrations.rb
# usage:
# ruby manual_import_migrations.rb ../path/to/project/db/migrate/**/*.rb
require 'optparse'
require 'fileutils'
require 'ripper'
def omit_pos(token)
if token.size == 3 &&
token[-1].is_a?(Array) && token[-1].size == 2 &&
@arika
arika / groonga-pry.rb
Last active Aug 29, 2015
run groonga command on pry
View groonga-pry.rb
#!/usr/bin/env ruby
# encoding: utf-8
#
# Requirements:
# * groonga command
# * jq command <http://stedolan.github.io/jq/>
# * pry 0.10.x
#
# Configuration:
# * ~/.groonga-pryrc
@arika
arika / groonga.rb.diff
Last active Aug 29, 2015
brew install groonga with mruby-support
View groonga.rb.diff
with→enableの間違いを直すとonig-sourceの中身をbuildしてくれなくてコケるという流れ。
いきなりmake installでなく、いったんmakeすれば回避できるみたい。
diff --git a/Library/Formula/groonga.rb b/Library/Formula/groonga.rb
index 66a643d..441bddc 100644
--- a/Library/Formula/groonga.rb
+++ b/Library/Formula/groonga.rb
@@ -28,7 +28,7 @@ class Groonga < Formula
--prefix=#{prefix}
--with-zlib
@arika
arika / groonga.rb.diff
Created Dec 30, 2014
homebrew groonga.rb: enable mruby support and add tests.
View groonga.rb.diff
diff --git a/Library/Formula/groonga.rb b/Library/Formula/groonga.rb
index 386e7ca..94e0a41 100644
--- a/Library/Formula/groonga.rb
+++ b/Library/Formula/groonga.rb
@@ -39,7 +39,7 @@ class Groonga < Formula
--prefix=#{prefix}
--with-zlib
--disable-zeromq
- --with-mruby
+ --enable-mruby
View kana01.rb
data=[
# [ id, input, expected ],
[ -1, "4", "4" ],
[ 0, "4*5+6&7|8", "44" ],
[ 1, "15*5", "75" ],
[ 2, "15+5", "20" ],
[ 3, "15&5", "5" ],
[ 4, "15|5", "15" ],
[ 5, "30*15*5", "2250" ],
[ 6, "30*15+5", "600" ],
@arika
arika / tdiary-export.rb
Created Nov 12, 2008
exports tDiary data ad HTML text
View tdiary-export.rb
#!/usr/bin/ruby
#
# this script dumps diary data from tDiary 2.2.x.
#
# usage: $0 /path/to/tdiary/dir [/path/to/tdiary.conf/dir] > tdiary.dat
#
# Author: akira at arika.org
# License: tDiary's
config_override = proc do |config|
@arika
arika / tdiary2typo.rb
Created Nov 12, 2008
imports data generated by tddump.rb to typo.
View tdiary2typo.rb
#!/usr/bin/ruby
#
# this script imports dump data of tDiary 2.2.x to Typo 5.1.x.
# (ref: http://gist.github.com/24118)
#
# usage: /path/to/typo-base-dir/script/runner tdiary2typo.rb /path/to/tdiary.dat
#
# Author: akira at arika.org
# License: Ruby's
View gonzui-rack.rb
# gonzui <http://gonzui.sf.net> wrapper for Rack
unless defined?(GONZUIRC)
GONZUIRC = File.expand_path('~/.gonzuirc')
end
require 'gonzui'
require 'gonzui/webapp'
class GonzuiWEBrickServletApp
View reload_rubygems_test.rb
# reload anoter version of RubyGems
lp0 = $:.dup
ENV["GEM_HOME"] = "/tmp/GEM"
$:.unshift "REL_1_1_1/lib"
p require "rubygems" #=> true
p Gem::RubyGemsVersion #=> "1.1.1"
gem "rails"
lp1 = $:.dup
@arika
arika / 書籍「プログラミング言語Ruby」とRuby 1.9.1RC2のNEWSファイルの対応状況
Created Jan 29, 2009
書籍「プログラミング言語Ruby」とRuby 1.9.1RC2のNEWSファイルの対応状況
View 書籍「プログラミング言語Ruby」とRuby 1.9.1RC2のNEWSファイルの対応状況
書籍「プログラミング言語Ruby」と
Ruby 1.9.1RC2のNEWSファイルの対応状況。
o - 記述あり
x - 記述なし
- - 対象範囲外
? - 未確認・判断できず
------------------------------------------------------------------------------
= NEWS
You can’t perform that action at this time.