Skip to content

Instantly share code, notes, and snippets.

View watiko's full-sized avatar
🎯
Focusing

watiko watiko

🎯
Focusing
View GitHub Profile
fn main() {
let ts = std::time::SystemTime::now()
.duration_since(std::time::UNIX_EPOCH)
.unwrap()
.as_millis();
print!("{}", ts);
}
@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秒を切り出す
#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 / 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
@watiko
watiko / README.go
Created November 25, 2018 06:23
Go without Tooling System
## セットアップ
```bash
$ mkdir bin
$ go run tools.go
```
## 実行
```bash
namespace Ext {
export enum A {
One = 'one',
Two = 'two',
Three = 'three',
}
export namespace B {
export type Type = typeof One | typeof Two | typeof Three
export const One = 'one'
@watiko
watiko / spacemacs-cheshe.md
Created August 24, 2018 05:02 — forked from robphoenix/spacemacs-cheshe.md
Spacemacs Cheat Sheet

Useful Spacemacs commands

  • SPC q q - quit
  • SPC w / - split window vertically
  • SPC w - - split window horizontally
  • SPC 1 - switch to window 1
  • SPC 2 - switch to window 2
  • SPC w c - delete current window
  • SPC TAB - switch to previous buffer
  • SPC b b - switch buffers
@watiko
watiko / 00_timeline.md
Created August 16, 2018 14:02 — forked from south37/00_timeline.md
ISUCON Cheat Sheet
@watiko
watiko / kubernetes-envFrom-env.yml
Created June 11, 2018 16:02
Kubernetes envFrom with env
apiVersion: v1
kind: ConfigMap
metadata:
name: myconf
data:
TEST_KEY: my-value
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
@watiko
watiko / README.md
Last active December 1, 2017 20:48 — forked from yuroyoro/README.md
Sentryをdocker-composeで。
  1. docker run --rm sentry config generate-secret-key で SECRET_KEY を生成する
  2. SECRET_KEY を環境変数にいれる export SENTRY_SECRET_KEY="your generated secret key"
  3. docker-compose up -d でサービスあげる
  4. docker-compose run --rm sentry sentry upgrade で初期設定する
  5. docker-compose restart で再起動
  6. Go http://localhost:9000 and get sentry!