Skip to content

Instantly share code, notes, and snippets.

View takaokouji's full-sized avatar

Kouji Takao takaokouji

View GitHub Profile
(when (>= emacs-major-version 23)
(set-face-attribute 'default nil
:family "monaco"
:height 120)
(set-fontset-font
(frame-parameter nil 'font)
'japanese-jisx0208
'("Hiragino Maru Gothic Pro" . "iso10646-1"))
(set-fontset-font
(frame-parameter nil 'font)
#############################
#! Is colorful terminal ?
export COLOR_P
if [ "$TERM" = "dumb" -o "$TERM" = "emacs" -o "$TERM" = "putty" ]; then
COLOR_P="nil"
else # color
COLOR_P="t"
fi
@takaokouji
takaokouji / AppDelegate_for_Calc.rb
Created January 31, 2012 11:37
MacRubyサンプルプログラム(AppDelegate.rb) - 第53回 Ruby/Rails勉強会@関西 MacRubyではじめる!Macアプリ開発入門
#
# AppDelegate.rb
# Calc
#
# Created by 高尾 宏治 on 12/01/27.
# Copyright 2012 TAKAO Kouji. All rights reserved.
#
class AppDelegate < NSWindowController
attr_accessor :window
@takaokouji
takaokouji / load.c.patch
Created October 11, 2011 14:04
MacRuby requires <file>.rbo instead of <file>.rb when you write 'require "<file>.rb"' in your script and <file>.rbo was created recently
diff --git a/load.c b/load.c
index b070a12..bc00930 100644
--- a/load.c
+++ b/load.c
@@ -323,6 +323,15 @@ check_path(const char *path, VALUE *out, int *type)
// it's a valid one, then try to validate the path.
int t = 0;
if (strcmp(p + 1, "rb") == 0) {
+ if (rbo_enabled && strlen(path) < (PATH_MAX - 1)) {
+ char buf[PATH_MAX];
@takaokouji
takaokouji / id1391.patch
Created September 23, 2011 00:31
A patch fixes #1391 "macruby interpreter quits on 'quit' out of scope" - http://www.macruby.org/trac/ticket/1391
Changes in HEAD
Modified lib/irb/context.rb
diff --git a/lib/irb/context.rb b/lib/irb/context.rb
index 0b03d00..a7e11fc 100644
--- a/lib/irb/context.rb
+++ b/lib/irb/context.rb
@@ -124,3 +124,7 @@ module IRB
end
end
end
@takaokouji
takaokouji / dot_bundle_instead_of_dot_so.patch
Created September 16, 2011 11:23
.bundle Indeed of .so in MacRuby
diff --git a/load.c b/load.c
index 06ca712..a1498b7 100644
--- a/load.c
+++ b/load.c
@@ -186,6 +186,21 @@ check_path(const char *path, VALUE *out, int *type)
else if (strcmp(p + 1, "bundle") == 0) {
t = TYPE_BUNDLE;
}
+ else if (strcmp(p + 1, "so") == 0) {
+ const char *ext = "bundle";
@takaokouji
takaokouji / fixed_ee78786.patch
Created September 6, 2011 06:59
fixed a SEGV that is included #ee78786
Changes in HEAD
Modified lib/date.rb
diff --git a/lib/date.rb b/lib/date.rb
index 2fcde74..c367c9c 100644
--- a/lib/date.rb
+++ b/lib/date.rb
@@ -1392,11 +1392,8 @@ class Date
when Numeric; return jd == other
when Date; return jd == other.jd
else
@takaokouji
takaokouji / MacRuby_734a27c8df4c51534eebffccab4c47107bec2583_rails_server.log
Created May 18, 2011 15:34
rails server abort log on MacRuby 734a27c8df4c51534eebffccab4c47107bec2583
$ env DYLD_LIBRARY_PATH=/Users/kouji/work/MacRuby/MacRuby gdb --args macruby -S rails server
...
=> Booting WEBrick
=> Rails 3.0.7 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Reading symbols for shared libraries . done
[2011-05-19 00:04:55] INFO WEBrick 1.3.1
[2011-05-19 00:04:55] INFO ruby 1.9.2 (2008-06-03) [universal-darwin10.0]
[2011-05-19 00:04:55] INFO WEBrick::HTTPServer#start: pid=79124 port=3000
@takaokouji
takaokouji / add-licensing-policy-and-terms_README.rdoc.patch
Created May 7, 2011 08:09
Here are our licensing policy and terms for submitting contributions to our code base(From Trac on MacOS Forge)
diff --git a/README.rdoc b/README.rdoc
index 7fe3384..e70d547 100644
--- a/README.rdoc
+++ b/README.rdoc
@@ -74,6 +74,35 @@ http://macruby.org website has pointers). Thanks!
=== Contribute
+Here are our licensing policy and terms for submitting contributions
+to our code base:
@takaokouji
takaokouji / fixed-test_vm_20110504.patch
Created May 3, 2011 15:42
fixed break, next and redo with ensure block (before refactor)
diff --git a/compiler.cpp b/compiler.cpp
index 1ae055a..55188a0 100644
--- a/compiler.cpp
+++ b/compiler.cpp
@@ -2006,12 +2006,24 @@ RoxorCompiler::compile_jump(NODE *node)
compile_landing_pad_footer();
}
if (within_loop) {
- BranchInst::Create(current_loop_end_bb, bb);
- current_loop_exit_val->addIncoming(val, bb);