Skip to content

Instantly share code, notes, and snippets.

View Chubek's full-sized avatar

Behrang Nevii Chubek

View GitHub Profile
@Chubek
Chubek / x86asm-dossier.html
Last active October 12, 2025 10:02
x86-64 Dossier
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<!-- KaTeX CSS -->
@Chubek
Chubek / typethm-dossier.md
Created October 8, 2025 03:44
LLM-generated book on type theory
@Chubek
Chubek / x86-64-dossier.html
Created October 7, 2025 07:05
x86-64 book
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<!-- KaTeX CSS -->
@Chubek
Chubek / distance-based-hashtbl.c
Created September 30, 2025 00:13
Distance-based Hashtable
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "ph-hashtbl.h"
#include "ph-object.h"
#include "ph-utils.h"
DIY_Hashtbl *
@Chubek
Chubek / hwinfo.txt
Created September 14, 2025 17:09
My 'short' hardware info
cpu:
11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz, 4607 MHz
11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz, 4600 MHz
11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz, 4680 MHz
11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz, 4619 MHz
11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz, 4622 MHz
11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz, 4638 MHz
11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz, 4689 MHz
11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz, 4633 MHz
11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz, 800 MHz
@Chubek
Chubek / 6502-instr.tsv
Created September 11, 2025 11:11
6502 instructions, with mnemonics, opcodes, bytes, cycles
ADC N=+,Z=+,C=+,I=-,D=-,V=+, immediate, 0x69 2 2
ADC N=+,Z=+,C=+,I=-,D=-,V=+, zeropage, 0x65 2 3
ADC N=+,Z=+,C=+,I=-,D=-,V=+, zeropage,X, 0x75 2 4
ADC N=+,Z=+,C=+,I=-,D=-,V=+, absolute, 0x6D 3 4
ADC N=+,Z=+,C=+,I=-,D=-,V=+, absolute,X, 0x7D 3 4*
ADC N=+,Z=+,C=+,I=-,D=-,V=+, absolute,Y, 0x79 3 4*
ADC N=+,Z=+,C=+,I=-,D=-,V=+, (indirect,X), 0x61 2 6
ADC N=+,Z=+,C=+,I=-,D=-,V=+, (indirect),Y, 0x71 2 5*
AND N=+,Z=+,C=-,I=-,D=-,V=-, immediate, 0x29 2 2
AND N=+,Z=+,C=-,I=-,D=-,V=-, zeropage, 0x25 2 3
@Chubek
Chubek / 6502-instrs.tsv
Last active September 14, 2025 16:14
6502 Instructions Dataset (with numeric opcodes and address modes)
ADC N=+,Z=+,C=+,I=-,D=-,V=+ immediate 0x69 2 2
ADC N=+,Z=+,C=+,I=-,D=-,V=+ zeropage 0x65 2 3
ADC N=+,Z=+,C=+,I=-,D=-,V=+ zeropageX 0x75 2 4
ADC N=+,Z=+,C=+,I=-,D=-,V=+ absolute 0x6D 3 4
ADC N=+,Z=+,C=+,I=-,D=-,V=+ absoluteX 0x7D 3 4*
ADC N=+,Z=+,C=+,I=-,D=-,V=+ absoluteY 0x79 3 4*
ADC N=+,Z=+,C=+,I=-,D=-,V=+ indirectX 0x61 2 6
ADC N=+,Z=+,C=+,I=-,D=-,V=+ indirectY 0x71 2 5*
AND N=+,Z=+,C=-,I=-,D=-,V=- immediate 0x29 2 2
AND N=+,Z=+,C=-,I=-,D=-,V=- zeropage 0x25 2 3
@Chubek
Chubek / README.md
Created September 3, 2025 03:03
Fish function for getting the value of IRR against USD

Get-IRR2USD Fish Function

Below is a small, tiny Fish shell function that, when ran, notifies you of the price of IRR against USD. For example:

$ get-irr2usd
> USD <-> IRR XCHG Price: 1036862IRR

It does not have any parameters, but it takes one extra step, and saves the result of your query into a file specified by the GET_IRR2USD_LOG_FILE environment variable. You can set this variable in $XDG_CONFIG_HOME/fish/config.fish. On most distributions, this is equivalent to ‍÷/.config/fish/config.fish.

@Chubek
Chubek / demo.tex
Created September 1, 2025 21:45
LaTeX demo
\documentclass[12pt,a4paper]{article}
% --- Packages for General Utilities ---
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{lipsum} % filler text
\usepackage{microtype} % better typography
% --- Page and Graphics ---