Skip to content

Instantly share code, notes, and snippets.

@siyo
siyo / index.js
Last active Nov 3, 2016
部屋の環境を監視しインターネットに公開するIoTソリューション (Runtime: Node.js v.4.4.x)
View index.js
'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 / index.html
Last active Aug 29, 2015
zanzou-ken cam
View index.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<style type="text/css">
body {
Background: #222;
}
@siyo
siyo / app.js
Last active Jan 3, 2016
pebbleのsimplyjsを使って俳句を読む奴 http://simplyjs.meiguro.com/
View app.js
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);
View auto_haiku.rb
# -*- 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"]
View myhelm.el
;;------------------------------------------------------------------------------
;; helm
;;------------------------------------------------------------------------------
(require 'helm-config)
(require 'helm-command)
(require 'helm-descbinds)
(require 'helm-ls-git)
(require 'helm-imenu)
(require 'helm-gtags)
View kensaku.rb
# -*- 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
View miil_taisaku.rb
# -*- 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|おいしそう うまそう わたしも食べたい〜 美味しそう|
View hisaichi_tweet.rb
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
View mugon.rb
# -*- 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
View anglemeter.html
<!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;
You can’t perform that action at this time.