Skip to content

Instantly share code, notes, and snippets.

@pandemicsyn pandemicsyn/something.sh
Last active Dec 21, 2015

Embed
What would you like to do?
Reverse all the prompts!
in a file called ~/.reverseit.py:
#!/usr/bin/python
# -*- coding: UTF-8 -*-
from sys import stdin, stdout
pchars = u"abcdefghijklmnopqrstuvwxyz,.?!'()[]{}"
fchars = u"ɐqɔpǝɟƃɥıɾʞlɯuodbɹsʇnʌʍxʎz'˙¿¡,)(][}{"
flipper = dict(zip(pchars, fchars))
def flip(s):
charList = [ flipper.get(x, x) for x in s.lower() ]
charList.reverse()
return "".join(charList).strip('\n')
stdout.write(flip(stdin.read()).encode('utf8'))
in le bashrc:
function exitstatus {
EXITSTATUS="$?"
BOLD="\[\033[1m\]"
GREEN="\[\033[1;32m\]"
RED="\[\033[1;31m\]"
OFF="\[\033[m\]"
if [ "$EXITSTATUS" -eq "0" ]
then
PS1="${GREEN}\u@\h:\w${OFF}$(__git_ps1)$(check_virt_env)\$ "
echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}";echo -ne "\007"
else
TMP="${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}"
RPS1=`echo $TMP | python ~/.reverseit.py`
PS1="(╯°□°)╯ ${RED}$RPS1${OFF}$(__git_ps1)\$ "
fi
PS2="${BOLD}>${OFF} "
}
PROMPT_COMMAND=exitstatus
@pandemicsyn

This comment has been minimized.

Copy link
Owner Author

commented Aug 22, 2013

Result:

fhines@kira:~/vm/fhines/coc/dot-files (master)$ wtf
-bash: wtf: command not found
(╯°□°)╯ sǝlıɟ-ʇop/ɔoɔ/sǝuıɥɟ/ɯʌ/~:ɐɹıʞ@sǝuıɥɟ (master)$ 
@pandemicsyn

This comment has been minimized.

Copy link
Owner Author

commented Aug 22, 2013

heh typo, should read: PS1="(╯°□°)╯ ${RED}$RPS1${OFF}$(__git_ps1)$ "

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.