- BINARY な文字列を使うときだけ
force_encoding
しなさい。 - ネットワークかファイルシステムから BINARY な文字列を受け取ったとき
は、確実に正しいエンコーディングに
force_encode
しなさい。- 一般的に、HTTP における Content-Type ヘッダのようなもので ネットワークから受け取った BINARY な文字列のエンコーディング 情報は与えられている。
- エンーコーディングがわからないときは、その文字列はずっと BINARY で扱いなさい。BINARY でない文字列との結合なんてし
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
===== master 8f0c1c7 ===== | |
5.61s user 0.00s system 100% cpu 5.600 total | |
17.11s user 0.02s system 100% cpu 17.098 total | |
3.96s user 0.00s system 100% cpu 3.959 total | |
1.64s user 0.03s system 99% cpu 1.665 total | |
===== use-stack-directry ===== | |
5.08s user 0.00s system 100% cpu 5.072 total | |
17.03s user 0.03s system 100% cpu 17.031 total | |
4.13s user 0.00s system 100% cpu 4.123 total | |
1.60s user 0.02s system 100% cpu 1.626 total |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
===== master 8f0c1c7 ===== | |
./bin/mruby benchmark/bm_ao_render.rb | |
real 13.01 | |
user 13.03 | |
sys 0.00 | |
./bin/mruby benchmark/bm_app_lc_fizzbuzz.rb | |
real 33.00 | |
user 33.01 | |
sys 0.03 | |
./bin/mruby benchmark/bm_fib.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var msgpack5 = require('msgpack5')(); | |
var msgpack = require('msgpack'); | |
var msgpackLite = require('msgpack-lite'); | |
var obj = { | |
a: 1, | |
b: 'aaaaaaaaaa', | |
c: true, | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
build: main.c | |
gcc $< -Wall -o main `pkg-config --cflags --libs gtk+-2.0 cairo` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=============================================== | |
milter-manager 1.8.7: test/test-suite.log | |
=============================================== | |
# TOTAL: 1 | |
# PASS: 0 | |
# SKIP: 0 | |
# XFAIL: 0 | |
# FAIL: 1 | |
# XPASS: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit 61fd8266fbd82248e4698c5fb5a5b3860ed9f758 | |
Author: Kenji Okimoto <okimoto@clear-code.com> | |
Date: Tue Mar 27 17:08:55 2012 +0900 | |
remove undefine ObjectSpace singleton methods for Ruby 1.9.1 and later. | |
diff --git a/refm/api/src/_builtin/ObjectSpace b/refm/api/src/_builtin/ObjectSpace | |
index 5f26bf1..912215c 100644 | |
--- a/refm/api/src/_builtin/ObjectSpace | |
+++ b/refm/api/src/_builtin/ObjectSpace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'haml' | |
require 'rake/clean' | |
SRC = FileList["haml/*.haml"].exclude("haml/layout.haml") | |
TARGET = SRC.ext(".html") | |
CLEAN.push(TARGET.sub("haml/", "html/")) | |
rule ".html" => ".haml" do |t| | |
engine = Haml::Engine.new(File.read('haml/layout.haml')) | |
scope = Object.new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby 1.8.0 (2003-08-04) [x86_64-linux] | |
Rehearsal --------------------------------------------- | |
return 0.416667 0.000000 0.416667 ( 0.254624) | |
no return 0.316667 0.000000 0.316667 ( 0.185749) | |
return 0.433333 0.000000 0.433333 ( 0.264098) | |
no return 0.383333 0.000000 0.383333 ( 0.224070) | |
------------------------------------ total: 1.550000sec | |
user system total real | |
return 0.366667 0.000000 0.366667 ( 0.226396) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/plugins/defaults/retweet.rb b/lib/plugins/defaults/retweet.rb | |
index b2db68d..e07d152 100644 | |
--- a/lib/plugins/defaults/retweet.rb | |
+++ b/lib/plugins/defaults/retweet.rb | |
@@ -33,6 +33,7 @@ module Termtter::Client | |
comment += ' ' unless comment.nil? | |
rt_or_qt = (config.plugins.retweet.quotetweet and comment) ? 'QT' : 'RT' | |
text = ERB.new(config.plugins.retweet.format).result(binding) | |
+ get_hooks(:modify_status_for_retweet).each{|hook| text = hook.call(text) || '' } | |
Termtter::API.twitter.update(text) |