Skip to content

Instantly share code, notes, and snippets.

/**
* Fetches npm packages for a user, filters by Tidelift presence
* and download count (>10k), then returns (count * 50).
* @param {string} username - The npm username or organization name.
*/
async function getTideliftValuation(username) {
try {
// 1. Fetch packages by maintainer
const searchUrl = `https://registry.npmjs.org/-/v1/search?text=maintainer:${username}&size=250`;
const searchRes = await fetch(searchUrl);
async function getFullContributionData(username) {
let repoStats = new Map(); // Stores repoPath => prCount
let page = 1;
let keepGoing = true;
console.log(`🚀 Gathering full intelligence on ${username}'s contributions...`);
while (keepGoing) {
const url = `https://api.github.com/search/issues?q=is:pr+is:merged+author:${username}&per_page=100&page=${page}`;
import { spawn } from 'node:child_process';
import { platform } from 'node:process';
const isWin = platform() === 'win32';
const isMac = platform() === 'darwin';
export async function writeClipboard(text: string): Promise<void> {
return new Promise((resolve, reject) => {
let proc;
if (isMac) {
(3+4)^3=343
(3*1+2)^5=3125
type Params = Record<string, string | number | boolean | null | undefined>;
const buildUrl = (path: string, params?: Params): URL => {
const API_URL = "https://neal.fun/api/infinite-craft";
const url = new URL(`${API_URL}${path}`);
if (params) {
for (const [key, value] of Object.entries(params)) {
if (value !== null && value !== undefined) {
url.searchParams.append(key, String(value));
type TypeToString<T> = T extends
| string
| number
| bigint
| boolean
| null
| undefined
? T
: T extends symbol
? "symbol"
@gameroman
gameroman / tsconfig.json
Last active December 19, 2025 09:10 — forked from t18n/tsconfig.json
[Example tsconfig.json] Tsconfig.json with description #typescript
{
"compilerOptions": {
"declaration": true,
"target": "esnext",
"module": "esnext",
"moduleResolution": "bundler",
"moduleDetection": "force",
"rootDir": "./",
@gameroman
gameroman / graph-editor-1.html
Created November 23, 2025 21:22
graph-editor.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Directed Graph Editor</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/cytoscape/3.24.0/cytoscape.min.js"></script>
<style>
body {
font-family: Arial, sans-serif;
import pyautogui as pg
def circle(x: int, y: int, radius: int):
pg.mouseDown(x + radius, y)
positions: list[tuple[int, int]] = [
((radius**2 / 2) ** (1 / 2), (radius**2 / 2) ** (1 / 2)),
(0, radius),
(-((radius**2 / 2) ** (1 / 2)), (radius**2 / 2) ** (1 / 2)),
class Cube:
def __init__(self, x_size: int, y_size: int, z_size: int, /):
self.x_size = x_size # Width
self.y_size = y_size # Height
self.z_size = z_size # Depth
self.front = __ = [["🟥"] * x_size for _ in range(y_size)] # Front
self.back = ___ = [["🟧"] * x_size for _ in range(y_size)] # Back
self.top = ____ = [["🟩"] * x_size for _ in range(z_size)] # Top
self.bottom = _ = [["🟦"] * x_size for _ in range(z_size)] # Bottom