🎯
- https://www.youtube.com/c/IshwarJangid
- https://ishwarjangid.com
- @IshwarSJangid
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
| """ | |
| Fast-path interpreter — deterministic classification with zero LLM tokens. | |
| Handles ~80% of user inputs: exact matches, partial matches, numbers, keywords. | |
| """ | |
| from __future__ import annotations | |
| import re | |
| from typing import Any |
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 time | |
| from threading import Thread | |
| class Node: | |
| """ | |
| Represents a basic database node. This can be a leader or follower. | |
| """ | |
| def __init__(self, node_id): | |
| self.node_id = node_id | |
| self.data = {} |
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
| <form action="" method='post'> | |
| {% csrf_token %} | |
| <p><label for="id_phone">Phone:</label> <input type="number" name="phone" required id="id_phone"></p> | |
| <span id='msg'></span> | |
| <br> | |
| <p><label for="id_otp">Otp:</label> <input type="number" name="otp" required id="id_otp"></p> |
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
| Paste this at the bottom of settings.py file | |
| STATIC_URL = '/static/' | |
| STATICFILES_DIRS = [ | |
| os.path.join(BASE_DIR, "static_my_proj"), | |
| ] | |
| STATIC_ROOT = os.path.join(os.path.dirname( |
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 string | |
| from django.utils.text import slugify | |
| def random_string_generator(size=10, chars=string.ascii_lowercase + string.digits): | |
| return ''.join(random.choice(chars) for _ in range(size)) | |
| def unique_slug_generator(instance, new_slug=None): |