Skip to content

Instantly share code, notes, and snippets.

View shirosaki's full-sized avatar

Hiroshi Shirosaki shirosaki

View GitHub Profile
--- modules/plugins/enigmail.js 2011-08-25 11:56:45.281250000 +0900
+++ ../enigmail.js 2011-08-25 13:23:38.640625000 +0900
@@ -112,7 +112,7 @@
}
}, false);
-function tryEnigmail(bodyElement) {
+function tryEnigmail(bodyElement, aMsgWindow) {
if (bodyElement.textContent.indexOf("-----BEGIN PGP") < 0)
return null;
@shirosaki
shirosaki / gist:1183468
Created August 31, 2011 12:56
fix inline PGP quoted text
--- origin/modules/plugins/enigmail.js 2011-08-29 09:48:13.000000000 +0900
+++ gconversation@xulforum.org/modules/plugins/enigmail.js 2011-08-31 21:37:11.000000000 +0900
@@ -179,6 +179,7 @@
"<div class='moz-text-plain' wrap='true' graphical-quote='true'>"
+ EnigmailFuncs.formatPlaintextMsg(msgRfc822Text)
+ "</div>";
+ replaceTextNodeToPre(bodyElement);
}
return statusFlagsObj.value;
}
@shirosaki
shirosaki / fix_send.js
Created September 10, 2011 06:14
add enigmail feature to quick reply
diff --git a/send.js b/send.js
index f62ad60..b05ce57 100644
--- a/send.js
+++ b/send.js
@@ -192,6 +192,7 @@ function initCompose(aMsgComposeService, aParams, aWindow, aDocShell) {
* @param composeParameters.returnReceipt (optional)
* @param composeParameters.receiptType (optional)
* @param composeParameters.requestDsn (optional)
+ * @param composeParameters.securityInfo (optional)
*
@shirosaki
shirosaki / fenix.patch
Created November 27, 2011 17:56
profile result of tcs-ruby
diff --git a/common.mk b/common.mk
index ea244cc..55b6f46 100644
--- a/common.mk
+++ b/common.mk
@@ -93,6 +93,8 @@ COMMONOBJS = array.$(OBJEXT) \
vm_dump.$(OBJEXT) \
thread.$(OBJEXT) \
cont.$(OBJEXT) \
+ fenix.$(OBJEXT) \
+ fenix_file.$(OBJEXT) \
@shirosaki
shirosaki / file_access.patch
Created December 5, 2011 09:39
tma sample
diff --git a/samples/file_access.cpp b/samples/file_access.cpp
new file mode 100644
index 0000000..1ea02e3
--- /dev/null
+++ b/samples/file_access.cpp
@@ -0,0 +1,108 @@
+#include <ios>
+#include <iostream>
+#include <ostream>
+#include <iomanip>
@shirosaki
shirosaki / file_load_ok.patch
Created December 6, 2011 05:37
file_load_ok performance improvement for Windows
diff --git a/file.c b/file.c
index e566ce3..516225d 100644
--- a/file.c
+++ b/file.c
@@ -5060,7 +5060,33 @@ static int
file_load_ok(const char *path)
{
int ret = 1;
- int fd = open(path, O_RDONLY);
+ int fd;
diff --git a/file.c b/file.c
index e566ce3..24b25b8 100644
--- a/file.c
+++ b/file.c
@@ -5060,7 +5060,38 @@ static int
file_load_ok(const char *path)
{
int ret = 1;
- int fd = open(path, O_RDONLY);
+ int fd;
@shirosaki
shirosaki / bench_result.txt
Created December 13, 2011 15:38
Replace lstat to GetFileAttributes
ruby 2.0.0dev (2011-12-09 trunk 33995) [i386-mingw32]
Windows 7 on VirtualBox
2.4GHz Core 2 Duo
Rails 3.1.3
command: ruby script/rails r "p 1"
Average and standard deviation of 10 times trials
+----------+--------+----------+---------+
CPU: Intel Core 2 Duo 6600 2.40GHz
RAM: 4 GB
HDD: On Ramdisk 1.1GB using ImDisk
AV: Off
OS: Windows XP SP3
# This was run before replacing rb_file_expand_path() to funcall() in rb_expand_load_paths() of load.c.
V:\test_rails>set RUBY_USE_ATTRIBUTE=1
V:\test_rails>set RUBY_CACHED_LOAD_PATH=0
@shirosaki
shirosaki / bar_chart.rb
Created December 24, 2011 07:01
Timing chart
#!/usr/bin/env ruby
#
# https://github.com/mattetti/googlecharts
# http://mattetti.github.com/googlecharts/
#
# Install:
# gem install googlecharts
#
# GitHub Flavord Markdown:
# ![chart title](http://chart.apis.google.com/chart?...)