This file contains 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
-Wall -Wextra -pedantic -Wimplicit-fallthrough -Wsequence-point -Wswitch-default -Wswitch-unreachable -Wswitch-enum -Wstringop-truncation -Wbool-compare -Wtautological-compare -Wfloat-equal -Wshadow=global -Wpointer-arith -Wpointer-compare -Wcast-align -Wcast-qual -Wconversion -Wwrite-strings -Wdangling-else -Wlogical-op |
This file contains 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
<script id="worker" src="data:,"> | |
// the empty "src" prevents code inside this block from being executed! | |
// this is the source code of the worker. | |
postMessage("Hello world!") | |
</script> | |
<script> | |
var blob = new Blob([document.getElementById('worker').textContent], |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width"> | |
<link rel="stylesheet" href="style.css"> | |
<script src="favicon.js"></script> | |
<script src="theme.js"></script> | |
<title>Ruby Marshal Visualization</title> | |
<style> |
This file contains 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 os from "node:os"; | |
import fs from "node:fs"; | |
import path from "node:path"; | |
import cp from "node:child_process"; | |
/** | |
* ```js | |
* rb_eval(`p 1`) => '1' | |
* ``` | |
*/ |
This file contains 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
var IDX = 256, HEX: string[] = []; | |
while (IDX--) HEX[IDX] = (IDX + 256).toString(16).substring(1); | |
/** | |
* @param algorithm only "SHA-1", "SHA-256", "SHA-384", "SHA-512". | |
* | |
* **Note**: "SHA-1" is not recommended. | |
*/ | |
export async function digestHex(algorithm: AlgorithmIdentifier, data: string | BufferSource): Promise<string> { | |
if (typeof data === "string") data = new TextEncoder().encode(data); |
This file contains 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((await import('/usr/local/lib/node_modules/env-paths/index.js').then(e => e.default))(process.argv[2] || 'electron', {suffix: ''})) |
This file contains 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
// ==UserScript== | |
// @name Read the code in NPM Browser | |
// @namespace goto-npm-browser.hyrious.me | |
// @match https://www.npmjs.com/package/* | |
// @grant none | |
// @version 1.0 | |
// @author hyrious | |
// @description Change the Code tab to goto https://hyrious.me/npm-browser | |
// ==/UserScript== | |
void function() { |
This file contains 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
echo "$(gh pr view --json url -q .url)/commits/$(git rev-parse --short HEAD)" |
This file contains 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
// Get changelog of a package on GitHub. | |
import cp from "child_process"; | |
var name = process.argv[2]; | |
// https://github.com/dword-design/package-name-regex | |
var re = /^(@[a-z0-9-~][a-z0-9-._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/; | |
if (!(typeof name == "string" && re.test(name))) { | |
console.log("usage: node changelog.mjs <package name>"); | |
process.exit(1); | |
} |