Skip to content

Instantly share code, notes, and snippets.



  • Cyberspace
View GitHub Profile

Keybase proof

I hereby claim:

  • I am mbarkhau on github.
  • I am mbarkhau ( on keybase.
  • I have a public key ASDws--anHB5yrkAliIckzEtrPRKXHcRLFPcfU3-JiiqRwo

To claim this, I am signing this object:

mbarkhau / weekly-micro-journal-template.html
Created Sep 1, 2019
View weekly-micro-journal-template.html
body {
font-family: Bitter;
font-size: 10pt;
body, html {
margin: 0;
#!/usr/bin/env python3
# Based on this
# I created this boilerplate which I think is a bit nicer to use.
import sys
class AttrDict(dict):
mbarkhau / katex_static_test.html
Last active May 17, 2019
Page which includes a statically rendered formula (ie. no javascript).
View katex_static_test.html
<!DOCTYPE html>
<title>Test Katex</title>
<link rel="stylesheet"
<style type="text/css">
View .bash_prompt
# Set the bash prompt according to:
# * the active virtualenv
# * the branch of the current git/mercurial repository
# * the return value of the previous command
# * the fact you just came from Windows and are used to having newlines in
# your prompts.
mbarkhau / bin ipy
Last active Oct 19, 2019
ipy with default imports
View bin ipy
/home/mbarkhau/miniconda3/envs/py37/bin/ipython -i -c "import io; import os; import re; import sys; import enum; import json; import math; import time; import random; import decimal; import fractions; import collections; import typing as typ; import pathlib as pl; import datetime as dt; import operator as op; import functools as ft; import itertools as it; import subprocess as sp; from math import *; from statistics import *; import numpy as np; import pandas as pd;"
View bin std_tmux
bash /home/mbarkhau/bin/tmush mbarkhau@localhost
mbarkhau /
Created Jan 28, 2019
Shell script that is similar to `watch -c`, but output is cleared.
HOME=$(tput cup 0 0)
ED=$(tput ed)
EL=$(tput el)
printf '%s%s' "$HOME" "$ED"
while true
ROWS=$(tput lines)
COLS=$(tput cols)
mbarkhau /
Last active Sep 10, 2018
import re
from enum import Enum
from typing import *
FileContent = str
str_contents = """
#!/usr/bin/env python3
mbarkhau /
Last active Sep 7, 2018
# copied as literally as possible from here
from typing import NamedTuple, TypeVar, Type
class Env(NamedTuple):
log_level: str = "DEBUG"