Skip to content

Instantly share code, notes, and snippets.

View mbarkhau's full-sized avatar
💭

mbarkhau

💭
  • Cyberspace
View GitHub Profile
@mbarkhau
mbarkhau / keybase.md
Created September 12, 2019 12:58
keybase.md

Keybase proof

I hereby claim:

  • I am mbarkhau on github.
  • I am mbarkhau (https://keybase.io/mbarkhau) on keybase.
  • I have a public key ASDws--anHB5yrkAliIckzEtrPRKXHcRLFPcfU3-JiiqRwo

To claim this, I am signing this object:

@mbarkhau
mbarkhau / weekly-micro-journal-template.html
Created September 1, 2019 17:57
weekly-micro-journal-template.html
<html>
<head>
<style>
body {
font-family: Bitter;
font-size: 10pt;
}
body, html {
margin: 0;
@mbarkhau
mbarkhau / do_nothing_script.py
Created July 22, 2019 19:54
do_nothing_script.py
#!/usr/bin/env python3
# Based on this https://news.ycombinator.com/item?id=20495739
# I created this boilerplate which I think is a bit nicer to use.
import sys
class AttrDict(dict):
@mbarkhau
mbarkhau / katex_static_test.html
Last active May 17, 2019 20:55
Page which includes a statically rendered formula (ie. no javascript).
<!DOCTYPE html>
<html>
<head>
<title>Test Katex</title>
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.css"
integrity="sha256-SSjvSe9BDSZMUczwnbB1ywCyIk2XaNly9nn6yRm6WJo="
crossorigin="anonymous">
<style type="text/css">
@mbarkhau
mbarkhau / .bash_prompt
Created February 6, 2019 18:06
.bash_prompt
#!/bin/bash
#
# DESCRIPTION:
#
# 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
mbarkhau / bin ipy
Last active October 19, 2019 14:17
ipy with default imports
/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;"
@mbarkhau
mbarkhau / bin std_tmux
Last active February 6, 2019 18:02
tmussh
#!/bin/bash
bash /home/mbarkhau/bin/tmush mbarkhau@localhost
@mbarkhau
mbarkhau / watchit.sh
Created January 28, 2019 09:36
Shell script that is similar to `watch -c`, but output is cleared.
#!/bin/sh
HOME=$(tput cup 0 0)
ED=$(tput ed)
EL=$(tput el)
printf '%s%s' "$HOME" "$ED"
while true
do
ROWS=$(tput lines)
COLS=$(tput cols)
CMD="$@"
@mbarkhau
mbarkhau / black_alignment_postproc.py
Last active September 10, 2018 18:52
black_alignment_postproc.py
import re
from enum import Enum
from typing import *
FileContent = str
str_contents = """
#!/usr/bin/env python3
@mbarkhau
mbarkhau / kinds_of_namedtuple_parameters.py
Last active September 7, 2018 14:43
kinds_of_namedtuple_parameters.py
# copied as literally as possible from here
# https://mypy.readthedocs.io/en/latest/kinds_of_types.html#the-type-of-class-objects
from typing import NamedTuple, TypeVar, Type
class Env(NamedTuple):
log_level: str = "DEBUG"