This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # Working with branches | |
| # | |
| # Get the current branch name (not so useful in itself, but used in | |
| # other aliases) | |
| branch-name = "!git rev-parse --abbrev-ref HEAD" | |
| # Push the current branch to the remote "origin", and set it to track | |
| # the upstream branch | |
| publish = "!git push -u origin $(git branch-name)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Python 6 hrs 26 mins βββββββββββββββββββββ 65.0% | |
| TeX 1 hr 18 mins βββββββββββββββββββββ 13.3% | |
| XML 40 mins βββββββββββββββββββββ 6.8% | |
| CSS 31 mins βββββββββββββββββββββ 5.3% | |
| Other 23 mins βββββββββββββββββββββ 3.9% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| def load_gist(gist_id): | |
| """translate Gist ID to URL""" | |
| from json import load | |
| from urllib.request import urlopen | |
| gist_api = urlopen("https://api.github.com/gists/" + gist_id) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| from __future__ import annotations | |
| import json | |
| class CompactJSONEncoder(json.JSONEncoder): | |
| """A JSON Encoder that puts small containers on single lines.""" | |
| CONTAINER_TYPES = (list, tuple, dict) |
NewerOlder