Skip to content

Instantly share code, notes, and snippets.

Avatar
👾

Kajiru sdkfz181tiger

👾
View GitHub Profile
@sdkfz181tiger
sdkfz181tiger / main.js
Last active January 3, 2023 09:04
windowの"focus/blur"を利用した音声ファイルの再生/停止
View main.js
//==========
// Howler.jsを利用
// https://howlerjs.com/
const myHowl = new MyHowler();
window.addEventListener("focus", e=>{
console.log("focus");
if(myHowl) myHowl.resumeBGM();
});
@sdkfz181tiger
sdkfz181tiger / main.c
Last active December 25, 2022 14:54
WebAssembly基礎
View main.c
#include <stdio.h>
/*
//==========
// How to EMSDK
https://emscripten.org/index.html
Download and Install
https://emscripten.org/docs/getting_started/downloads.html
@sdkfz181tiger
sdkfz181tiger / custom_main_1.js
Last active December 23, 2022 08:57
Promise基礎
View custom_main_1.js
"use strict";
//==========
// Promise基礎_1
// Window
window.onload = (e)=>{
// Promises
const pr1 = new Promise((resolve, reject)=>{
@sdkfz181tiger
sdkfz181tiger / custom_main.js
Last active December 16, 2022 01:44
Module基礎
View custom_main.js
import { myName, myFunc, MyModule } from "./custom_module.js";
$(document).ready(()=>{
console.log("Ready!!");
// Variable
console.log(myName);
// Function
myFunc();
@sdkfz181tiger
sdkfz181tiger / SerialPort.cpp
Last active November 28, 2022 04:23
SerialPort x Chrome x M5Atom
View SerialPort.cpp
#include "M5Atom.h"
using namespace std;
unsigned long counter = 0;
// Send to browser
void sendMsg(const string msg){
Serial.println(msg.c_str());
}
@sdkfz181tiger
sdkfz181tiger / BleServer.cpp
Last active October 24, 2022 09:00
BluetoothDevice x ChromeBrowser x M5Atom
View BleServer.cpp
#include <BLEDevice.h>
#include <BLEUtils.h>
#include <BLEServer.h>
#include <BLE2902.h>
#include "M5Atom.h"
#define SERVICE_UUID "xxxxx"
#define CHARACTERISTIC_UUID "yyyyy"
#define DEVICE_NAME "BLE_Controller"
@sdkfz181tiger
sdkfz181tiger / BleServer.cpp
Last active October 24, 2022 08:52
BluetoothDevice x ChromeBrowser
View BleServer.cpp
#include <BLEDevice.h>
#include <BLEUtils.h>
#include <BLEServer.h>
#include <BLE2902.h>
#define SERVICE_UUID "xxxxx"
#define CHARACTERISTIC_UUID "yyyyy"
#define DEVICE_NAME "BLE_Controller"
using namespace std;
@sdkfz181tiger
sdkfz181tiger / main.py
Last active October 21, 2022 02:30
PyAV基礎_03_2つの動画から画像を合成(Pillow)
View main.py
# coding: utf-8
"""
2つの動画から画像を合成 using Pillow
"""
import cv2, av, time
import numpy as np
from PIL import Image
@sdkfz181tiger
sdkfz181tiger / main.py
Last active October 21, 2022 02:30
PyAV基礎_02_2つの動画から画像を合成(OpenCV)
View main.py
# coding: utf-8
"""
2つの動画から画像を合成 using OpenCV
"""
import cv2, av, time
import numpy as np
from PIL import Image
@sdkfz181tiger
sdkfz181tiger / main.py
Last active October 20, 2022 10:13
PyAV基礎_01_2つの動画から画像を合成
View main.py
# coding: utf-8
"""
2つの動画から画像を合成 using Pillow
"""
import cv2, av
import numpy as np
from PIL import Image