Skip to content

Instantly share code, notes, and snippets.

import copy
from tqdm import tqdm
# ODリストを取得する
def getODs(list):
results = []
# 並び順の候補を取得する
for o in removeDuplicates(getOrders(list)):
# 経路を作成
idea = idea0
while idea is not None:
idea = learn(measure(build(idea)))
nikotan /
Last active Jan 4, 2019
Python script for AWS lambda to forward AWS IoT 1-Click event to IFTTT
import json
import os
import urllib.request
import logging
logger = logging.getLogger(__name__)
def lambda_handler(event, context):
nikotan /
Last active May 26, 2018
Python script for server side of IoT BOT to monitor BLE tags (for AWS lambda)
# -*- coding: utf-8 -*-
from datetime import datetime, timedelta, timezone
import boto3
from boto3.session import Session
from boto3.dynamodb.conditions import Key
def lambda_handler(event, context):
nikotan / BLETagMonitor_esp32.ino
Last active Jan 1, 2019
IoT BOT to monitor BLE tags using ESP32
View BLETagMonitor_esp32.ino
#include <codecvt>
#include <string>
#include <cassert>
#include <locale>
#include <esp_system.h>
#include <rom/rtc.h>
#include <EEPROM.h>
#include <WiFi.h>
nikotan / esp8266_PostMonitor.ino
Created Apr 30, 2018
IoT BOT to monitor mailbox using ESP8266 and tilt switch
View esp8266_PostMonitor.ino
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
#define DEBUG
#define PIN_LED 4
#define SSID "{your_ssid}"
#define PASSWORD "{your_password}"
#define IFTTT_HOST ""
#define IFTTT_PATH "/trigger/{your_event}/with/key/{your_key}"
nikotan / nikobot.lua
Last active Apr 9, 2016
LINE BOT API sample code on (with Microsoft Translator Text API)
View nikobot.lua
-- setting
local mstr_cid = 'client_id for microsoft translator text api'
local mstr_secret = 'client_secret for microsoft translator text api'
local line_id = 'Channel ID for LINE BOT API'
local line_secret = 'Channel Secret for LINE BOT API'
local line_mid = 'MID for LINE BOT API'
-- function: mstr
function mstr(text, cid, secret)
local lom = require 'lxp.lom'
nikotan / main.cpp
Created Aug 16, 2011
face detection sample code for OpenCV
View main.cpp
#include <opencv/cv.h>
#include <opencv/highgui.h>
#include <opencv/ml.h>
void doMosaic(IplImage* in, int x, int y,
int width, int height, int size);
int main (int argc, char **argv)
int i, c;
#!/usr/bin/env perl
use strict;
use warnings;
use File::HomeDir;
use Path::Class qw(dir);
use DBI;
my $home = File::HomeDir->my_home;
You can’t perform that action at this time.