Skip to content

Instantly share code, notes, and snippets.

@jeanCarloMachado
jeanCarloMachado / 3dworldsimulator.py
Last active December 21, 2025 20:20
3d world simulator
#!/usr/bin/env python3
"""
3D World Simulator - An impressive 3D world with mountains, buildings, and exploration
Controls:
- WASD: Move forward/left/backward/right
- Q/E: Move down/up
- Mouse: Look around
- Shift: Sprint
- ESC: Exit
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'}