Skip to content

Instantly share code, notes, and snippets.

@mchant
mchant / redislogger.py
Last active May 31, 2022 05:12 — forked from brendon-codes/redislogger.py
Redis Log Handler in Python
# works with loguru
import redis
import logging
class RedisLogHandler(logging.Handler):
"""Log handler for logging logs in some redis list
"""
def __init__(self,
host='localhost',
port=6379,
@mchant
mchant / abc2pnz.py
Last active April 11, 2017 12:42
abc to pos, neg, and zero, sequences
from tkinter import *
import matplotlib
matplotlib.use('TkAgg')
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
from matplotlib.figure import Figure
import random
from math import pi
from cmath import rect
import ipdb
{
"draw_white_space": "all",
"font_size": 9,
"hot_exit": false,
"highlight_line": true,
"ignored_packages":
[
"Vintage"
],
"rulers":
[
{ "keys": ["f5"], "command": "run_existing_window_command", "args":
{
"id": "repl_python_run",
"file": "config/Python/Main.sublime-menu"
}
},
{ "keys": ["f6"], "command": "run_existing_window_command", "args":
{
"id": "repl_python_pdb",
@mchant
mchant / TLMatchingParallel
Created January 28, 2015 16:19
stub matching parallel
#input matching circuit for noise
#ZL = 50*(0.530+1j*0.033)
#output matching circuit for noise
#ZL = 50*(0.621+1j*0.063)
ZL = 0.1+1j
#gamma in
#ZL = 50*(1.458+1j*0.155)
#gamma out
#ZL = 50*(0.522+1j*0.433)
Z0 = 1
@mchant
mchant / TLMatchingSeries
Last active August 29, 2015 14:14
stub matching series
ZL = 0.1 + 1j
Z0 = 1
#####################
##Don't touch below##
#####################
from IPython.display import display, Math, Latex, HTML
import numpy as np
convert_to_sc = lambda x: ((x*10000)%5000)/10000 # this is needed because smith chart starts over at 1/2 wavelength