Skip to content

Instantly share code, notes, and snippets.

View PaoloC68's full-sized avatar

Paolo Calvi PaoloC68

View GitHub Profile
@EtsuNDmA
EtsuNDmA / django_jupyter.md
Last active April 4, 2024 17:54
Two ways to integrate Django with Jupyter (JupyterLab)

⚠️ This gist was the first time written in 2018. It was tested with django==2.2.x. It's likely to be relevant for the newer versions of django and jupyter, but I did't check that.

2023-03-15: checked it for python == 3.11, django == 4.1.7, jupyterlab = 3.6.1, django-extensions == 3.2.1, jupyter-server <= 2.0.0

Django_jupyter

Using Django project in Jupyter or JupyterLab

Method 1 (using shell_plus)

@acundari
acundari / traefik-auth.conf
Last active December 6, 2022 09:41
Traefik fail2ban
# /etc/fail2ban/filter.d/traefik-auth.conf
[Definition]
failregex = ^<HOST> \- \S+ \[\] \"(GET|POST|HEAD) .+\" 401 .+$
@allskyee
allskyee / opencv_webcam_multithread.py
Last active December 7, 2022 15:59
opencv python camera frame grab and display on different threads with safe synchronization
#!/usr/bin/env python
from threading import Thread, Lock
import cv2
class WebcamVideoStream :
def __init__(self, src = 0, width = 320, height = 240) :
self.stream = cv2.VideoCapture(src)
self.stream.set(cv2.cv.CV_CAP_PROP_FRAME_WIDTH, width)
self.stream.set(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT, height)
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active April 22, 2024 01:47
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@koniiiik
koniiiik / proposal.rst
Last active March 20, 2019 20:30
Google Summer of Code 2013 proposal: Composite Fields, vol. 2

Composite Fields, vol. 2

Abstract

Two years ago, as part of GSoC 2011, I started working on an implementation of composite fields as a means to support multi-column primary keys in models. While the project was successful, the timeframe wasn't sufficient to finish it and get it into a state where it