NetworkManager may enable Wi-Fi power saving by default.
To ensure stable networking, set wifi.powersave = 2 to disable power saving.
| Value | Meaning |
| import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; | |
| import { resolve, dirname } from "node:path"; | |
| export default function (pi: ExtensionAPI) { | |
| const approvedFiles = new Set<string>(); | |
| const approvedDirs = new Set<string>(); | |
| const isApproved = (filePath: string) => { | |
| if (approvedFiles.has(filePath)) return true; | |
| let dir = dirname(filePath); |
| /** | |
| * Status Cost — daily cost tracking with auto-reset on reset day. | |
| * Persisted to ~/.pi/cost.json | |
| * Commands: /cost, /cost-reset | |
| */ | |
| import { readFileSync, unlinkSync, writeFileSync } from "node:fs"; | |
| import { homedir } from "node:os"; | |
| import { join } from "node:path"; | |
| import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; |
| services: | |
| psj: | |
| image: nvcr.io/nvidia/pytorch:24.06-py3 | |
| deploy: | |
| resources: | |
| reservations: | |
| devices: | |
| - capabilities: [gpu] | |
| driver: nvidia | |
| shm_size: 10gb |
| # https://gist.github.com/Astro36/211443b279e964af9b2ed05ddec0b1ee | |
| AccessModifierOffset: -4 | |
| AlignAfterOpenBracket: Align | |
| AlignConsecutiveAssignments: false | |
| AlignConsecutiveDeclarations: false | |
| # AlignConsecutiveMacros: false | |
| AlignEscapedNewlines: DontAlign | |
| AlignOperands: true | |
| AlignTrailingComments: false | |
| # AllowAllArgumentsOnNextLine: false |
| sudo nginx -s stop | |
| sudo certbot renew | |
| nginx |
| colorscheme delek | |
| set nu | |
| set mouse=a | |
| set ruler | |
| set shiftwidth=4 | |
| set tabstop=4 | |
| set softtabstop=4 |
| #include <iostream> | |
| template<unsigned int N> | |
| constexpr unsigned int factorial_v = N * factorial_v<N - 1>; | |
| template<> | |
| constexpr unsigned int factorial_v<1> = 1; | |
| template<unsigned int N, unsigned int K> | |
| constexpr unsigned int binomial_v = factorial_v<N> / (factorial_v<K> * factorial_v<N - K>); |
| template<typename T, typename Index = std::size_t, typename = void> | |
| struct has_subscript_operator : std::false_type {}; | |
| template<typename T, typename Index> | |
| struct has_subscript_operator<T, Index, std::void_t<decltype(std::declval<T>()[std::declval<Index>()])>> : std::true_type {}; | |
| template<typename T, typename Index = int> | |
| using has_subscript_operator_v = typename has_subscript_operator<T, Index>::value; | |
| template<typename T> |
| #include <iterator> | |
| #include <type_traits> | |
| template<typename T, typename = void> | |
| struct is_iterable : std::false_type {}; | |
| template<typename T> | |
| struct is_iterable<T, std::void_t<decltype(*std::begin(std::declval<T&>()) != *std::end(std::declval<T&>())), | |
| decltype(++std::declval<decltype(std::begin(std::declval<T&>()))&>())>> : std::true_type {}; |