This file contains 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
import dateutil.parser, datetime, pytz | |
def printy(thing): | |
print repr(thing) | |
x = datetime.datetime.utcnow() | |
printy(x) | |
x = pytz.utc.localize(x) | |
printy(x) | |
x = x.isoformat() |
This file contains 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
$python3 test.py | |
a | |
A | |
À La Garçonne | |
b | |
B | |
$python2 test.py | |
a | |
A | |
À La Garçonne |
This file contains 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 bash | |
alias docker-ip="docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}'" | |
function _docker-ip() { | |
# No need to worry about spaces in this output, because | |
# docker only allows names in the form [a-zA-Z0-9][a-zA-Z0-9_.-]* | |
local pos_comps=$(docker ps --format "{{.ID}} {{.Names}}") | |
# $COMP_WORDS array with the current line | |
# $COMP_WORD the current word we're comping |
NewerOlder