Skip to content

Instantly share code, notes, and snippets.

---
import { somefunc } from "../lib/utils";
---
<h1>My page</h1>
@riverfr0zen
riverfr0zen / walk_for_subclasses.py
Last active April 1, 2020 17:51
walk_for_subclasses(): Recursively go through a python package to find subclasses of klass
def walk_for_subclasses(pkg, klass):
""" Find subclasses of klass declared under pkg """
def load_package_modules():
# This function imports the modules in package, it is not where
# subclasses are collected
for module_finder, name, ispkg in walk_packages(
path=pkg.__path__,
prefix=f"{pkg.__name__}."
):
@riverfr0zen
riverfr0zen / processing.py.pyflakes_ignore.example
Last active March 15, 2018 22:24
For Processing.py: Ignoring Processing keywords in SublimePythonIDE linter
/**
* Gist: https://gist.github.com/riverfr0zen/9fe49ce07efb7646e7f8a7acff7fbe9f
* See also related StackOverflow conversation:
* https://stackoverflow.com/questions/48724061/ignore-undefined-name-for-certain-global-keywords-w-sublimelinter-flake8/49221082
*
* Ignore Processing keywords in SublimePythonIDE's linter for
* SublimeText3 when developing for Processing.py.
*
* Based on Processing.py reference here:
* http://py.processing.org/reference/