Skip to content

Instantly share code, notes, and snippets.

View nhalstead's full-sized avatar
👨‍💻
Something. Maybe cool

Noah Halstead nhalstead

👨‍💻
Something. Maybe cool
View GitHub Profile
@thanhminhmr
thanhminhmr / README.md
Last active March 28, 2025 12:34
Go doesn't have ternary, so created one...

go-ternary

Yes, I know—yet another attempt at bringing a ternary-like experience to Go. But hey, Go doesn’t have one, and I wasn’t around when the last million were written.

Why?

Because Go doesn't have a ternary operator, and according to the official FAQ, it likely never will. The reasoning? To prevent developers from writing "impenetrably complex expressions." But let's be real—poor coding practices exist in all forms. Instead of outright banning a useful construct, wouldn’t compiler warnings for overly complicated ternary expressions have been a more reasonable approach?

Since that's not happening, here’s go-ternary—because sometimes, a one-liner is just nicer than an if-else.

@lukepighetti
lukepighetti / README.md
Last active March 2, 2025 19:33
pocketbase systemd
vim /lib/systemd/system/pocketbase.service
systemctl enable pocketbase
systemctl start pocketbase
systemctl status pocketbase
systemctl stop pocketbase
systemctl restart pocketbase
@MarvinJWendt
MarvinJWendt / Go Module Count by Domain
Created April 8, 2024 23:35
Count of all Go modules by domain as of 2024.04.09
Total go modules: 1288407
github.com: 1218651
gitlab.com: 12372
gitee.com: 8497
gopkg.in: 5746
go-micro.dev: 3494
github.com: 3209
github.com: 2487
bitbucket.org: 2347
@bikram20
bikram20 / gist:4f4dbbaf5fcc874d5daee2e3b780d919
Last active November 3, 2023 23:46
Self-install kubernetes dashboard on DOKS using helm3
# Requires that you have helm3 installed on your local machine and cluster is accessible (kubeconfig).
# You do NOT need the following instructions, if you are comfortable using helm!!
# Reference: https://github.com/kubernetes/dashboard/releases/tag/v3.0.0-alpha0
# Helm Instructions: https://artifacthub.io/packages/helm/k8s-dashboard/kubernetes-dashboard
# Dashboard 3.0 alpha version is supported on k8s 1.27 only. However we will go ahead and install on 1.28.
# Verify your DOKS k8s version
@amandabot
amandabot / playwright-attach-to-browser-example.ts
Created March 9, 2023 02:08
Demonstrates how to attach playwright to a browser instance
// First run this to start your instance of Chromium. This could be done for Firefox or Edge as well.
// I use the ones that Playwright installs to "<user>\AppData\Local\ms-playwright" since I normally use Chrome, and
// I don't want the script to mess with my regular profile. The debug port is important to include.
// > cd "path\to\chromium\install"
// > .\chrome.exe --remote-debugging-port=9222
// Once the browser is running, use NodeJS or whatever flavor of Playwright (python, C#, etc) you are using to run the script and connect:
// > node your-compiled-script.js
// your-pre-compiled-script.ts
@Aldaviva
Aldaviva / wmp_h.265_hevc.md
Last active May 5, 2025 19:49
Play H.265/HEVC videos in Windows Media Player (Classic) without a third-party codec pack or media player. Tested using Microsoft.HEVCVideoExtension_2.0.60091.0_x64__8wekyb3d8bbwe with WMP 12.0.20348.1311 on Windows Server 2022 21H2 and 12.0.22621.1105 on Windows 11 22H2.

Download

  1. Go to https://store.rg-adguard.net.
  2. Search for the HEVC Video Extensions from Device Manufacturer (Microsoft.HEVCVideoExtension) app by entering the following store URL.
    https://www.microsoft.com/en-us/p/hevc-video-extensions-from-device-manufacturer/9n4wgh0z6vhq
    
    • Do not use the normal HEVC Video Extensions app URL, because that can't play HEVC videos in Windows Media Player for some inscrutable reason.
  3. Download the AppxBundle file.
    • You may have to right click › Save Link As because the URL scheme is http, not https, if your browser is set to enforce HTTPS-only mode.
  • If it tries to save as a filename that's just a GUID, you may copy the correct .AppxBundle filename and save it as that instead.
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="icon" type="image/x-icon" href="/favicon.ico">
<title>Rebane's Discord Colored Text Generator</title>
<meta charset="UTF-8">
<meta name="description" content="Rebane's Discord Colored Text Generator">
<meta name="author" content="rebane2001">
<style>
/*
@nidhi-canopas
nidhi-canopas / utility_functions.go
Last active November 11, 2022 02:27
A bunch of commonly used function with slice, string and time using Golang
package main
import (
"fmt"
"math/rand"
"regexp"
"strconv"
"strings"
"time"
)
@DarkGhostHunter
DarkGhostHunter / log-levels.csv
Last active March 12, 2022 04:38
Log levels table
Property / Log Level Debug Info Notice Warning Error Critical Alert Emergency
Disposable X
Statistical X X X X X X X
Relevant X X X X X X
Undersired X X X X X
Unstable X X X X
Stateful X X X
Unsecure X X
Unfixable X
@shuding
shuding / swr-suspense-journey.md
Created September 14, 2021 12:18
The Journey of SWR and Suspense

The Journey of SWR and Suspense

We are trying to combine the idea of SWR ("stale-while-revalidate") and React Suspense together, and this write-up covers all our findings from this journey.

Background

When React Hooks launched, people started to rely on useEffect to initiate data fetching:

function User () {