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://www.odoo.com/documentation/17.0/developer/tutorials.html | |
https://www.odoo.com/documentation/17.0/developer/tutorials/server_framework_101.html | |
https://www.odoo.com/documentation/17.0/developer/tutorials/server_framework_101/01_architecture.html | |
https://www.odoo.com/documentation/17.0/ | |
https://github.com/odoo/odoo | |
https://www.odoo.com/documentation/17.0/developer/tutorials/setup_guide.html |
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
# Updated for python3 | |
# | |
# https://stackoverflow.com/questions/20274987/how-to-use-pytest-to-check-that-error-is-not-raised/35458249#35458249 | |
# | |
from contextlib import contextmanager | |
@contextmanager | |
def not_raises(ExpectedException): | |
try: |
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
name : str = "Ray" | |
""" | |
age : int = 10 | |
is_active : bool = True | |
length : float = 2.2 | |
size : bytes = b"test" | |
""" | |
""" | |
#list |
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 my_decorator(argument): | |
def actual_decorator(func): | |
def wrapper(*args, **kwargs): | |
print(f"Decorator argument: {argument}") | |
result = func(*args, **kwargs) | |
return result | |
return wrapper | |
return actual_decorator | |
@my_decorator("example_argument") |
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
server { | |
server_name chat.example.com; | |
client_max_body_size 100M; | |
location /messaging/ { | |
proxy_pass http://127.0.0.1:9000; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "Upgrade"; | |
proxy_set_header Host $host; |
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
sudo pkill -f nginx & wait $! | |
sudo systemctl start nginx | |
× nginx.service - A high performance web server and a reverse proxy server | |
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled) | |
Active: failed (Result: exit-code) since Wed 2024-01-31 10:43:23 UTC; 3 weeks 3 days ago | |
Docs: man:nginx(8) | |
CPU: 54ms |
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 json | |
from django.conf import settings | |
from django.http import JsonResponse, HttpResponse | |
from sentry_sdk import capture_exception | |
class CaptureExceptionMiddleware: | |
def __init__(self, get_response): |
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
sonar.projectKey=User-Auth | |
sonar.sources=. | |
sonar.host.url=http://localhost:9000 | |
sonar.token=sometoke | |
sonar.exclusions=**/venv/**,**/htmlcov/**,**/requirements/**,**/docker/**,**/k8s/**,**/migrations/**,**/tests/**,**/conftest.py | |
sonar.python.coverage.reportPaths=*coverage.xml | |
sonar.coverage.exclusions=**/tests/**,**/migrations/**,**/admin.py,**/apps.py,core/asgi.py,core/wsgi.py,manage.py | |
sonar.python.version=3 | |
sonar.issue.ignore.multicriteria=nullmodel,emailtemplates | |
sonar.issue.ignore.multicriteria.nullmodel.ruleKey=python:S6553 |
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 pika | |
def test_rabbitmq_url(url): | |
try: | |
params = pika.URLParameters(url) | |
connection = pika.BlockingConnection(params) | |
connection.close() | |
print("Connection successful!") | |
except pika.exceptions.AMQPError as e: | |
print("Connection failed:", e) |
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
# some more ls aliases | |
alias ll='ls -alF' | |
alias la='ls -A' | |
alias l='ls -CF' | |
alias gc='git commit -m' | |
alias gits='git status' | |
alias gs='git status' | |
alias gp='git pull origin ' | |
alias gh='git push' | |
alias ga='git add . && git status' |
NewerOlder