Skip to content

Instantly share code, notes, and snippets.

View dropwhile's full-sized avatar
💭
neutrally buoyant

eli dropwhile

💭
neutrally buoyant
View GitHub Profile
object YAML:
apiVersion:
apps/v1
kind:
Deployment
metadata:
name:
"my-app"
namespace:
"my-app"
@benpate
benpate / template-fragments.go
Last active July 10, 2024 12:08
Demonstration of Template Fragments using the standard Go template library
package main
import (
"html/template"
"net/http"
"strconv"
)
/***********************
This is a simple demonstration of how to use the built-in template package in Go to implement
@aleksasiriski
aleksasiriski / proxmoxlxcjellyfin.md
Last active April 5, 2024 17:45
Proxmox LXC Alpine Docker Jellyfin

How to setup VA-API within Proxmox LXC Unprivileged container

Proxmox configuration

No drivers need to be installed on the proxmox, from now called host.

Find GIDs of video and render group on host:

cat /etc/group | grep video

cat /etc/group | grep render

@maratori
maratori / golang-mocks.md
Last active July 19, 2024 11:10
Comparison of golang mocking libraries

Comparison of golang mocking libraries

Updated 2024-05-29

Uber
[gomock][6]
[testify][2] + [mockery][3] [minimock][4] [moq][5] Google
[gomock][1]

Library

GitHub stars [![s6]][6] [![s2]][2] + [![s3]][3] [![s4]][4] [![s5]][5] [![s1]][1]
Latest release date [![d6]][r6] [![d2]][r2] + [![d3]][r3] [![d4]][r4] [![d5]][r5] [![d1]][r1]
Maintained :white_check
@kjmph
kjmph / A_UUID_v7_for_Postgres.sql
Last active July 6, 2024 19:07
Postgres PL/pgSQL function for UUID v7 and a bonus custom UUID v8 to support microsecond precision as well. Read more here: https://datatracker.ietf.org/doc/draft-peabody-dispatch-new-uuid-format/
-- Based off IETF draft, https://datatracker.ietf.org/doc/draft-peabody-dispatch-new-uuid-format/
create or replace function uuid_generate_v7()
returns uuid
as $$
begin
-- use random v4 uuid as starting point (which has the same variant we need)
-- then overlay timestamp
-- then set version 7 by flipping the 2 and 1 bit in the version 4 string
return encode(
@bademux
bademux / installAlpineAsDataDisk.md
Last active December 30, 2021 21:01
install Data Disk alpine with zfs /var

Download latest Extended Alpine https://alpinelinux.org/downloads/

Copy all files from alpine iso to USB drive formatted as a single efi partition.

Setup Apline

setup-alpine
apk add util-linux nano udev zfs
setup-udev
modprobe zfs
@krisalyssa
krisalyssa / readme.txt
Last active September 12, 2022 20:31 — forked from rkttu/readme.txt
Ubuntu 20.10 + WSL 2 + XRDP PulseAudio
# Credits
# https://c-nergy.be/blog/?p=13655
# https://askubuntu.com/questions/844245/how-to-compile-latest-pulseaudio-with-webrtc-in-ubuntu-16-04
# https://askubuntu.com/questions/496549/error-you-must-put-some-source-uris-in-your-sources-list
# https://unix.stackexchange.com/questions/65167/enable-udev-and-speex-support-for-pulseaudio
# https://rudd-o.com/linux-and-free-software/how-to-make-pulseaudio-run-once-at-boot-for-all-your-users
# https://gist.github.com/rkttu/35ecab5604c9ddc356b0af4644d5a226
# First, you should install XRDP and X11 Desktop Environment first.
@MineRobber9000
MineRobber9000 / donotuse3.py
Last active February 8, 2024 12:48
How to NEVER use lambdas - Python 3 edition
###########################################################
# How to NEVER use lambdas. An inneficient and yet educa- #
# tonal [sic] guide to the proper misuse of the lambda #
# construct in Python 3.x. [DO NOT USE ANY OF THIS EVER] #
# original by (and apologies to): e000 (13/6/11) #
# now in Python 3 courtesy of: khuxkm (17/9/20) #
###########################################################
## Part 1. Basic LAMBDA Introduction ##
# If you're reading this, you've probably already read e000's
RMS NOTATION TUTORIAL
BEHAVIOR
=: write-only
+: read/writeable
&: earlyclobber (impacts register sharing, defensive copying, etc.)
%: commutative
,: groups alternative constraints
?: discourages group of constraints
const std = @import("std");
const net = std.net;
const fs = std.fs;
const os = std.os;
pub const io_mode = .evented;
pub fn main() anyerror!void {
var general_purpose_allocator = std.heap.GeneralPurposeAllocator(.{}){};
const allocator = &general_purpose_allocator.allocator;