Skip to content

Instantly share code, notes, and snippets.

View tmountain's full-sized avatar

Travis Whitton tmountain

  • Gainesville, FL
View GitHub Profile
# cat extlinux.conf
# Generated file, all changes will be lost on nixos-rebuild!
# Change this to e.g. nixos-42 to temporarily boot to an older configuration.
DEFAULT nixos-default
MENU TITLE ------------------------------------------------------------
TIMEOUT 50
LABEL nixos-default
@tmountain
tmountain / brcmfmac4356-sdio.txt
Created January 29, 2021 22:05
firmware for brcmfmac4356
# Sample variables file for BCM94356Z NGFF 22x30mm iPA, iLNA board with PCIe for production package
NVRAMRev=$Rev: 492104 $
#4356 chip = 4354 A2 chip
sromrev=11
boardrev=0x1102
boardtype=0x073e
boardflags=0x02400201
#0x2000 enable 2G spur WAR
boardflags2=0x00802000
boardflags3=0x0000000a
[ 0.000000] Booting Linux on
physical CPU 0x0000000000 [0x410fd034]
[ 0.000000] Linux version 5.4.89 (nixbld@localhost) (gcc version 9.3.0 (GCC)) #1-NixOS SMP Tue Jan 12 19:16:25 UTC 2021
[ 0.000000] Machine model: FriendlyElec NanoPC-T4
[ 0.000000] efi: Getting EFI parameters from FDT:
[ 0.000000] efi: UEFI not found.
[ 0.000000] cma: Reserved 32 MiB at 0x00000000f6000000
[ 0.000000] NUMA: No NUMA configuration found
[ 0.000000] NUMA: Faking a node at [mem 0x0000000000200000-0x00000000f7ffffff]
[ 0.000000] NUMA: NODE_DATA [mem 0xf57ef800-0xf57f0fff]
[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[ 0.000000] Linux version 5.4.89 (nixbld@localhost) (gcc version 9.3.0 (GCC)) #1-NixOS SMP Tue Jan 12 19:16:25 UTC 2021
[ 0.000000] Machine model: FriendlyElec NanoPC-T4
[ 0.000000] efi: Getting EFI parameters from FDT:
[ 0.000000] efi: UEFI not found.
[ 0.000000] cma: Reserved 32 MiB at 0x00000000f6000000
[ 0.000000] NUMA: No NUMA configuration found
[ 0.000000] NUMA: Faking a node at [mem 0x0000000000200000-0x00000000f7ffffff]
[ 0.000000] NUMA: NODE_DATA [mem 0xf57ef800-0xf57f0fff]
[ 0.000000] Zone ranges:
@tmountain
tmountain / gofib.go
Created February 27, 2020 19:04
Testing Golang's ability to saturate cores
package main
import (
"fmt"
)
func fibonacci(n uint) uint64 {
if n <= 1 {
return uint64(n)
}
@tmountain
tmountain / tmux-cheat-sheet.md
Created October 16, 2019 19:41 — forked from michaellihs/tmux-cheat-sheet.md
tmux Cheat Sheet
@tmountain
tmountain / gist:9efe97933a8326c508322c71547170c0
Created June 14, 2019 14:56
transaction isolation levels
mysql> describe account;
+----------+------------------+------+-----+-------------------+-------------------+
| Field | Type | Null | Key | Default | Extra |
+----------+------------------+------+-----+-------------------+-------------------+
| id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| username | varchar(255) | NO | | NULL | |
| ts | timestamp | YES | | CURRENT_TIMESTAMP | DEFAULT_GENERATED |
+----------+------------------+------+-----+-------------------+-------------------+
3 rows in set (0.01 sec)
Travis-Whitton's-MacBook-Pro:nix traviswhitton$ cat node.nix
# This imports the nix package collection,
# so we can access the `pkgs` and `stdenv` variables
with import <nixpkgs> {};
# Make a new "derivation" that represents our shell
stdenv.mkDerivation {
name = "my-environment";
# The packages in the `buildInputs` list will be added to the PATH in our shell
@tmountain
tmountain / gen_rel_table.rb
Created November 15, 2018 22:16
Generates a table of farmers/cows given a file with one name per line.
#!/usr/bin/ruby
fh = File.new('names.csv', 'r')
names = []
while line = fh.gets
line.chomp!
names << line
end
names = names.shuffle
Scalable program architectures
Haskell design patterns differ from mainstream design patterns in one important way:
Conventional architecture: Combine a several components together of type A to generate a "network" or "topology" of type B
Haskell architecture: Combine several components together of type A to generate a new component of the same type A, indistinguishable in character from its substituent parts
This distinction affects how the two architectural styles evolve as code bases grow.
The conventional architecture requires layering abstraction on top of abstraction: