This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * ユーザーの購入合計金額を計算するモジュール | |
| * @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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class BasicRole { | |
| constructor(name) { | |
| if (this.constructor === BasicRole) { | |
| throw new Error("BasicRoleは抽象クラスのため、インスタンス化できません。"); | |
| } | |
| this.name = name; | |
| } | |
| attack() { | |
| console.log(`${this.name}は攻撃した`); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <script> | |
| let isInlineExecuted = false; | |
| /* | |
| let unlock = null; | |
| let forceOpen = null; | |
| const gate = new Promise((resolve, reject) => { | |
| unlock = resolve; | |
| forceOpen = reject; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| console.log("main logic - start"); | |
| (async () => { | |
| try{ | |
| if (isInlineExecuted) { | |
| console.log("main logic - standby"); | |
| await gate; | |
| } | |
| } | |
| catch(e){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <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`; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*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; |
NewerOlder