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 * as fs from "node:fs"; | |
import type { Locator, Page } from "playwright"; | |
export type FormInput = | |
| { | |
type: "text"; | |
value: string; | |
} | |
| { | |
type: "radio"; |
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
#define _GNU_SOURCE | |
#include <dlfcn.h> | |
#include <netdb.h> | |
#include <string.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <arpa/inet.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> |
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("System time is:", new Date().toISOString()); |
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 * as xpath from 'xpath'; | |
import * as xmldom from '@xmldom/xmldom'; | |
const xml = `<book><title foo="bar">Harry Potter</title></book>`; | |
const doc = new xmldom.DOMParser().parseFromString(xml, 'text/xml') as any as Node; | |
const [ firstTitleText ] = xpath.select("//title/text()", doc); | |
console.assert(firstTitleText.nodeValue === "Harry Potter"); | |
const result: xpath.SelectSingleReturnType = xpath.select1("//title/text()", doc); |
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
file=$1 | |
outdir=$(mktemp -d) | |
printf "original: " | |
ls -l "$file" | awk '{print $5}' | |
nix run nixpkgs#gzip -- -9 -c "$file" > "$outdir/file.gzip" | |
printf "gzip: " | |
ls -l "$outdir/file.gzip" | awk '{print $5}' |
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
fd -e nix -e ts -x sed -i ':a;N;$!ba;s/\([{[(]\)\n/\1/g' {} |
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
{ lib, modulesPath, ... }: | |
{ | |
imports = [ "${modulesPath}/virtualisation/qemu-vm.nix" ]; | |
disko.devices.disk.disk1.device = lib.mkForce "/dev/vda"; | |
services.openssh.settings.PermitRootLogin = "yes"; | |
services.openssh.settings.PermitEmptyPasswords = "yes"; | |
services.openssh.settings.PasswordAuthentication = lib.mkForce true; |
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
nix run nixpkgs#dua -- --count-hard-links --apparent-size /nix/store |
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
ssh-keygen -f __foo && sops set ./host-secrets.yaml '["node2_ssh_key"]' "$(cat __foo | tr -d '\n' | jq -R '@json')" && | |
cat __foo.pub && rm __foo* |
NewerOlder