Skip to content

Instantly share code, notes, and snippets.

===== 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
===== 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
'use strict';
var msgpack5 = require('msgpack5')();
var msgpack = require('msgpack');
var msgpackLite = require('msgpack-lite');
var obj = {
a: 1,
b: 'aaaaaaaaaa',
c: true,
};
@okkez
okkez / Makefile
Created September 12, 2015 13:16
Gtkでマウスカーソルに追従するツールチップの作り方 ref: http://qiita.com/okkez@github/items/8b425c821bd40e5390fe
build: main.c
gcc $< -Wall -o main `pkg-config --cflags --libs gtk+-2.0 cairo`
@okkez
okkez / test-suite.log.txt
Created June 5, 2013 07:32
milter-manager make check with Ruby2.0.0-p195
===============================================
milter-manager 1.8.7: test/test-suite.log
===============================================
# TOTAL: 1
# PASS: 0
# SKIP: 0
# XFAIL: 0
# FAIL: 1
# XPASS: 0
@okkez
okkez / ObjectSpace.diff
Created March 27, 2012 09:48
ふぁいならいざー
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
@okkez
okkez / Rakefile
Created January 6, 2012 07:42
A sample of generating HTML with haml.
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

Ruby Encoding Cheat Sheet

  1. BINARY な文字列を使うときだけ force_encoding しなさい。
  2. ネットワークかファイルシステムから BINARY な文字列を受け取ったとき は、確実に正しいエンコーディングに force_encode しなさい。
    • 一般的に、HTTP における Content-Type ヘッダのようなもので ネットワークから受け取った BINARY な文字列のエンコーディング 情報は与えられている。
    • エンーコーディングがわからないときは、その文字列はずっと BINARY で扱いなさい。BINARY でない文字列との結合なんてし
@okkez
okkez / result.txt
Created April 17, 2010 16:07
return benchmark
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)
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)