Skip to content

Instantly share code, notes, and snippets.


Andrés Álvarez aalvrz

View GitHub Profile
aalvrz /
Created May 6, 2020
Django database query alerting middleware
class DatabaseQueryAlertingMiddleware:
Middleware that alerts when a threshold for maximum number of database queries or total query time
is exceeded when loading views in development mode.
max_queries_threshold = 30
max_time_threshold = 5 # seconds
def __init__(self, get_response):
aalvrz /
Created Dec 21, 2017
Java FileChooserCellEditor
import java.awt.Color;
import java.awt.Component;
import java.awt.Font;
import javax.swing.DefaultCellEditor;
import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;
You can’t perform that action at this time.