Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block mbarkhau

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
#!/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 Feb 6, 2019
ipy with default imports
View bin ipy
/home/mbarkhau/miniconda3/envs/py37/bin/ipython -i -c "import itertools as it; from statistics import *;import functools as ft;import operator as op;import io;import pathlib as pl;import pandas as pd;import numpy as np;import typing as typ;from math import *;import enum;import re;import sys;import os;import ujson as json;import collections;import random;import decimal;import fractions;import time;import datetime as dt;"
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"
mbarkhau / wordlist_256.txt
Last active Aug 3, 2018
View wordlist_256.txt
# The goal behind this wordlist is to make
# a 1:1 encoding between words/symbols and bytes. It should
# be possible to memorize data encoded with these words.
# - Each word has a unique two letter prefix.
# - Each word has high number of syllables, to enable
# reliable verbal communication (like nato code words).
# - Each word has a levenshtein distance >= 3 to any other word
# in the wordlist.
mbarkhau /
Last active May 30, 2018
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import sys
import time
You can’t perform that action at this time.