Skip to content

Instantly share code, notes, and snippets.

View briandowns's full-sized avatar

Brian Downs briandowns

  • Phoenix, AZ
View GitHub Profile
@daxmc99
daxmc99 / k3dStart.sh
Created September 16, 2019 23:05
k3d local development script
#!/bin/bash
#set -x
#set -e
k3d delete --name='k3s-default'
k3d create --workers 1 --image rancher/k3s:v0.8.1 &&
declare -i i; i=0
until k3d get-kubeconfig --name='k3s-default'
do
if (( i > 20 )); then
break
@fnky
fnky / ANSI.md
Last active May 13, 2025 20:07
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@fay59
fay59 / Quirks of C.md
Last active April 3, 2025 02:27
Quirks of C

Here's a list of mildly interesting things about the C language that I learned mostly by consuming Clang's ASTs. Although surprises are getting sparser, I might continue to update this document over time.

There are many more mildly interesting features of C++, but the language is literally known for being weird, whereas C is usually considered smaller and simpler, so this is (almost) only about C.

1. Combined type and variable/field declaration, inside a struct scope [https://godbolt.org/g/Rh94Go]

struct foo {
   struct bar {
 int x;
@tidwall
tidwall / build.sh
Last active May 26, 2018 20:04
Pass custom var strings to gcc
gcc -DgitSHA="$(git rev-parse HEAD)" main.c
@coboshm
coboshm / golang_kinesis.go
Created August 21, 2017 07:54
Golang + Kinesis firehose
package main
import (
"log"
"encoding/json"
"fmt"
"os"
"math/rand"
@tanb
tanb / xhyve-freebsd-tutorial-1.md
Last active November 27, 2021 13:07
FreeBSD running on xhyve tutorial. (Appendix: Resize image with qemu. Create FreeBSD VM with qemu).

TL;DR

  • Create 5GB FreeBSD image.
  • Install FreeBSD on xhyve.
  • Mount host directory.

Requisites

@jpillora
jpillora / sshd.go
Last active March 28, 2025 03:25
Go SSH server complete example - Read more here https://blog.gopheracademy.com/go-and-ssh/
// A small SSH daemon providing bash sessions
//
// Server:
// cd my/new/dir/
// #generate server keypair
// ssh-keygen -t rsa
// go get -v .
// go run sshd.go
//
// Client:
@mateor
mateor / b_tree.py
Created November 12, 2014 23:17
A simple B-Tree in Python that supports insert, search and print.
# coding=utf-8
"""
author = Mateor
PYTHON 3.3.5
"""
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
@wsargent
wsargent / docker_cheat.md
Last active June 29, 2024 19:32
Docker cheat sheet