From Bas van Dijk:
To understand these things I would recommend using nix-repl:
$ nix-repl
Welcome to Nix version 1.11.2. Type :? for help.
| #Requires AutoHotkey v2 | |
| ; Install the keyboard hook to capture the real key state of the keyboard | |
| InstallKeybdHook(true) | |
| ; Disable the CapsLock key | |
| SetCapsLockState("alwaysoff") | |
| ; Send esc key when Capslock is pressed as default | |
| g_DoNotAbortSendEsc := true | |
| $*Capslock::{ ; Capture CapsLock key press | |
| global g_DoNotAbortSendEsc ; use global variable g_DoNotAbortSendEsc |
| ---Utility for keymap creation. | |
| ---@param lhs string | |
| ---@param rhs string|function | |
| ---@param opts string|table | |
| ---@param mode? string|string[] | |
| local function keymap(lhs, rhs, opts, mode) | |
| opts = type(opts) == 'string' and { desc = opts } | |
| or vim.tbl_extend('error', opts --[[@as table]], { buffer = bufnr }) | |
| mode = mode or 'n' | |
| vim.keymap.set(mode, lhs, rhs, opts) |
| // ==UserScript== | |
| // @name Dark NixOS Package, Wiki and Main Site | |
| // @namespace http://userstyles.org | |
| // @description Darkened NixOS Websites, includes Wiki and Package Search | |
| // @author Thomas Leon Highbaugh | |
| // @homepage https://userstyles.org/styles/163453 | |
| // @match http://nixos.org/* | |
| // @match https://nixos.org/* | |
| // @match http://*.nixos.org/* | |
| // @match https://*.nixos.org/* |
| import { parse } from 'parse5' | |
| import { adapter } from 'parse5-htmlparser2-tree-adapter' | |
| import xpath from 'xpath' | |
| const html = '...' | |
| const selector = '...' | |
| const doc = parse(html, { treeAdapter: adapter }) | |
| const htmlEl = doc.childNodes.find(c => c.name === 'html') |
| import { Browser, chromium, firefox, webkit } from "playwright"; | |
| import { afterAll, beforeAll, describe, it } from "vitest"; | |
| const browserTypes = process.env.ALL_BROWSERS | |
| ? [chromium, firefox, webkit] | |
| : [chromium]; | |
| for (const browserType of browserTypes) { | |
| describe(`browser:${browserType.name()}`, () => { | |
| let browser: Browser; |
| # https://www.freedesktop.org/software/systemd/man/systemd.unit.html | |
| [Unit] | |
| Description=My App | |
| After=network.target | |
| # https://www.freedesktop.org/software/systemd/man/systemd.exec.html | |
| [Service] | |
| Type=simple | |
| # https://www.freedesktop.org/software/systemd/man/systemd.exec.html#WorkingDirectory= | |
| WorkingDirectory=-/srv/app/ |
| #!/usr/bin/env bash | |
| START_TIME=$SECONDS | |
| set -e | |
| echo "-----START GENERATING HLS STREAM-----" | |
| # Usage create-vod-hls.sh SOURCE_FILE [OUTPUT_NAME] | |
| [[ ! "${1}" ]] && echo "Usage: create-vod-hls.sh SOURCE_FILE [OUTPUT_NAME]" && exit 1 | |
| # comment/add lines here to control which renditions would be created | |
| renditions=( |
| <!DOCTYPE html> | |
| <html lang='`en'> | |
| <head> | |
| <meta charset='utf-8'/> | |
| <title>Audio only stream example</title> | |
| <script src="//cdn.jsdelivr.net/npm/hls.js@latest"></script> | |
| <style> | |
| video { | |
| width: 640px; | |
| height: 360px; |
| import * as admin from 'firebase-admin' | |
| import * as fft from 'firebase-functions-test' | |
| const ft = fft() | |
| import * as sinon from 'sinon' | |
| import { makeUppercase, addMessage } from './function' | |
| describe('order', () => { | |
| describe('makeUpperCase', () => { | |
| it('should upper case input and write it to /uppercase', async () => { | |
| const fakeSnaphost = ft.firestore.makeDocumentSnapshot({ |