Skip to content

Instantly share code, notes, and snippets.

View myaosato's full-sized avatar
🎉
happy hacking

Satoaki Miyao myaosato

🎉
happy hacking
View GitHub Profile
@myaosato
myaosato / ResponseHandler.ts
Last active October 3, 2025 21:47
ResponseHandler.ts
export class ResponseHandler {
private promise: Promise<Response>;
private constructor(promise: Promise<Response>) {
this.promise = promise;
};
public receive(status: number, handler: (response: Response) => void) {
const next = this.promise.then((response: Response) => {
if (status === response.status) {
@myaosato
myaosato / PHP-Conference-Japan-2025.md
Last active September 6, 2025 09:00
PHP-Conference-Japan-2025

PHP カンファレンス 2025

「PHP Conference Japan 2025」について、YouTubeのライブ映像とforteeの紹介ページへのリンクをまとめた。

  • 自分が見るために、勝手にやっているだけの資料
  • 間違いとかあっても、他意はなく、ただただミスしているだけ

PHP カンファレンス 2025 (PHP Conference Japan 2025) Track1

PHPの今とこれから 2025

; Heap's algorithm
; ref. https://ja.wikipedia.org/wiki/Heap%E3%81%AE%E3%82%A2%E3%83%AB%E3%82%B4%E3%83%AA%E3%82%BA%E3%83%A0
(defun %permutations (a)
(let* ((n (length a))
(c (make-array n))
(i 0)
(caller nil)
(firstp nil))
(setf caller
(lambda ()
@myaosato
myaosato / tone.html
Created June 14, 2025 01:45
トーン
<!DOCTYPE html>
<html>
<head>
<title>TONE</title>
</head>
<body style="margin:0;text-align: center;">
<canvas id="canvas" width="700" height="700"></canvas>
<script>
/** @type {HTMLCanvasElement} */
const canvas = document.getElementById('canvas');
// 2024-11-10
Array.from(document.getElementById('g-items').querySelectorAll('.a-price-whole'))
.map(x => Number(x.innerHTML.replace(',', '')))
.reduce((s, x) => s + x, 0)
;
@myaosato
myaosato / proof.lisp
Last active September 6, 2023 14:12
定理証明もどき
; Proof
;
; => https://github.com/myaosato/claudia
;
;; ****************************************************************
;; meta data type
#|
const := const-val | func const*
term := const | var
@myaosato
myaosato / fact.pl
Created February 12, 2022 04:21
Factrial on Prolog
fact(1, F) :- F is 1.
fact(N, F) :-
N > 1,
M is N - 1,
fact(M, T),
F is N * T.
@myaosato
myaosato / binary-heap.lisp
Last active September 26, 2020 15:41
study
;;;; heap
(defstruct (binary-heap (:conc-name bh-))
(predicate #'>=)
(nodes (make-array (list 1024) :adjustable t :fill-pointer 0)))
(defun bh-empty (binary-heap)
(= (length (bh-nodes binary-heap)) 0))
(defun bh-tail (binary-heap)
(1- (length (bh-nodes binary-heap))))
@myaosato
myaosato / bar.py
Last active September 5, 2020 00:13
Pythonプロセス並列化お試し
# 1秒後, 2秒後 3秒後に印字されるものと,
# 2秒後, 3秒後 に印字される
import time
import sys
from multiprocessing import Process, Value, set_start_method
set_start_method('fork')
def f(xs, flg):
cnt = 0
fib(N, F) :- fibo(0, 1, N, F).
fibo(A, _B, 0, F) :- F is A.
fibo(A, B, N, F) :-
N > 0,
NEWA is B,
NEWB is A + B,
NEWN is N - 1,
fibo(NEWA, NEWB, NEWN, F).