Skip to content

Instantly share code, notes, and snippets.

View JimFawkes's full-sized avatar
🐍
Learning Stuff

Moritz (Eilfort) Räpple JimFawkes

🐍
Learning Stuff
View GitHub Profile
@JimFawkes
JimFawkes / cli_env_example.go
Last active August 18, 2023 09:55
Example CLI, Env & Default Variables in Go using Viper and Cobra
// Example Usage of Viper & Cobra to parse CLI, Env & Default Vars.
//
// ------------------------------------------------------------
// $ FIRST=aaaa NUM=123 go run cli_env_example.go --first bbb
//
// Default: first=default-first, second=default-second, num=1
// Params: first=bbb, second=default-second, num=123
// ------------------------------------------------------------
// $ FIRST=aaaa NUM=123 go run cli_env_example.go --help
//
@JimFawkes
JimFawkes / summary_better_exceptions_loguru.md
Created January 28, 2019 06:02
Brief summary of the packages: better-exceptions and loguru.

Better Exceptions and Loguru

A Metis investigation by Moritz Eilfort January 28th, 2019

If you are looking for a good introduction on how to handle exceptions in python, take a look at realpython.com.

Better Exceptions - Pretty and useful exceptions in Python, automatically.

Better Exceptions is a package to improve the python Traceback. It adds syntax highlighting and the actual values that were passed to the problematic portion of the code. To use this package, install it and set the environment variable BETTER_EXCEPTIONS=1.

@JimFawkes
JimFawkes / exceptions_and_logging.py
Last active January 28, 2019 21:47
Example Code used in my Metis Investigation Presentation
"""Better Exceptions and Loguru
Metis Investigation by Moritz Eilfort
January 28th, 2019
Example code for presentation purposes.
Code: https://gist.github.com/JimFawkes/76a649c7bdf8bfbbc2b2051c98995789
Summary: https://gist.github.com/JimFawkes/e5f767288e6d8e2df8fa53b5862db9d6
"""
@JimFawkes
JimFawkes / bash-cheatsheet.sh
Created July 11, 2016 21:33 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04