Skip to content

Instantly share code, notes, and snippets.

View hoggren's full-sized avatar
💾

Patrik Höggren hoggren

💾
View GitHub Profile
@hoggren
hoggren / batcharge.py
Last active April 27, 2020 21:47 — forked from remy/batcharge.py
FORKED! I'm not the founder :)
#!/usr/bin/env python
# saved to ~/bin/batcharge.py and from
# http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/#my-right-prompt-battery-capacity
#!/usr/bin/env python
# coding=UTF-8
import math, subprocess
p = subprocess.Popen(["ioreg", "-rc", "AppleSmartBattery"], stdout=subprocess.PIPE)
output = p.communicate()[0]
@hoggren
hoggren / web-servers.md
Created October 17, 2019 18:55 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000