Skip to content

Instantly share code, notes, and snippets.

@espio999
espio999 / aerynos_partition_en.sh
Created October 31, 2026 23:49
aerynOS partition
#!/bin/bash
# Exit immediately if a command exits with a non-zero status
set -e
# Check for root privileges
if [ "$EUID" -ne 0 ]; then
echo "Error: This script must be run with root privileges (sudo)." >&2
exit 1
fi
@espio999
espio999 / bookmarklet.js
Created October 11, 2026 14:20
Hatena Parks filter Ver 20261011
javascript:(async%20function()%7Bvar%20e=%60?t=$%7BDate.now()%7D%60,b=%60https://cdn.jsdelivr.net/gh/espio999/Hatena-PARKS-Filter@main/panel.css$%7Be%7D%60,g=%60https://espio999.github.io/Hatena-PARKS-Filter/panel.html$%7Be%7D%60,a=document.getElementById(%22parks-filter-panel%22);if(a)a.style.display=a.style.display===%22none%22?%22block%22:%22none%22;else%7Bdocument.querySelector(%60link%5Bhref=%22$%7Bb%7D%22%5D%60)%7C%7C(a=document.createElement(%22link%22),a.rel=%22stylesheet%22,a.href=b,document.head.appendChild(a));try%7Blet%20c=await%20fetch(g);if(!c.ok)throw%20Error(%22HTML%5Cu306e%5Cu53d6%5Cu5f97%5Cu306b%5Cu5931%5Cu6557%5Cu3057%5Cu307e%5Cu3057%5Cu305f%22);%0Alet%20h=await%20c.text(),f=document.createElement(%22div%22);f.id=%22parks-filter-panel%22;f.innerHTML=h;document.body.appendChild(f);b=k=%3Enew%20Promise((l,m)=%3E%7Bvar%20d=document.createElement(%22script%22);d.src=%60https://cdn.jsdelivr.net/gh/espio999/Hatena-PARKS-Filter@main/$%7Bk%7D$%7Be%7D%60;d.onload=l;d.onerror=m;document.head.appendCh
@espio999
espio999 / build-sample.js
Created October 5, 2026 05:09
sample code for compiling with google-closure-compiler
/**
* ユーザーの購入合計金額を計算するモジュール
* @param {number} price 単価
* @param {number} quantity 数量
* @param {number} taxRate 税率 (例: 0.1)
* @return {number} 税込合計金額
*/
function calculateTotal(price, quantity, taxRate) {
const subtotal = multiply(price, quantity);
const tax = subtotal * taxRate;
@espio999
espio999 / build-sample.ts
Last active October 5, 2026 05:22
build script for google-closure-compiler
import { compiler as Compiler } from "npm:google-closure-compiler";
const inputPath = String.raw``; //コンパイルしたいファイルのパス
const outputPath = String.raw``; //コンパイル後のファイルのパス
const closureCompiler = new Compiler({
js: inputPath,
js_output_file: outputPath,
compilation_level: "SIMPLE", // ADVANCED, SIMPLE, または WHITESPACE_ONLY
});
@espio999
espio999 / Roto.js
Last active March 3, 2026 06:15
OOP in JavaScript
class BasicRole {
constructor(name) {
if (this.constructor === BasicRole) {
throw new Error("BasicRoleは抽象クラスのため、インスタンス化できません。");
}
this.name = name;
}
attack() {
console.log(`${this.name}は攻撃した`);
<html>
<head>
<script>
let isInlineExecuted = false;
/*
let unlock = null;
let forceOpen = null;
const gate = new Promise((resolve, reject) => {
unlock = resolve;
forceOpen = reject;
console.log("main logic - start");
(async () => {
try{
if (isInlineExecuted) {
console.log("main logic - standby");
await gate;
}
}
catch(e){
@espio999
espio999 / test-memoization.html
Last active February 15, 2026 11:40
test for memoization
<html>
<head>
<meta charset="UTF-8">
<script src="fibonacci.js"></script>
<script>
function measurePerformance(label, func){
const point_start = `${label} ----- start`;
const point_finish = `${label} ----- end`;
performance.mark(point_start);
@espio999
espio999 / fibonacci.html
Created February 14, 2026 13:07
performance comparison for fibonacci.js
<html>
<head>
<meta charset="UTF-8">
<script src="fibonacci.js"></script>
<script>
function measurePerformance(label, func){
const point_start = `${label} ----- start`;
const point_finish = `${label} ----- end`;
@espio999
espio999 / fibonacci.js
Last active February 15, 2026 11:33
Fibonacci in JavaScript
/*function memoization(func){
let memo = new Map();
console.log(`counter: ${memo.size}`);
function memoize(arg){
console.log(`${arg} is received`);
let isExist = memo.get(arg);
if (isExist) {
return isExist;