Skip to content

Instantly share code, notes, and snippets.

View watiko's full-sized avatar
🎯
Focusing

watiko watiko

🎯
Focusing
View GitHub Profile
@watiko
watiko / MHZ14A.py
Last active March 19, 2019 15:00
MHZ14A
#!/usr/bin/env python3
# forked from: https://github.com/keepworking/MH-Z14A-PI
import serial
import time
import datetime
import json
import argparse
import sys
#include <iostream>
#include <cstdlib>
template<typename T>
struct OrdTraits;
// int 向けにテンプレートの特殊化
template<> struct OrdTraits<int> {
static bool less(const int &x, const int &y) {
return x < y;
@watiko
watiko / README.md
Last active February 24, 2021 04:59
bms2preview

事前準備

依存するコマンド

  • bms-renderer: BMSをwavに変換する
    • npm install --global @watiko/bms-renderer
      • 本家で対応されたら本家を入れると良い
    • libsndfileが必要なので用意しておく。debianでは apt install libsndfile1-dev
  • sox: 先頭の無音部分を削除
  • ffmpeg: oggに変換しつつ、頭出しから10秒を切り出す
fn main() {
let ts = std::time::SystemTime::now()
.duration_since(std::time::UNIX_EPOCH)
.unwrap()
.as_millis();
print!("{}", ts);
}