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
def emit(tag, es, chain) | |
@emit_count += 1 | |
es.each {|time,record| | |
tc = time / @time_slice_cache_interval // ここでコケる | |
if @before_tc == tc | |
key = @before_key | |
else | |
@before_tc = tc | |
key = @time_slicer.call(time) | |
@before_key = key |
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
2014-02-20 20:25:16 +0900 [warn]: emit transaction failed error_class=NoMethodError error=#<NoMethodError: undefined method `/' for 2014-02-20 20:25:16 +0900:Time> | |
2014-02-20 20:25:16 +0900 [warn]: /usr/lib64/fluent/ruby/lib/ruby/gems/1.9.1/gems/fluentd-0.10.41/lib/fluent/output.rb:515:in `block in emit' | |
2014-02-20 20:25:16 +0900 [warn]: /usr/lib64/fluent/ruby/lib/ruby/gems/1.9.1/gems/fluentd-0.10.41/lib/fluent/event.rb:54:in `call' | |
2014-02-20 20:25:16 +0900 [warn]: /usr/lib64/fluent/ruby/lib/ruby/gems/1.9.1/gems/fluentd-0.10.41/lib/fluent/event.rb:54:in `each' | |
2014-02-20 20:25:16 +0900 [warn]: /usr/lib64/fluent/ruby/lib/ruby/gems/1.9.1/gems/fluentd-0.10.41/lib/fluent/output.rb:513:in `emit' | |
2014-02-20 20:25:16 +0900 [warn]: /usr/lib64/fluent/ruby/lib/ruby/gems/1.9.1/gems/fluentd-0.10.41/lib/fluent/match.rb:36:in `emit' | |
2014-02-20 20:25:16 +0900 [warn]: /usr/lib64/fluent/ruby/lib/ruby/gems/1.9.1/gems/fluentd-0.10.41/lib/fluent/engine.rb:151:in `emit_stream' | |
2014-02-20 20:25:16 +0900 [war |
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
def run_periodic | |
until @finished | |
begin | |
sleep @receive_interval | |
@queue.receive_message do |message| | |
record = {} | |
record[:body] = message.body.to_s | |
record[:handle] = message.handle.to_s | |
record[:id] = message.id.to_s | |
record[:md5] = message.md5.to_s |
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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Web::Query; | |
use WebService::ImKayac::Simple; | |
use Log::Minimal; | |
# 自分のImKayacのアカウント |
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
from fabric.api import * | |
env.user = 'vagrant' | |
env.password = 'vagrant' | |
# enable .ssh/config | |
#env.use_ssh_config = True | |
def develop(): | |
env.hosts = ['localhost', '127.0.0.1' ] |
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
<html> | |
<body> | |
<p>aaaa</p> | |
</body> | |
</html> |
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
{ | |
"name": "hoge", | |
"version": "0.1", | |
"description": "ブコメページへ", | |
"icons": { | |
"128": "hoge.png" | |
}, | |
"background_page": "background.html", | |
"browser_action": { | |
"default_title": "hoge", |
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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="utf-8"> | |
<script> | |
chrome.browserAction.onClicked.addListener(function(tab) { | |
chrome.windows.get(tab.windowId, function(window) { | |
if (window.focused) { | |
var jump_url = "http://b.hatena.ne.jp/entry/"+tab.url; | |
chrome.tabs.update(tab.id, {url: jump_url, selected: tab.selected}, null); |
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
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script> | |
</head> | |
<body> | |
<p><a href="http://www.yahoo.co.jp/">yahoo</a></p> | |
<p><a href="http://www.google.co.jp/">google</a></p> |
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 Encode; | |
$hoge = "あかさたな"; | |
print "まっち" if($hoge =~ /\w/); # 出力されない | |
$hoge = decode('utf8', "あかさたな"); | |
print "マッチ" if($hoge =~ /\w/); # 'マッチ' | |
OlderNewer