Skip to content

Instantly share code, notes, and snippets.

View tyler46's full-sized avatar

Spyros Markopoulos tyler46

  • Vermantia
  • Athens, Greece
  • 15:23 (UTC -12:00)
View GitHub Profile
import logging
from weakref import WeakKeyDictionary
import nameko
from nameko.extensions import DependencyProvider
import sentry_sdk
from sentry_sdk import Hub
from sentry_sdk.utils import event_from_exception
logger = logging.getLogger("workers")
@vrslev
vrslev / main.py
Last active July 21, 2024 15:55
Automatic browser reloading in FastAPI
import os
import arel
from fastapi import FastAPI, Request
from fastapi.templating import Jinja2Templates
app = FastAPI()
templates = Jinja2Templates("templates")
if _debug := os.getenv("DEBUG"):
@vytas7
vytas7 / asgi-multipart.rst
Last active April 23, 2021 08:15
ASGI multipart form handling
@kgriffs
kgriffs / falcon-3.0-roadmap.md
Last active May 10, 2021 22:23
Falcon 3.0 Roadmap

Falcon 3.0 Roadmap

3.0.0a1

  • Review/Merge the ASGI implementation - PR #1573
  • Review/Merge native form parsing (WSGI only) - PR #1549
  • Fix doc formatting issue (see also comment on PR #1566)
  • Get tests to pass on Windows
  • Add windows gate to Travis CI
@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active June 5, 2024 21:05
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@mattbennett
mattbennett / .gitignore
Last active November 2, 2023 10:38
Nameko websocket test
*.pyc
@mattbennett
mattbennett / app.py
Last active June 3, 2024 14:14
Nameko celery integration
from flask import Flask, request
from nameko.standalone.rpc import ServiceRpcProxy
app = Flask(__name__)
@app.route('/')
def task_list():
return """
<html>
@tomchristie
tomchristie / put_as_create.py
Created November 3, 2014 11:55
PUT-as-create mixin class for Django REST framework.
class AllowPUTAsCreateMixin(object):
"""
The following mixin class may be used in order to support PUT-as-create
behavior for incoming requests.
"""
def update(self, request, *args, **kwargs):
partial = kwargs.pop('partial', False)
instance = self.get_object_or_none()
serializer = self.get_serializer(instance, data=request.data, partial=partial)
serializer.is_valid(raise_exception=True)
# MAC manipulators
alias random_mac='sudo ifconfig en0 ether `openssl rand -hex 6 | sed "s/\(..\)/\1:/g; s/.$//"`'
alias restore_mac='sudo ifconfig en0 ether YOUR_ORIGINAL_MAC_ADDRESS_GOES_HERE'
@quiver
quiver / README.md
Last active July 19, 2024 07:38
Who says PostgreSQL can't Pub/Sub like Redis?

Pub/Sub pattern with PostgreSQL's LISTEN/NOTIFY command

This is a simple chat-like program using pub-sub pattern, backed by PostgreSQL's LISTEN/NOTIFY command.

Publish

publish message to foo channel from user nickname.

$ python pub.py foo nickname
PUBLISH to channel #foo