Skip to content

Instantly share code, notes, and snippets.

learnings.md example

  1. I learned that using the git patch tool for commits may require splitting hunks manually. See this thread about "Sorry cannot split this hunk."
  2. To show the full diff of a stash in git, use git stash show -p. See this thread as well.
  3. An interesting read on how the Source engine implements the Server-Client networking architecture. See this thread here.
  4. To fake lag (and to test prediction) in Half-Life, use the command fakelag to simulate the behavior one would experience with a less than ideal ping.
  5. Windows 8 does not support running native windows docker containers. Support began with Server 2016 / Windows 10.
  6. An interesting docu
function* fibonacci() {
let [prev, curr] = [0, 1];
while (true) {
yield curr;
[prev, curr] = [curr, prev + curr];
}
}
for (let number of fibonacci()) {
console.log(number);
// Iterative Fibonacci
// Shift values from z to x.
// x <- y <- z
// 0 <- 1 <- 1
// 1 <- 1 <- 2
// 1 <- 2 <- 3
// 2 <- 3 <- 5
// ...
const fibonacci = (seed) => {
let x = 0, y = 1, z, next = 0;