Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Masanori Ohgita mugifly

🏠
Working from home
View GitHub Profile
@mugifly
mugifly / image-predict-on-tfjs-node.js
Last active May 29, 2020
Image Prediction on tfjs-node (with model made by Teachable Machine Image)
View image-predict-on-tfjs-node.js
const tf = require('@tensorflow/tfjs-node');
const Jimp = require('jimp');
// Directory path for model files (model.json, metadata.json, weights.bin)
// NOTE: It can be obtained from [Export Model] -> [Tensorflow.js] -> [Download my model]
// on https://teachablemachine.withgoogle.com/train/image
const MODEL_DIR_PATH = `${__dirname}`;
// Path for image file to predict class
const IMAGE_FILE_PATH = `${__dirname}/example.jpg`;
View imas-cinderella-girls.csv
airi-totoki 十時愛梨 passion
akane-hino 日野茜 passion
aki-yamato 大和亜季 cool
anasutashia アナスタシア cool
anzu-futaba 双葉杏 cute
arisu-tachibana 橘ありす cool
asuka-ninomiya 二宮飛鳥 cool
ayame-hamaguchi 浜口あやめ passion
chie-sasaki 佐々木千枝 cool
chieri-ogata 緒方智絵里 cute
@mugifly
mugifly / morninp.md
Last active Apr 4, 2020
Unofficial CLI command for mornin'+ (mornin' plus) smart curtain.
View morninp.md

morninp.py

Unofficial CLI command for mornin'+ (mornin' plus) smart curtain.

Requirements: Python 3, bluepy 3.2+, pycryptodome 3.6+


@mugifly
mugifly / esp-signal-lights.ino
Created Apr 26, 2019
ESP8266 + Triple Signal Lights
View esp-signal-lights.ino
// ESP8266 + 積層信号灯 (3色)
// https://gist.github.com/mugifly/
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <timer.h>
// 設定 - Wi-Fi
#define WLAN_SSID "XXXXXX"
@mugifly
mugifly / esp-1wire-temp-sensor-with-hassio.ino
Last active Mar 17, 2019
ESP8266 + DS18B20 One-Wire Temperature Sensor (Works with Hass.io)
View esp-1wire-temp-sensor-with-hassio.ino
// ESP8266 + DS18B20 One-Wire Temperature Sensor (Works with Hass.io)
// https://gist.github.com/mugifly/8e5a0aa81ca4a2485b2c2b46e0968fc6
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <timer.h>
@mugifly
mugifly / ghome-notifier-server.js
Last active Mar 27, 2019
Simplest API Server for Google Home Notifier
View ghome-notifier-server.js
/**
* Simplest API Server for Google Home Notifier
* https://gist.github.com/mugifly/22af0d55ccf4099becd44165f6500196/
* Thanks for https://github.com/noelportugal/google-home-notifier
**/
'use strict';
// Language to speak
@mugifly
mugifly / mag.md
Last active Jun 3, 2019
A simplest and unofficial client command for leafee mag (IoT sensor for doors and windows)
View mag.md

mag.py

A simplest and unofficial client command for leafee mag

Installation

It tested on Raspberry Pi Zero W with Raspbian Stretch.

$ sudo apt-get install python-pip libglib2.0-dev bluez-tools
$ sudo pip install bluepy
@mugifly
mugifly / switchbot-cmd.md
Last active Oct 20, 2020
Simplest Switchbot Command
View switchbot-cmd.md

switchbot-cmd.py

Simplest Switchbot Command

Installation

It tested on Raspberry Pi Zero W with Raspbian Stretch.

$ sudo apt-get install python-pip libglib2.0-dev bluez-tools
$ sudo pip install bluepy
@mugifly
mugifly / start-netconsole-capture.sh
Created Dec 18, 2016
Netconsole capturing script
View start-netconsole-capture.sh
#!/bin/bash
ip=` ip --oneline --family inet address show dev wlp8s0 | cut -d' ' -f7 | cut -d '/' -f1`
echo "-- Watching on ${ip}:6666 --"
nc -u -l -p 6666
@mugifly
mugifly / img-conv-for-slack-emoji
Last active May 9, 2018
Image Converter for Slack Emoji (128px) - Required: ImageMagick.
View img-conv-for-slack-emoji
#!/bin/bash
set -e
echo -e "Image Converter for Slack Emoji\nNOTICE: The image will be overwritten."
if [ $# -lt 1 ]; then
echo "USAGE:"
echo -e " ${0} IMG_FILE [IMG_FILE...]\n"
echo "IMG_FILE:"
You can’t perform that action at this time.