Skip to content

Instantly share code, notes, and snippets.

View ayumin's full-sized avatar

Ayumu AIZAWA ayumin

View GitHub Profile
#!/usr/bin/env ruby
# -*- encoding: utf-8 -*-
KeyWord = case ARGV[0] do
when "--cpu" then /^CPU used by this session/
when "--cpu" then /^CPU used by this session/
when "--cpu" then /^CPU used by this session/
when "--cpu" then /^CPU used by this session/
end
# カレントディレクトリの末尾".txt"で終わる全てのファイルを抽出する
# 抽出したファイルからキーワードにマッチする行のみを出力する
require 'kconv'
text = ""
wrap = false
ARGF.each do |line|
line.gsub!(/\t/,' ')
line.gsub!(/ +/,' ')
line.gsub!(%r{\"},%q{\\\"})
line.gsub!(%r{\'},%q{"})
if line =~ /\/\/(.*)$/
line = "/*" + $1 + "*/"
#!/usr/bin/ruby
# -*- coding: utf-8 -*-
require "optparse"
require "yaml"
require "kconv"
=begin
conf = {}
OptionParser.new do |opt|
opt.on("-p PACKAGES_YML","--packages") do |v|
@ayumin
ayumin / jrubykaigi_accept.html
Created June 11, 2011 02:59
JRubyKaigi2011 acceptance form
<form action="http://jrubykaigi.doorkeeper.jp/events/128/tickets" method="post">
<div>
<label for="email">Email</label>
<input name="email" size="30" type="text" />
</div>
<div>
<input name="commit" type="submit" value="Sign Up" />
</div>
</form>
commit 6bff025d9965d500517a810ad8a156e8308e96e9
Author: Ayumu AIZAWA <[email protected]>
Date: Wed Aug 3 06:14:47 2011 +0900
Skip test_udp_server when address unreachable
diff --git a/test/socket/test_socket.rb b/test/socket/test_socket.rb
index b3b6fee..7757f70 100644
--- a/test/socket/test_socket.rb
+++ b/test/socket/test_socket.rb
$ ../ruby/configure --prefix=/Users/ayumin/tmp/ruby --with-arch=x86_64 --with-readline-dir=/usr/local --with-openssl-dir=/opt/local --with-libyaml-dir=/opt/local --with-gdbm-dir=/opt/local --enable-shared
$ make
CC = gcc
LD = ld
LDSHARED = gcc -dynamiclib
CFLAGS = -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Werror=pointer-arith -Werror=write-strings -Werror=declaration-after-statement -Werror=shorten-64-to-32 -Werror=implicit-function-declaration -arch x86_64 -fno-common -pipe
XCFLAGS = -include ruby/config.h -include ruby/missing.h -fvisibility=hidden -DRUBY_EXPORT
CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -I. -I.ext/include/x86_64-darwin10.8.0 -I../ruby/include -I../ruby
DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -Wl,-flat_namespace -install_name /Users/ayumin/tmp/ruby/lib/libruby.1.9.1.dylib -current_version 1.9.1 -compatibility_version 1.9.1 -Wl,-unexported_sy
@ayumin
ayumin / patch.diff
Created September 26, 2011 17:29
[psych] test_yamldbm.rb failures/warnings on Win7/Arch
--- test/psych/test_yamldbm.rb
+++ test/psych/test_yamldbm.rb
@@ -1,19 +1,28 @@
# -*- coding: UTF-8 -*-
require 'test/unit'
require 'yaml/dbm'
+require 'tmpdir'
Psych::DBM = YAML::DBM unless defined?(Psych::DBM)
module Psych
@ayumin
ayumin / gist:1574959
Created January 7, 2012 14:59
r34225 ruby build failer on Darwin Kernel Version 10.8.0
configure: WARNING: unrecognized options: --with-readline-dir, --with-openssl-dir, --with-gdbm-dir, --with-libyaml-dir
checking build system type... x86_64-apple-darwin10.8.0
checking host system type... x86_64-apple-darwin10.8.0
checking target system type... x86_64-apple-darwin10.8.0
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
@ayumin
ayumin / git-dojo.md
Created March 2, 2012 10:59
Git道場実行委員募集

Git道場実行委員募集

3月下旬~4月くらいにGit道場を開催したいと思います。

講義メインではなくてなるべく手を動かす時間をたくさんとり、参加者全員が”怖がらずにmerge/rebaseをできるようになる”というのが目標です。

このイベントに実行委員として参加してくれる方は、下記の形式のメールを送信してください。

To: git-dojo_at_qwik.jp

Cc: ayumu.aizawa_at_gmail.com

@ayumin
ayumin / build_ruby.sh
Created April 30, 2012 14:44
Ruby compile option (Mac OSX)
#!/usr/bin/sh
make realclean
autoconf
./configure --prefix=~/tmp/ruby-trunk \
--with-gcc=gcc-4.2 \
--with-arch=x86_64 \
--with-readline-dir=/usr/local \