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 { chromium } from "playwright"; | |
import { serve } from "bun"; | |
const form = ` | |
<form action="/" method="post"> | |
<input name="username" required/> | |
<button type="submit">Submit</button> | |
</form> | |
`; |
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 mimes from "mime"; | |
type RequestHandler = (req: Request) => Promise<Response>; | |
export function middleware(fetch: RequestHandler): RequestHandler { | |
return async (req) => { | |
if (req.method !== "GET") { | |
return fetch(req); | |
} |
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 zlib from "node:zlib"; | |
import type { Transform } from "stream"; | |
import mimeDb from "mime-db"; | |
function getQValue(qValue: string | undefined): number { | |
if (qValue === undefined) { | |
return 1; | |
} | |
const [_key, value] = qValue.split("="); | |
if (value === undefined) { |
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
type RequestHandler = (req: Request) => Promise<Response>; | |
export const retainedHeaders = [ | |
"cache-control", | |
"content-location", | |
"date", | |
"etag", | |
"expires", | |
"vary", | |
]; |
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
{ | |
packageLock = builtins.fromJSON (builtins.readFile ./package-lock.json); | |
cleanPackages = builtins.attrValues (builtins.removeAttrs packageLock.packages [ "" ]); | |
fetchedPackages = builtins.map | |
(package: | |
let | |
basename = builtins.baseNameOf package.resolved; |
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 * as crypto from 'node:crypto'; | |
import * as fs from 'node:fs'; | |
import * as http from 'node:http'; | |
import * as path from 'node:path'; | |
import * as cp from 'node:child_process'; | |
import { parseArgs } from 'node:util'; | |
import { z } from 'zod'; | |
import type { Auth } from 'googleapis'; | |
import { google } from 'googleapis'; |
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
xinput list --id-only 'Wacom Intuos PT M Pen stylus' | xargs -I '{}' xinput map-to-output '{}' DP-0 |
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
rec { | |
android_mount = "${android_unmount} && sudo mkdir -p /run/media/${config.home.username}/android; sudo ${pkgs.jmtpfs}/bin/jmtpfs -o allow_other /run/media/${config.home.username}/android && cd /run/media/${config.home.username}/"; | |
android_unmount = "sudo umount /run/media/${config.home.username}/android && sudo rmdir /run/media/${config.home.username}/android"; | |
} |
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
{ pkgs, username, ... }: | |
{ | |
# https://nixos.wiki/wiki/Bluetooth#Pairing_Bluetooth_devices | |
services.blueman.enable = true; | |
# https://nixos.wiki/wiki/Bluetooth#Enabling_Bluetooth_support | |
hardware.bluetooth.enable = true; | |
home-manager.users.${username}.home.packages = with pkgs;[ bluetuith ]; | |
} |
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
{ | |
services.xserver.inputClassSections = [ | |
'' | |
Identifier "AliExpress Trackpoint" | |
MatchUSBID "1018:1006" | |
Option "TransformationMatrix" "-1 0 1 0 -1 1 0 0 1" | |
Driver "libinput" | |
'' | |
'' | |
Identifier "AliExpress Trackpoint BT" |
NewerOlder