Skip to content

Instantly share code, notes, and snippets.

View ddanier's full-sized avatar
🤩
Code, sleep, repeat.

David Danier ddanier

🤩
Code, sleep, repeat.
View GitHub Profile
@ddanier
ddanier / class_or_instance_method.py
Last active July 10, 2020 18:46
Python class_or_instance_method decorator, passes cls and self (if available)
from typing import Callable, Type
import functools
class class_or_instance_method:
func: Callable
def __init__(self, func: Callable):
self.func = func
@nicpottier
nicpottier / README
Created April 16, 2010 18:16
Basic Django template syntax highlighting support for the codemirror editor.
These two files provide limited syntax highlighting using the most
excellent codemirror syntax highlighter.
See:
http://marijn.haverbeke.nl/codemirror/
Stick the .js and .css files in the appropriate spots for your
codemirror installation.
You can enable it on a textarea using something like: