Skip to content

Instantly share code, notes, and snippets.

View mrnugget's full-sized avatar

Thorsten Ball mrnugget

View GitHub Profile
@mrnugget
mrnugget / tucan_bibliography.md
Last active February 21, 2024 15:42
Tucan Bibliography. Majority of the resources I used to build Tucan, my toy optimizing compiler in Rust

Tucan - Bibliography

Majority of the resources I used to build Tucan, my toy optimizing compiler in Rust. This list is not complete but most of the things listed here are things I really read through and used.

Books

  • Engineering a compiler (I use this a lot! For SSA, dominance and optimizations)
  • [Static Single Assignment Book][ssabook] (I use this a lot!)
  • Types And Programming Languages
@mrnugget
mrnugget / pg_test_fsync_outputs.md
Created August 2, 2021 08:40
Notes from debugging difference in Postgres performance between 16in MBP and Linux machine with roughly same specs.

pg_test_fsync outputs

On macOS on the 16" MBP:

pg_test_fsync
5 seconds per test
Direct I/O is not supported on this platform.

Compare file sync methods using one 8kB write:
@mrnugget
mrnugget / update-circle-ci-docker-user.campaign.yaml
Created February 12, 2021 11:29
Sourcegraph campaign to change Docker Hub username in Circle CI configuration
name: update-circle-ci-docker-user.campaign.yaml
description: Changes the Docker Hub username used for Circle CI
# Search for repositories containing a circle-ci.yml file with the old usename
on:
- repositoriesMatchingQuery: mydockerhub-user file:circle-ci.[yaml|yml]
# In each repository
steps:
# replace the old with the new username in the found files
@mrnugget
mrnugget / webtesting.md
Last active January 29, 2021 23:24
twop: My thoughts on web testing

The following was written by Simon Korzunov

Decided to capture my thoughts in a document. The intent of this document is to be a starting point of a discussion.

So here are my recollection of thoughts/feedback on freshly added testing doc (thanks @felixfbecker!).

On goals

In general I do agree with the stated goals, but I would love to simplify/reduce number of them.

use std::cell::RefCell;
use std::collections::{HashMap, HashSet};
use std::fmt;
use crate::ast::*;
use super::{symbol_table::Def, Context};
#[derive(PartialEq, Eq, Copy, Clone, Debug, Hash)]
pub struct BlockId(pub usize);

Windows and Linux logbook

Date: December 2020

  • Windows 10: time is always outdated. I have to sync time every time I reboot.

  • Windows 10: login never accepts password on first try. Known problem.

  • Ubuntu: can't show network activity, because my motherboard seems to be too new?

  • Ubuntu: 4k display and scaling means font sizes are all over the place. Spotify is tiny. Terminal font needs to be two points smaller to match what it

@mrnugget
mrnugget / expend_end_statement.patch
Created August 18, 2020 05:25
Change the Monkey parser to expect expression statements to either end in a semicolon, a closing brace (because of `if (x) { foo }`) or EOF
diff --git a/parser/parser.go b/parser/parser.go
index dbd581d..c7ebdf9 100644
--- a/parser/parser.go
+++ b/parser/parser.go
@@ -114,6 +114,20 @@ func (p *Parser) expectPeek(t token.TokenType) bool {
}
}
+func (p *Parser) expectStatementEnd() bool {
+ switch p.peekToken.Type {
@mrnugget
mrnugget / technical_papers_reading_log_2020.md
Created March 3, 2020 13:51
Technical Papers - Reading Log 2020

Technical Papers

2019

  1. Oct 15: Google's Bigtable paper
  2. Dec 5: "Producing Wrong Data Without Doing Anything Obviously Wrong!" +

2020

  1. Jan 20: "Source Code Rejuvenation is not Refactoring" +
package main
import (
"fmt"
"io"
"os"
"sync"
"time"
"github.com/fatih/color"
SET search_path=query_test;
DROP SCHEMA IF EXISTS query_test CASCADE;
CREATE SCHEMA query_test;
CREATE TABLE campaign_jobs (
id bigserial PRIMARY KEY,
campaign_plan_id int
);
INSERT INTO campaign_jobs (campaign_plan_id)