Skip to content

Instantly share code, notes, and snippets.

View taiyoh's full-sized avatar
🍇

taiyoh taiyoh

🍇
View GitHub Profile
package main
/*
#include <stdio.h>
void test(unsigned char* b) {
printf("fetch: %s\n", b);
b[0] = 'b';
b[1] = 'a';
b[2] = 'r';
}
#!/bin/sh
GYAZO_HOST="example.com"
GYAZO_PORT=8080
GYAZO_PATH="/foo/bar"
NOW=`date +"%s"`
TMPFILE="/tmp/$NOW.jpg"
gnome-screenshot --area --file $TMPFILE 2> /dev/null
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 = [