Skip to content

Instantly share code, notes, and snippets.

View yutaka-oiwa-pubkey-2008-pgpdump.txt
% ruby -Ilib bin/pgpdump.rb yutaka-oiwa-pubkey-2008.asc
Old: Public Key Packet(tag 6)(1198 bytes)
Algorithm: DSA (Digital Signature Standard)(17)
Key Created: Mon Jun 23 16:02:21 +0900 2008
DSA Key (256 bits)
p (3072 bits)
q (256 bits)
g (3072 bits)
y (3071 bits)
Old: User ID Packet(tag 13)(28 bytes)
View ruby_1_8_monitor.diff
Index: lib/monitor.rb
===================================================================
--- lib/monitor.rb (revision 23996)
+++ lib/monitor.rb (working copy)
@@ -288,11 +288,15 @@
@mon_owner = Thread.current
end
+ # mon_release requires Thread.critical == true
def mon_release
View granarch-seminar2.txt
subject=野村総合研究所主催 GranArchセミナー 申込みフォーム
body=●希望日:7/24(金)
●貴社名:
●貴社住所:
●部署名:
View transcript.txt
0% irb19
irb(main):001:0> require 'prime'
=> true
irb(main):002:0> 4207869677.prime_division
=> [[11, 1], [382533607, 1]]
irb(main):003:0> 382533607.prime_division
=> [[382533607, 1]]
irb(main):004:0> a = 4207869677
=> 4207869677
irb(main):005:0> a.to_s.reverse.to_i
View gist:183674
# 怪しいコード
pinned = Pin.find(
:all,
:conditions => [ 'user_id = ?', auth.id ],
:joins => 'LEFT OUTER JOIN last_modifieds ON pins.eid = last_modifieds.eid',
:order => 'last_modifieds.date desc',
:offset => start,
:limit => num
)
View gist:183701
diff --git a/app/models/feed.rb b/app/models/feed.rb
index bbc2719..4a4423a 100644
--- a/app/models/feed.rb
+++ b/app/models/feed.rb
@@ -308,8 +308,8 @@ class Feed
num = opt[:num]
pinned = Pin.find(
:all,
- :conditions => [ 'user_id = ?', auth.id ],
- :joins => 'LEFT OUTER JOIN last_modifieds ON pins.eid = last_modifieds.
View gist:214325
Index: ext/openssl/lib/openssl/buffering.rb
===================================================================
--- ext/openssl/lib/openssl/buffering.rb (revision 25414)
+++ ext/openssl/lib/openssl/buffering.rb (working copy)
@@ -55,12 +55,7 @@
def read(size=nil, buf=nil)
if size == 0
- if buf
- buf.clear
View gist:222278
「再来週火曜日にお願いしたい」ということになりました。つまり、「準備も予習も何もせずに始めてしまうROMA勉強会」別名「ROMAをダラっと勉強する会」を、次回asakusa.rbの中でやらせていただきたいです。
Matsudaさん、よろしくお願いします。永和様、場所をお借りいたします。お世話になります。
笹田さん、せっかくの申し出でしたのに申し訳ありません。別の機会によろしくお願いします。
決まっていること。
開催日: 11/10(火) 19:30~適当
目的: 準備も予習も何もせずにROMAをダラっと勉強する
View gist:223278
0% ruby -d -r open-uri -e 'p open("https://www.rsa.com/", :ssl_ca_cert => "/usr/local/lib/ruby/site_ruby/1.8/httpclient/cacert.p7s").read'
Exception `OpenSSL::SSL::SSLError' at /usr/local/lib/ruby/1.8/net/http.rb:586 - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
/usr/local/lib/ruby/1.8/net/http.rb:586:in `connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)
from /usr/local/lib/ruby/1.8/net/http.rb:586:in `connect'
from /usr/local/lib/ruby/1.8/net/http.rb:553:in `do_start'
from /usr/local/lib/ruby/1.8/net/http.rb:542:in `start'
from /usr/local/lib/ruby/1.8/open-uri.rb:297:in `open_http'
from /usr/local/lib/ruby/1.8/open-uri.rb:739:in `buffer_open'
from /usr/local/lib/ruby/1.8/open-uri.rb:194:in `open_loop'
from /usr/local/lib/ruby/1.8/open-uri.rb:192:in `catch'
View JRubyStartupTime.txt
0% uname -a
Linux localhost 2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:04:26 UTC 2009 i686 GNU/Linux
0% time java -version
java version "1.6.0_16"
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode, sharing)
java -version 0.00s user 0.06s system 31% cpu 0.206 total
0% time jruby -v -e 0