Skip to content

Instantly share code, notes, and snippets.

@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
@okkez
okkez / ObjectSpace.diff
Created March 27, 2012 09:48
ふぁいならいざー
commit 61fd8266fbd82248e4698c5fb5a5b3860ed9f758
Author: Kenji Okimoto <[email protected]>
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 / 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 / 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`
'use strict';
var msgpack5 = require('msgpack5')();
var msgpack = require('msgpack');
var msgpackLite = require('msgpack-lite');
var obj = {
a: 1,
b: 'aaaaaaaaaa',
c: true,
};
===== 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
===== 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
[Coveralls] Set up the SimpleCov formatter.
[Coveralls] Using SimpleCov's default settings.
Loaded suite /home/kenji/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rake-11.1.2/lib/rake/rake_test_loader
Started
........................................E
===============================================================================
Error: test_writes_to_logstash_index(ElasticsearchOutput): NoMethodError: undefined method `to_msgpack' for 2015-06-01 08:00:01 +0900:Time
/home/kenji/ruby/td-family/fluent-plugin-elasticsearch/lib/fluent/plugin/out_elasticsearch.rb:174:in `to_msgpack'
/home/kenji/ruby/td-family/fluent-plugin-elasticsearch/lib/fluent/plugin/out_elasticsearch.rb:174:in `format'
/home/kenji/ruby/td-family/fluentd/lib/fluent/mixin.rb:124:in `block in format_stream'
[Coveralls] Set up the SimpleCov formatter.
[Coveralls] Using SimpleCov's default settings.
Loaded suite /home/kenji/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rake-11.1.2/lib/rake/rake_test_loader
Started
..............................................................E
===============================================================================
Error: test_adds_logstash_timestamp_when_configured(ElasticsearchOutputDynamic): TypeError: no implicit conversion of nil into String
/home/kenji/Data/ruby/td-family/fluent-plugin-elasticsearch/lib/fluent/plugin/out_elasticsearch_dynamic.rb:130:in `eval'
/home/kenji/Data/ruby/td-family/fluent-plugin-elasticsearch/lib/fluent/plugin/out_elasticsearch_dynamic.rb:130:in `block in write'
/home/kenji/Data/ruby/td-family/fluentd/lib/fluent/event.rb:194:in `each'
@okkez
okkez / Gemfile
Created November 28, 2016 08:27
Benchmark for libmaxmind bindings
source "https://rubygems.org"
gem "maxmind_geoip2"
gem "maxminddb"
gem "hive_geoip2"
gem "geoip2_compat"
gem "geoip-c", require: "geoip"