Skip to content

Instantly share code, notes, and snippets.

View taiyoh's full-sized avatar
👶

taiyoh taiyoh

👶
View GitHub Profile
Earthquake.init do
command :url_show do |m|
url = case m[1]
when /^\d+$/
"https://twitter.com/#{twitter.status(m[1])['user']['screen_name']}/status/#{m[1]}"
else
"https://twitter.com/#{m[1][/[^'"]+/]}"
end
ap url
end
# -*- coding: utf-8 -*-
# notification of im.kayac.com
# im.kayac.com経由で通知する
require 'im-kayac'
username = "foobar"
sig = "abababababa"
#!perl
use strict;
use warnings;
use utf8;
use FindBin;
use File::Temp 'tempfile';
use LWP::UserAgent;
use Digest::SHA1 'sha1_hex';
#!/usr/bin/env perl
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/../lib";
use Data::AnomalyDetect;
@taiyoh
taiyoh / myoutput.rb
Last active December 19, 2015 03:58
# -*- coding: utf-8 -*-
# my output settings
# 出力方法をこちらで決定する
Earthquake.init do
output :tweet do |item|
next unless item["text"]
info = []
@taiyoh
taiyoh / client.js
Last active December 17, 2015 17:49
lirc_webにつなぎっぱにしてイベントを待つプロセス
//
// lirc_web
// v0.0.4
// Alex Bain <alex@alexba.in>
//
// Requirements
//
var lirc_node = require('lirc_node'),
consolidate = require('consolidate'),
@taiyoh
taiyoh / app.js
Last active December 17, 2015 17:49
lirc_webのapp.jsの一部をこんな感じで書き換えた
app.get('/api/stream', function(req, res) {
console.log('connection catched');
var sock = req.socket;
conns[sock.fd] = sock;
res.on('close', function() {
delete conns[sock.fd];
console.log('disconnected: ' + Object.keys(conns).join(", "));
});
sock.on('close', function() {
delete conns[sock.fd];
# Description:
# 話しかけたら反応します.
#
# Commands:
# hubot 〜〜〜 - ask him!
#
# Notes:
# DON'T DELETE THIS SCRIPT!
rules = [
#!/usr/bin/env node
var io = require('socket.io-client')
, argv = require('optimist').argv
, w, c, h, u;
w = argv.w, c = argv.c, h = argv.h, u = argv.u;
w = w || 500; // value for "WARNING" notification
c = c || 4000; // value for "CRITICAL" notification
package MyApp::Util::Controller;
use strict;
use warnings;
use Class::Method::Modifiers ();
use Module::Functions;
my %FUNCTIONS;