Table of Contents
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ 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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ 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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
func fibonacci(n uint) uint64 { | |
if n <= 1 { | |
return uint64(n) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
fh = File.new('names.csv', 'r') | |
names = [] | |
while line = fh.gets | |
line.chomp! | |
names << line | |
end | |
names = names.shuffle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
NewerOlder