Skip to content

Instantly share code, notes, and snippets.

View virtuallyunknown's full-sized avatar

virtuallyunknown

View GitHub Profile
@virtuallyunknown
virtuallyunknown / niri-window-fullscreen.ts
Last active November 29, 2025 00:43
Fix for shrinking game windows in Niri.
#!/usr/bin/env node
/*
This script addresses a specific issue with Battle.net games where alt-tabbing or
switching away from the game window causes it to shrink from fullscreen.
This is recoverable if you use mod+alt+f (fullscreen-window) niri shortcut, but this
script automates the process. Also, if you are using gamescope or other similar
compositor to run your games, then it's likely that you're not encountering this issue
@virtuallyunknown
virtuallyunknown / kysely-typegen.ts
Created August 23, 2025 00:41
Kysely Typegen (TS version)
import camelCase from 'camelcase';
import decamelize from 'decamelize';
import type { MaterializedViewColumn, TableColumn, ViewColumn } from 'extract-pg-schema';
import extractPGSchema from 'extract-pg-schema';
import { readFile, writeFile } from 'node:fs/promises';
import { join } from 'node:path';
import type { ConnectionConfig } from 'pg';
import pg from 'pg';
const dbRootDir = join(import.meta.dirname, '../');
@virtuallyunknown
virtuallyunknown / git-commits.md
Created December 7, 2024 17:45
Git commit message formatting guide

Git commit message formatting guide

Commit types

  • build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
  • chore: Other changes that don't modify src or test files
  • ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
  • docs: Documentation only changes
  • feat: A new feature
  • fix: A bug fix
import axios from 'axios';
import { decode } from 'jsonwebtoken';
import { z } from 'zod';
const cotdListSchema = z.object({
monthList: z.array(
z.object({
year: z.number(),
month: z.number(),
lastDay: z.number(),
[
{
"mapUid": "g7l2eO_x9z4HWGGYj8dVBCDSTEg",
"campaignId": 173,
"seasonUid": "33181f18-1b3d-4ed4-94b3-92e4c809e1e9",
"month": 7,
"year": 2020,
"date": 1,
"name": "$i$sU-Turn",
"author": "5c8e45ae-8b0e-492f-a80c-a580f733716f",
/* File generated automatically, do not edit. */
import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely';
export type DBEventType =
'goal' |
'own-goal' |
'penalty-goal' |
'penalty-miss' |
'yellow-card' |
import type { KyselyPlugin, PluginTransformQueryArgs, PluginTransformResultArgs, QueryResult, RootOperationNode, UnknownRow } from 'kysely';
function toJsonb(func: unknown) {
if (typeof func !== 'string') {
throw new Error('Invalid function');
}
switch (func) {
case 'json_agg': return 'jsonb_agg';
case 'to_json': return 'to_jsonb';
import * as d3 from 'd3';
import { useEffect, useRef } from 'react';
import { AbsoluteFill, spring, useCurrentFrame, useVideoConfig } from 'remotion';
// Dataset
type Letter = {
letter: string;
frequency: number;
};
package main
import (
"fmt"
"os"
"time"
"github.com/charmbracelet/bubbles/stopwatch"
tea "github.com/charmbracelet/bubbletea"
)
package main
import (
"fmt"
"os"
tea "github.com/charmbracelet/bubbletea"
)
type PageNumber int