It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.
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/env bash | |
set -e | |
if [ -e static ]; then | |
rm -r static | |
fi | |
mkdir -p static | |
sass src/sass/main.scss > static/application.css | |
$(npm bin)/browserify src/js/main.js > static/application.js |
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
(Chapters marked with * are already written. This gets reorganized constantly | |
and 10 or so written chapters that I'm on the fence about aren't listed.) | |
Programmer Epistemology | |
* Dispersed Cost vs. Reduced Cost | |
* Verificationist Fallacy | |
* Mistake Metastasis | |
The Overton Window | |
Epicycles All The Way Down | |
The Hyperspace Gates Were Just There |
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
ES2015 | |
Optimisation | |
proper tail calls (tail call optimisation) | |
Syntax | |
default function parameters | |
rest parameters | |
spread syntax for iterable objects | |
object literal extensions | |
for..of loops | |
octal and binary literals |
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
# A queue that you can pass to IO.select. | |
# | |
# NOT THREAD SAFE: Only one thread should write; only one thread should read. | |
# | |
# Purpose: | |
# Allow easy integration of data-producing threads into event loops. The | |
# queue will be readable from select's perspective as long as there are | |
# objects in the queue. | |
# | |
# Implementation: |
(A book that I might eventually write!)
Gary Bernhardt
I imagine each of these chapters being about 2,000 words, making the whole book about the size of a small novel. For comparison, articles in large papers like the New York Times average about 1,200 words. Each topic gets whatever level of detail I can fit into that space. For simple topics, that's a lot of space: I can probably walk through a very basic, but working, implementation of the IP protocol.
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
commit 9f676b29d4a49356e756048ff249d17e552b5faa (HEAD -> master, origin/master) | |
Author: Gary Bernhardt <gary.bernhardt@gmail.com> | |
Date: Sun Mar 15 13:36:55 2020 -0700 | |
cache public dir between deploys (note) | |
Problem: | |
1. A deploy starts. | |
2. A browser starts loading a page. | |
3. The deploy finishes. |
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
import React, { useEffect } from "react" | |
import { META_DESCRIPTION } from "../../util" | |
export const Page: React.FC<{ | |
title?: string | |
metaDescription?: string | |
}> = props => { | |
useEffect(() => { | |
document.title = props.title ?? "Execute Program" |
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
{ | |
"extends": "../tsconfig.json", | |
"compilerOptions": { | |
"composite": true, | |
"rootDir": ".", | |
"outDir": "../../build/common" | |
}, | |
"include": ["."] | |
} |
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
function f() { | |
switch (x) { | |
case "1": | |
<div>foo</div> | |
case "2": | |
return <div> | |
<div> | |
foo | |
</div> | |
<div>foo</div> |
NewerOlder