Skip to content

Instantly share code, notes, and snippets.

PROMPT="%F{magenta}\$?"
PROMPT=$PROMPT"%F{red}|%F{cyan}\${timer_show}%F{red}"
PROMPT=$PROMPT"%F{red}|%F{green}\$(date "+%H:%M:%S" )"
PROMPT=$PROMPT"%F{red}|%F{yellow}%~"
PROMPT=$PROMPT"%F{red}|%F{blue}\$(git rev-parse --short HEAD 2> /dev/null | tr -d \\n )"
PROMPT=$PROMPT"%F{red}|%F{blue}\$(git rev-parse --abbrev-ref HEAD 2> /dev/null | tr -d \\n)"
PROMPT=$PROMPT'%F{red}>%f '
setopt prompt_subst
@jeanCarloMachado
jeanCarloMachado / bert_similarity.py
Last active November 29, 2021 16:27
A simpel script to rank strings based on their similarity with a query.
#!/usr/bin/env python
"""
Bert similarity script.
Save this file as bert_similarity.py and then run like this:
python bert_similarity.py rank --query "open source" "linux" "windows" "mac os"
And get a result like this:
{'similarity': 0.5847581, 'text': 'linux'}
{'similarity': 0.52185637, 'text': 'windows'}