Skip to content
/ tools Public

A collection of utilities, scripts, and code snippets that are too small to warrant their own repository.

Notifications You must be signed in to change notification settings

cpwillis/tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tools

Python

Custom J2 Ext to Wrap Templates with their Filename

wrap_templates_extension.py

Add comments or annotations to template files (.html.j2, .css.j2, .js.j2) before rendering them in a Jinja environment, providing clarity about the start and end of each template block. Example usage;

if os.getenv("LOCAL_MODE") == "yes" and os.getenv("TEST_MODE") != "yes":
    from x.wrap_templates_extension import WrapTemplatesWithNames
    app_jinja_env.add_extension(WrapTemplatesWithNames)
Function Profiler

profiler.py

The profileme decorator in Python facilitates function execution profiling, directing the results to a file named after the function being profiled. It offers options to specify the directory and sorting method for the profile statistics.

Shell

Shell Colour Echo

colour_echo.sh

cecho "I'm an example." "$red"

VSCode

TODO Highlight Extension Colours

todohighlight.json --> Extension (Marketplace), Reference Colours

About

A collection of utilities, scripts, and code snippets that are too small to warrant their own repository.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published