Skip to content

Instantly share code, notes, and snippets.

@siyo
siyo / index.js
Last active November 3, 2016 05:09
部屋の環境を監視しインターネットに公開するIoTソリューション (Runtime: Node.js v.4.4.x)
'use strict';
// node deps
const path = require('path');
const os = require ('os');
const fs = require('fs');
// npm deps
const noble = require('noble');
const Netatmo = require('netatmo');
@siyo
siyo / app.js
Last active January 3, 2016 18:59
pebbleのsimplyjsを使って俳句を読む奴 http://simplyjs.meiguro.com/
var config = require('config.js'),
twitter = require('twitter.js');
twitter.initialize(config.twitter);
simply.text({
title: 'Haiku tweet',
subtitle: 'press select button',
body: 'powered by http://haiku.jgate.de/'
}, true);
# -*- coding: utf-8 -*-
# Auto haiku
haikus ||= [];
Earthquake.init do
output_filter do |item|
next if item.nil? || item["text"].nil? || item["retweeted_status"]
id = item["id"]
screen_name = item["user"] ? item["user"]["screen_name"] : nil
myname = twitter.info["screen_name"]
;;------------------------------------------------------------------------------
;; helm
;;------------------------------------------------------------------------------
(require 'helm-config)
(require 'helm-command)
(require 'helm-descbinds)
(require 'helm-ls-git)
(require 'helm-imenu)
(require 'helm-gtags)
# -*- coding: utf-8 -*-
require 'moji'
Earthquake.init do
command :kensaku do |m|
str = m[1] + " " * 3
body = Moji.han_to_zen str
len = body.size
head = "━" * len
tail = "━" * len
# -*- coding: utf-8 -*-
Earthquake.init do
output_filter do |item|
next unless item["user"] && item["text"]
account = item["user"]["screen_name"]
id = item["id"]
txt = item["text"]
res = %w|おいしそう うまそう わたしも食べたい〜 美味しそう|
Earthquake.init do
command %r|^:hisaichi\s+(.+)$|, :as => :hisaichi do |m|
str = URI.escape(m[1])
response = Net::HTTP.get('www11268ue.sakura.ne.jp','/generator?text=' + str, 5001)
strings = JSON.parse(response)["text"]
input(strings)
end
end
# http://hisaichi5518.hatenablog.jp/entry/2013/07/09/111503
@siyo
siyo / mugon.rb
Last active December 19, 2015 02:39
# -*- coding: utf-8 -*-
Earthquake.init do
command %r|^:mugon\s*([^\d]+)*\s*(\d+)*|,:as=> :mugon do |m|
str = m[1] ? m[1] : ''
input(str + "”““’’‘‘" * (m[2] ? m[2].to_i : 1))
end
end
<!Doctype html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>angle meter sample</title>
<style type="text/css">
.container{
width: 200px;
text-align: center;
padding: 20px;
# -*- coding: utf-8 -*-
# update installed plugins / earthquake plugin
#
# Usage:
# $ :update_installed_plugins
#
Earthquake.init do
command :update_installed_plugins do
Dir.glob(File.dirname(__FILE__) + "/*.rb").each{|rb|
open(rb){|f|