Skip to content

Instantly share code, notes, and snippets.

View michjnich's full-sized avatar

Michael J. Nicholson michjnich

View GitHub Profile
@mlorant
mlorant / git-pre-commit-hook-django
Created March 26, 2015 09:17
Django - Avoid duplicate in migration names before committing changes in Git
#!/usr/bin/python
"""
Pre-commit hook for git written in Python.
Check if there is any migration number used more than one in each
migrations folder of South or Django >= 1.7.
You can install this pre-hook by executing the command:
ln -s ./git-pre-commit-hook .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
@mikeckennedy
mikeckennedy / turnstile.py
Last active September 26, 2024 18:50
Python code for server-side Cloudflare validation (paired with client-side Cloudflare code)
# See details about Turnstile at https://blog.cloudflare.com/turnstile-private-captcha-alternative/
from typing import Optional
import pydantic
import requests
cloudflare_secret_key: Optional[str] = None