Skip to content

Instantly share code, notes, and snippets.

View umaumax's full-sized avatar
🏠
Working from home

umaumax umaumax

🏠
Working from home
View GitHub Profile
@umaumax
umaumax / index.html
Created December 25, 2024 04:35
統計 - 指数分布と中心極限定理のデモ
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Interactive Exponential Distribution</title>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
</head>
@umaumax
umaumax / TaskScheduleManagement.vba
Created July 20, 2024 15:02
Task Schedule Management
Sub SetupTaskTimeManagementTemplate()
Dim ws As Worksheet
Set ws = CheckOrCreateSheet(Format(Date, "yy-mm-dd") & "_タスクスケジュール管理")
' ヘッダーの設定
ws.Cells(1, 1).Value = "実働合計(h)"
ws.Cells(2, 1).Formula = "=SUM(C2:Z2)" ' 休憩時間を除く
Rows("6:6").Select
ActiveWindow.FreezePanes = True
@umaumax
umaumax / Dockerfile
Created June 11, 2024 16:12
Dockerfile example
FROM ubuntu:24.04
RUN apt-get -y update \
&& DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
curl \
wget \
vim \
tree \
tzdata \
python3-dev python3-pip python3-venv \
#!/usr/bin/env python3
import argparse
import sys
import numpy as np
import trimesh
import open3d
global args
@umaumax
umaumax / flask-server-mock.py
Created March 30, 2024 14:55
flask-server-mock
#!/usr/bin/env python3
from flask import Flask, request
from urllib.parse import unquote
app = Flask(__name__)
@app.route('/<path:path>', methods=["GET", "POST"])
def catch_all(path):
msg = f"url: {request.url}, path: {path}, query params: {request.args}, POST params: {request.form}"
@umaumax
umaumax / docker-compose.yaml
Created March 24, 2024 13:45
Mermaid live editor docker compose file
version: "3.7"
services:
mermaid:
image: ghcr.io/mermaid-js/mermaid-live-editor
restart: always
ports:
- 18080:8080
@umaumax
umaumax / io-bench.cpp
Last active March 19, 2024 14:32
c++ io benchmark
#include <unistd.h>
#include <chrono>
#include <cstdio>
#include <fstream>
#include <iostream>
#include <iterator>
#include <random>
bool fsync_flag = true;
@umaumax
umaumax / retry.sh
Created March 12, 2024 14:07
shell retry function
#!/usr/bin/env bash
MAX_RETRIES=5
RETRY_INTERVAL=1
function retry() {
BLACK=$'\e[30m' RED=$'\e[31m' GREEN=$'\e[32m' YELLOW=$'\e[33m' BLUE=$'\e[34m' PURPLE=$'\e[35m' LIGHT_BLUE=$'\e[36m' WHITE=$'\e[37m' GRAY=$'\e[90m' DEFAULT=$'\e[0m'
local retry_count=0
local exit_code=0
#!/usr/bin/env python3
import argparse
import os
from fastapi import FastAPI, HTTPException
from fastapi.responses import FileResponse
app = FastAPI()
#!/usr/bin/env python3
import argparse
from http.server import HTTPServer, SimpleHTTPRequestHandler
class MyHandler(SimpleHTTPRequestHandler):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def do_GET(self):