Skip to content

Instantly share code, notes, and snippets.

const Alexa = require('ask-sdk-core');
// 立ち上げ時に呼ばれる
const LaunchRequestHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'LaunchRequest';
},
handle(handlerInput) {
const speechText = 'ようこそ、アレクサスキルキットへ。こんにちは、と言ってみてください。';
@okn3
okn3 / gist:c9885780be0da4897fd3a5bca6bc213f
Last active June 25, 2017 21:15
LINE NOTIFY python3
"""
LINE NotifyをPythonから使う
"""
import requests
import sys
url = "https://notify-api.line.me/api/notify"
message = sys.argv[1]
params = {"message" : message}
token = "tokennnnnnnnnnnnnnnn"
@okn3
okn3 / gist:9d9634268ab540b0377a
Created February 20, 2016 07:53
IoTハッカソン o202用
#include "DHT.h"
#define DHTPIN 2
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
void setup() {
Serial.begin(9600);
Serial.println("DHT11 test!");
dht.begin();
@okn3
okn3 / gist:ddf3e52a41c40bbf658f
Created February 15, 2016 04:59
超音波距離センサで取得した値をLCDで表示
/*
HC-SR04 Ping distance sensor]
VCC to arduino 5v GND to arduino GND
Echo to Arduino pin 9 Trig to Arduino pin 8
More info at: http://goo.gl/kJ8Gl
*/
#include <Wire.h>
#include <ST7032.h>
/*
HC-SR04 Ping distance sensor]
VCC to arduino 5v GND to arduino GND
Echo to Arduino pin 9 Trig to Arduino pin 8
More info at: http://goo.gl/kJ8Gl
*/
#define trigPin 8
#define echoPin 9
const int speakerPin = 11;
@okn3
okn3 / gist:cfbc86e72e029713e4c8
Last active February 17, 2016 03:47
AQM0802A サンプル
/*
ST7032 I2C LCD control sample
Original source : HelloWorld.ino (LiquidCrystal Library)
2013/05/21 tomozh@gmail.com
*/
/*
LiquidCrystal Library - Hello World
Demonstrates the use a 16x2 LCD display. The LiquidCrystal
@okn3
okn3 / gist:0d36f04d904365b5c9be
Created February 15, 2016 01:59
arduinoピエゾスピーカーサンプル
#define BEAT 300 // 音の長さを指定
#define PINNO 12 // 圧電スピーカを接続したピン番号
void setup() {
}
void loop() {
tone(PINNO,262,BEAT) ; // ド
delay(BEAT) ;
tone(PINNO,294,BEAT) ; // レ
delay(BEAT) ;
@okn3
okn3 / gist:fd86c226172dc8ee928b
Created October 16, 2015 06:35
adapter.wsgi
import sys
import os
dirpath = os.path.dirname(os.path.abspath(__file__))
sys.path.append(dirpath)
# Change working directory so relative paths (and template lookup) work again
os.chdir(os.path.dirname(__file__))
import bottle
# ... build or import your bottle application here ...
@okn3
okn3 / gist:20249e4836ab42710f7e
Created October 16, 2015 06:09
vimrc設定 okuno
" --------------------------
" Start Neobundle Settings.
" ---------------------------
" bundleで管理するディレクトリを指定
set runtimepath+=~/.vim/bundle/neobundle.vim/
" Required:
call neobundle#begin(expand('~/.vim/bundle/'))
" neobundle自体をneobundleで管理
@okn3
okn3 / gist:7efc5647654b6a9d4134
Created October 16, 2015 06:02
mod_wsgi設定
# mod_wsgi config
WSGIDaemonProcess @@@@@ user=www-data group=www-data processes=1 threads=5
WSGIScriptAlias /@@@@ /var/www/@@@@/adapter.wsgi
<Directory /var/www/@@@@>
WSGIProcessGroup @@@@
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log