Skip to content

Instantly share code, notes, and snippets.

View thautwarm's full-sized avatar
🧐

Taine Zhao thautwarm

🧐
View GitHub Profile
@ertseyhan
ertseyhan / remount.sh
Created February 2, 2016 20:51
Temporarily increase size of tmp folder on Arch linux
#!/bin/bash
sudo mount -o remount,size=10G,noatime /tmp
echo "Done. Please use 'df -h' to make sure folder size is increased."
@delimitry
delimitry / uint_7bit.py
Last active November 7, 2022 16:09
Python version of unsigned integer 7-bit encoder and decoder
#!/usr/bin/evn python
# -*- coding: utf8 -*-
def encode_to_7bit(value):
"""
Encode unsigned int to 7-bit str data
"""
data = []
number = abs(value)
while number >= 0x80:
@delimitry
delimitry / python_hashes.py
Last active September 24, 2020 11:47
Python hash algorithms
#!/usr/bin/evn python
# -*- coding: utf-8 -*-
import sys
import math
import struct
if sys.version_info > (3, 0):
basestring_type = str
else:
@kseo
kseo / recon.ml
Last active March 28, 2024 14:41
A Hindley-Milner type inference implementation in OCaml
#! /usr/bin/env ocamlscript
Ocaml.ocamlflags := ["-thread"];
Ocaml.packs := [ "core" ]
--
open Core.Std
type term =
| Ident of string
| Lambda of string * term
| Apply of term * term
@arctangent
arctangent / hmazed.hs
Created December 29, 2011 10:00
Maze generator in Haskell
-- Simple maze generator in Haskell
-- Jacob Conrad Martin
-- http://jacobconradmartin.com
import System.Random
import Debug.Trace
import Control.Monad.State
data Location = Location { x::Int, y::Int } deriving (Eq)
data Path = Path { from::Location, to::Location } deriving (Eq)