Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@hakib
hakib / custom_django_checks.py
Last active April 10, 2024 13:01
Custom django checks using Django check framework, inspect and ast.
"""
Custom django checks.
H001: Field has no verbose name.
H002: Verbose name should use gettext.
H003: Words in verbose name must be all upper case or all lower case.
H004: Help text should use gettext.
H005: Model must define class Meta.
H006: Model has no verbose name.
H007: Model has no verbose name plural.
@meandmax
meandmax / single-and-fat-arrow-functions.md
Last active February 2, 2021 08:09
Don’t use fat arrows in CoffeeScript just because of »this«

New Coffeescript programmers usually struggle with understanding the differences between -> and => function definitions. In order to clarify this common case of confusion, it helps to look at how such functions are compiled down to JavaScript.

class A

    constructor: () ->
        @funcA()
        @funcB()

 funcA: () ->