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 python | |
| # This is a better way to do git branch. This orders branches by last modified | |
| # date and prints the branch notes along with the branch. | |
| # Branches with '+' and '_' in front come first | |
| import subprocess | |
| import sys | |
| from dateutil.parser import parse | |
| import os |
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
| # This prints a spiral onto the terminal. | |
| # It is composed of a few list comprehensions, a few ternary expressions, and a y-combinator | |
| # The only python keywords used: print, join, in, lambda, if, else, int, and, or, range | |
| # No libraries are used | |
| # It is 308 characters although I think it would be possible to get it under 300 | |
| # with some further optimization of the spiral generator. Particularly I think | |
| # it might be possible to build this without storing state recursively at the | |
| # expense of some additional computation. This could be done by finding an | |
| # expression that would map the element index of the spiral to the coordinates |
NewerOlder