Skip to content

Instantly share code, notes, and snippets.

View MaxwellBo's full-sized avatar
🎈
please do not swear on my profile thanks

Max Bo MaxwellBo

🎈
please do not swear on my profile thanks
View GitHub Profile
@joyrexus
joyrexus / README.md
Last active December 30, 2024 01:37
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@hediet
hediet / main.md
Last active May 11, 2025 14:55
Proof that TypeScript's Type System is Turing Complete
type StringBool = "true"|"false";


interface AnyNumber { prev?: any, isZero: StringBool };
interface PositiveNumber { prev: any, isZero: "false" };

type IsZero<TNumber extends AnyNumber> = TNumber["isZero"];
type Next<TNumber extends AnyNumber> = { prev: TNumber, isZero: "false" };
type Prev<TNumber extends PositiveNumber> = TNumber["prev"];
@lewisjb
lewisjb / min.js
Last active May 17, 2021 12:25
Minimal JS MVVM
/*
* min.js
*
* By lewisjb - 19/1/17
*
* github/lewisjb
* lewisjb.com
*
* ----------------------------------------------------------------------------
* This is meant to be a minimal MVVM written in JS.
(* Good morning everyone, I'm currently learning ocaml for one of my CS class and needed to implement
an avl tree using ocaml. I thought that it would be interesting to go a step further and try
to verify the balance property of the avl tree using the type system. Here's the resulting code
annotated for people new to the ideas of type level programming :)
*)
(* the property we are going to try to verify is that at each node of our tree, the height difference between
the left and the right sub-trees is at most of 1. *)
@dannguyen
dannguyen / sqlmd.sh
Last active June 13, 2022 20:05
A command-line function that runs a SQLite query and gets a Markdown-ready table; See console demo at https://asciinema.org/a/89573
### sqlmd
# Bash function for outputting SQLite results in Markdown-friendly table
### Dependency:
# csvlook can be found here: http://csvkit.readthedocs.io/en/540/scripts/csvlook.html
### USAGE
# $ sqlmd "SELECT name, age FROM people;" optional_db_name_argument.sqlite
### OUTPUT
@MaxwellBo
MaxwellBo / .git-commit-template.txt
Last active July 25, 2016 05:03 — forked from adeekshith/.git-commit-template.txt
A Git commit template to make it easy to enforce a good and uniform commit message style across teams.
# |<--- ^ <emoji>? <type>: <subject> ^ --->|
# |<--- v Explain why this change is being made v --->|
# |<--- v Provide links to tickets, issues or other resources v --->|
# --- COMMIT END ---
@adeekshith
adeekshith / .git-commit-template.txt
Last active October 20, 2024 21:10 — forked from Linell/.git-commit-template.txt
This commit message template helps you write great commit messages and enforce it across teams.
# <type>: (If applied, this commit will...) <subject> (Max 50 char)
# |<---- Using a Maximum Of 50 Characters ---->|
# Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23
@GMaissa
GMaissa / MacSetup.md
Last active February 8, 2018 09:25
My Mac setup
@shadmar
shadmar / QuadTree.cpp
Last active February 21, 2024 19:31
QuadTree implementation in C++ designed for use in spatial applications (maps)
//
// QuadTreeNode.cpp
//
// Created by Tomas Basham on 15/03/2014.
// Copyright (c) 2014 tomasbasham.co.uk. All rights reserved.
//
#include <iostream>
#include "QuadTree.h"
@manvijain06
manvijain06 / rts.py
Created May 26, 2015 09:41
This Python script is a basic RTS game, with a modified version of Lanchester's Square Law to calculate eventual attrition rates, as well as force sizes, for two opposing forces. It is adapted from a sample IronPython module, and works on CPython, Jython and other Python toolchains as well.
print 'RTS Simulator.'
# Import random numbers.
try:
# this should be the normal path if Python has access to the standard library.
import random
except:
# This is a fallback for IronPython when running wihtout access to the standard library
import _random as random