Skip to content

Instantly share code, notes, and snippets.

View khanh101's full-sized avatar
🎯
Focusing

nguyễn ngọc khánh khanh101

🎯
Focusing
View GitHub Profile

Recommendations for getting started on Category Theory, from emilypi, in NE Scala Slack (#category-theory), 3/14/20:

Right, so let's just go through the branches and name the suggestions:

Pure Theory

  • Categories in Context by Riehl (Mid-Advanced): this book is concise, formal, and modern. It has a slight bias towards categorical homotopy theory, but has the most correct and relatively complete approach to understanding universal properties that I've seen in any book. This approach is the key to understanding most of the theory. The exercises in this book are 👍
  • Category Theory by Awodey (Beginner-Mid): This one was mentioned. It is a straightforward, classical approach to category theory with a bias towards categorical logic. Exercises are 👋
  • Categories for the Working Mathematician by MacLane (Mid-Advanced): the standard. Read this to complete your understanding. I would recommend this book for understanding Limits + Colimits and CCC's before Riehl if its your first r
@khanh101
khanh101 / ntuvpn.sh
Created April 1, 2021 10:42 — forked from pupboss/ntuvpn.sh
Shell script for NTU campus vpn connection
#!/usr/bin/expect
set timeout 10
spawn sudo openconnect ntuvpn.ntu.edu.sg --prot=pulse
expect "Password:"
send "ACCOUNTPWD\n"
expect "Realm"
send "Student\n"
@khanh101
khanh101 / fork.c
Created January 8, 2021 13:46 — forked from Cr4sh/fork.c
fork() for Windows
/*
* fork.c
* Experimental fork() on Windows. Requires NT 6 subsystem or
* newer.
*
* Copyright (c) 2012 William Pitcock <nenolod@dereferenced.org>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
@khanh101
khanh101 / spectre.c
Created February 15, 2019 06:08 — forked from ErikAugust/spectre.c
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
@khanh101
khanh101 / catch_segv.cpp
Last active August 11, 2021 15:48 — forked from fairlight1337/catch_segv.cpp
Catching SIGSEGV (Segmentation Faults) in C
// This code installs a custom signal handler for the SIGSEGV signal
// (segmentation fault) and then purposefully creates a segmentation
// fault. The custom handler `handler` is then entered, which now
// increases the instruction pointer by 1, skipping the current byte
// of the faulty instruction. This is done for as long as the faulty
// instruction is still active; in the below case, that's 2 bytes.
// Note: This is for 64 bit systems. If you prefer 32 bit, change
// `REG_RIP` to `REG_EIP`. I didn't bother putting an appropriate
// `#ifdef` here.