Skip to content

Instantly share code, notes, and snippets.

View kotobuki's full-sized avatar

Shigeru Kobayashi kotobuki

  • Institute of Advanced Media Arts and Sciences [IAMAS]
  • X @kotobuki
View GitHub Profile
@kotobuki
kotobuki / gist:1489194
Created December 17, 2011 04:30
Examples for Aniomagic's Sparkle
; 常に繰り返す
(always
; ここに繰り返す処理を書く
)
; 条件判断
(always
(if (条件)
(条件に合致した時に行われる処理)
)
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>Meshblu Subscriber</title>
<script src="http://meshblu.octoblu.com/js/meshblu.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script>
var conn = meshblu.createConnection({
"uuid": "********-****-****-****-************",
@kotobuki
kotobuki / IFTTT_Action_Beebotte
Last active March 7, 2016 09:44
IFTTTのトリガーおよびアクションをESP8266で実行する ref: http://qiita.com/mayfair/items/e761c788a9d8787bc610
#include <ESP8266WiFi.h>
// PubSubClientライブラリでのパケットサイズは128バイトなのを拡張
#define MQTT_MAX_PACKET_SIZE 1024
#include <PubSubClient.h>
#include <ArduinoJson.h>
#include "config.h"
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=JP
network={
ssid="YOUR_SSID"
psk="YOUR_PASS"
key_mgmt=WPA-PSK
}
# Original: https://people.csail.mit.edu/hubert/pyaudio/
# Modified to be tested on a Raspberry Pi
"""PyAudio example: Record a few seconds of audio and save to a WAVE file."""
import pyaudio
import wave
CHUNK = 1024
FORMAT = pyaudio.paInt16
@kotobuki
kotobuki / サンプル1
Last active January 12, 2017 08:17
スプレッドシートに記入された値をチャートにして定期的にメールで送信する ref: http://qiita.com/mayfair/items/997bc2a950def4e32c02
function onDailyTimeBasedTrigger(event) {
// 現在ブラウザで開いているシートを取得する
var sheet = SpreadsheetApp.getActiveSheet();
// スクリプトのプロパティからメールの受信者を取得
var scriptProperties = PropertiesService.getScriptProperties();
var recipient = scriptProperties.getProperty('recipient');
// トリガーを削除
deleteTrigger();
POST https://my-service.com/action
Headers:
Content-type: application/json
POST body:
{
"lang": "en",
"status": {
"errorType": "success",
@kotobuki
kotobuki / script.js
Last active August 15, 2018 02:18
XOR
// Reference
// https://github.com/mattcam/tfjs_xor_example
const model = tf.sequential();
model.add(tf.layers.dense({ units: 10, activation: "sigmoid", inputShape: [2] }));
model.add(tf.layers.dense({ units: 1, activation: "sigmoid" }));
model.compile({ optimizer: "rmsprop", loss: "meanSquaredError" });
const trainingData = tf.tensor2d([[0, 0], [0, 1], [1, 0], [1, 1]]);
const targetData = tf.tensor2d([[0], [1], [1], [0]]);
@kotobuki
kotobuki / ifttt-trigger.markdown
Last active October 14, 2018 06:50
IFTTT Trigger
@kotobuki
kotobuki / grad-cam-wip.markdown
Last active August 20, 2018 03:42
Grad-CAM [WIP]