Skip to content

Instantly share code, notes, and snippets.

View Tbruno25's full-sized avatar

Teejay Tbruno25

  • Bay Area
View GitHub Profile
@athiththan11
athiththan11 / pre-commit
Last active May 9, 2025 06:45
Git Pre Commit Hook for FIXME TODO
#!/bin/sh
# An hook script to verify changes to be committed do not contain
# any 'FIXME:' comments. Called by "git commit" with no arguments.
#
# The hook should exit with non-zero status after issuing an appropriate
# message if it stops the commit.
#
# To bypass this hook, use the "--no-verify" parameter when committing.
@amarao
amarao / blame-praise.py
Last active March 17, 2025 12:48
Example of argparse with subparsers for python
#!/usr/bin/env python
import argparse
def main(command_line=None):
parser = argparse.ArgumentParser('Blame Praise app')
parser.add_argument(
'--debug',
action='store_true',
help='Print debug info'
@vineethguna
vineethguna / cli_design.py
Created February 8, 2015 17:24
Command Line Tool Design Pattern
__author__ = 'Vineeth'
'''
This tutorial code block lets you know about a design pattern for command line interface tools
To illustrate i will take an example. The command line tool consists of a main command and sub commands
Each command and sub command contains of switches or arguments
I will take the main command name as "main_command"
And sub commands as "sub_command_1", "sub_command_2", "sub_command_3" so on
@Zearin
Zearin / python_decorator_guide.md
Last active April 26, 2025 15:21
The best explanation of Python decorators I’ve ever seen. (An archived answer from StackOverflow.)

NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.


Q: How can I make a chain of function decorators in Python?


If you are not into long explanations, see [Paolo Bergantino’s answer][2].