Skip to content

Instantly share code, notes, and snippets.

View PonDad's full-sized avatar

PonDad PonDad

View GitHub Profile
@PonDad
PonDad / web-recognized-api-sample.js
Last active January 11, 2016 07:37
Web Recognize API
recognition = new webkitSpeechRecognition();
recognition.lang = "ja-JP";
recognition.continuous = true;
recognition.start();
@PonDad
PonDad / index.php
Last active January 23, 2016 11:42
Voice Text Web API をPHPでシンプルに利用する。 ref: http://qiita.com/PonDad/items/9ec7813536f350a1023e
<?php
include 'voicetext.php';
?>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>VoiceTextWebAPI-PHP</title>
@PonDad
PonDad / example.html
Last active January 23, 2016 13:17
ブラウザで音声操作をする。(Speech Recognition API) ref: http://qiita.com/PonDad/items/4ca433ad03efbf7499a2
<textarea id="textarea" rows=10 cols=80></textarea>
<button id="button" onclick="toggleStartStop()"></button>
<script type="text/javascript">
var recognizing;
var recognition = new SpeechRecognition();
recognition.continuous = true;
reset();
recognition.onend = reset;
@PonDad
PonDad / app.js
Last active April 20, 2016 12:18
Raspberry Pi とブラウザで会話する。 ref: http://qiita.com/PonDad/items/72bfcbbe8313f46a8890
var express = require('express');
var ejs = require("ejs");
var VoiceText = require('voicetext');
var Sound = require('node-aplay');
var fs = require('fs');
var app = express();
app.engine('ejs',ejs.renderFile);
app.get('/', function(req, res){
@PonDad
PonDad / app.js
Created March 5, 2016 13:34
Samuel L 9000 Raspberry Pi
var express = require('express');
var ejs = require("ejs");
var spawn = require('child_process').spawn;
var app = express();
app.engine('ejs',ejs.renderFile);
app.get('/', function(req, res){
res.render('control.ejs',
{title: 'Samuel L 9000'});
@PonDad
PonDad / control.ejs
Created March 5, 2016 13:36
Samuel L 9000 Raspberry Pi
<!DOCTYPE html>
<html lang="ja-JP">
<head>
<meta http-equiv="content-type"
content="text/html; charset=UTF-8">
<title><%=title %></title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" type="text/css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<style>
article{
@PonDad
PonDad / samuel.ejs
Created March 5, 2016 13:38
Samuel L 9000 Raspberry Pi
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type"
content="text/html; charset=UTF-8">
<title><%=title %></title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" type="text/css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<style>
/* Header Style */
@PonDad
PonDad / index.ejs
Last active March 21, 2016 01:47
PonVision β
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type"
content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no">
<title><%= title %></title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" type="text/css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<link rel='stylesheet' href='/stylesheets/style.css' />
@PonDad
PonDad / day.coffee
Created April 3, 2016 06:40
hubot-scripts
# Description:
# 日報.
# 
# 時刻を受け取ってYYYY-mm-dd形式で返す
toYmdDate = (date) ->
Y = date.getFullYear()
m = ('0' + (date.getMonth() + 1)).slice(-2)
d = ('0' + date.getDate()).slice(-2)
return "#{Y}-#{m}-#{d}"
@PonDad
PonDad / time.coffee
Created April 3, 2016 06:43
hubot-scripts
# Description:
# 時報.
#
# Commands:
# 時刻を受け取ってhh:mm形式で返す
tohhmmTime = (date) ->
hh = ('0' + date.getHours()).slice(-2)
mm = ('0' + date.getMinutes()).slice(-2)
return "#{hh}:#{mm}"