- Cmd+left arrow, Cmd+right arrow - navigates among tabs.
- Cmd+number - navigates directly to a tab.
- Cmd+Option+Number - navigates directly to a window.
- Cmd+Option+Arrow keys navigate among split panes.
- Cmd+] and Cmd+[ navigates among split panes in order of use.
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
def get_pdf_contract(context_data): | |
html_string = render_to_string("mobile/loan_terms.html", context_data) | |
html = HTML(string=html_string) | |
contract_file = BytesIO(html.write_pdf()) | |
print(contract_file) | |
html.write_pdf(target='/tmp/loan.pdf'); | |
fs = FileSystemStorage('/tmp') | |
with fs.open('loan.pdf') as pdf: |
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
# To start: | |
# curl https://gist.githubusercontent.com/vgk77/b249a4721246ca518382f8e27e78ecfa/raw/12eab95e674c0c0517c8562c7e546ed9f8fbc049/hz_setup.sh | sudo bash | |
#update packages | |
apt update && apt upgrade -y | |
apt install mc git vim htop iftop qemu-guest-agent apt-transport-https ca-certificates curl software-properties-common make -y | |
#change hostname | |
#sudo hostnamectl set-hostname YOU_HOST_NAME |
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
https://developer.mozilla.org/en-US/docs/Archive/Misc_top_level/Same-origin_policy_for_file:_URIs | |
about:config -> security.fileuri.strict_origin_policy -> false |
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
price = MoneyField(max_digits=14, decimal_places=2, coerce_to_string=False) |
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
from django.contrib.postgres.search import TrigramSimilarity | |
def find_product_using_trigram_similarity( | |
pricelist_product: str, min_similarity=0.3 | |
) -> Optional[Product]: | |
"""Find the most similar product to the pricelist product | |
using trigram similarity search. | |
""" | |
return ( |
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
import multiprocessing as mp | |
print(mp.cpu_count()) |
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
# set mac | |
/interface ethernet set ether4 mac-address=XX-XX-XX-XX-XX-XX | |
#reset mac | |
/interface ethernet reset-mac-address ether4 |
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
*.ipynb_checkpoints | |
*.DS_Store | |
*__pycache__ | |
*._* | |
*.log | |
# Byte-compiled / optimized / DLL files | |
__pycache__/ | |
*.py[cod] | |
*$py.class |
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
#GET | |
curl "uri?key1=value1&key2=value2" | |
#POST | |
curl -d "key1=value1&key2=value2" "uri" | |
#DELETE | |
curl -X DELETE "uri" | |
#POST request.json with headers |