Skip to content

Instantly share code, notes, and snippets.

View iwadon's full-sized avatar

IWATSUKI Hiroyuki iwadon

View GitHub Profile
@iwadon
iwadon / gist:13426
Created September 28, 2008 08:07 — forked from anonymous/gist:12221
module M
def subclasses
@subclasses ||= []
end
def inherited(subclass)
subclasses << subclass
end
def const_missing(name)
class A
def x
c
end
end
class B < A
def c
100
end
diff --git a/amazon-auth-proxy.cgi b/amazon-auth-proxy.cgi
index 8c12e06..3f8ddd3 100755
--- a/amazon-auth-proxy.cgi
+++ b/amazon-auth-proxy.cgi
@@ -63,11 +63,7 @@ def paapi( conf, params )
end
qs << "Signature=#{u [hash].pack( "m" ).chomp}"
- url = uri.to_s + '?' + qs * '&'
-
@iwadon
iwadon / ods.rb
Created September 11, 2009 14:43
# Based on: http://www.simplegimmick.com/2007/06/read-ods-like-csv/
require 'rubygems'
require 'nokogiri'
require 'zip/zipfilesystem'
class ODS
Error = Class.new(StandardError)
def self.open(filename)
@iwadon
iwadon / auto_patch_work.css
Created November 7, 2009 15:04
Google ChromeのextensioonであるAutoPatchWorkのスタイル。
.autopagerize_page_separator_blocks .autopagerize_link:before{
content:"page: " attr(number);
}
.autopagerize_page_separator_blocks .autopagerize_link:hover:before{
content:"";
}
.autopagerize_page_separator_blocks .autopagerize_link:hover:after{
content:attr(href);
}
{
"name": "Chrome Keyconfig",
"version": "1.9.0",
"normal_actions": {
"Esc": {
"name": "limited mode",
"args": []
},
"C-L": {
"name": "Taberareloo.link",
@iwadon
iwadon / gist:319472
Created March 2, 2010 12:26
参照の型を途中で変更するとエラーになる。
#include <iostream>
int &foo()
{
static int foo_ = 0;
return foo_;
}
int &bar()
{
--- d:/private/tools/GnuWin32/include/openssl/ossl_typ.h~ 2008-03-12 08:38:06.000000000 +0900
+++ d:/private/tools/GnuWin32/include/openssl/ossl_typ.h 2010-03-15 17:59:31.205164400 +0900
@@ -100,6 +100,8 @@ typedef int ASN1_NULL;
#undef X509_EXTENSIONS
#undef X509_CERT_PAIR
#undef PKCS7_ISSUER_AND_SERIAL
+#undef OCSP_REQUEST
+#undef OCSP_RESPONSE
#endif
@iwadon
iwadon / synergy-svn-20100327.diff
Created March 28, 2010 10:01
Synergy2へのパッチ。先人のパッチを参考にして自分に必要な修正のみ残した。ひとまずWindows XP/7とMac OS X 10.4間のやりとりが出来るのを確認してる。
Index: lib/synergy/KeyTypes.h
===================================================================
--- lib/synergy/KeyTypes.h (リビジョン 897)
+++ lib/synergy/KeyTypes.h (作業コピー)
@@ -103,6 +103,7 @@
static const KeyID kKeyScrollLock = 0xEF14;
static const KeyID kKeySysReq = 0xEF15;
static const KeyID kKeyEscape = 0xEF1B;
+static const KeyID kKeyMuhenkan = 0xEF22; /* Cancel Conversion */
static const KeyID kKeyHenkan = 0xEF23; /* Start/Stop Conversion */
@iwadon
iwadon / c.rb
Created September 19, 2010 07:33
dRuby経由で生成されたオブジェクトのinitializeメソッドがいつどこで呼び出されるかについて。
require 'drb/drb'
require_relative 'object'
require_relative 'foo'
DRb.start_service
foo_s = DRbObject.new_with_uri('druby://localhost:8787')
p foo_s
p(foo = foo_s.foo(123))