Skip to content

Instantly share code, notes, and snippets.

# -*- coding: utf-8 -*-
#use python3 (tested on 3.7)
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.utils import formatdate
@guyarad
guyarad / csv2table.py
Created August 4, 2020 07:18 — forked from caiosba/csv2table.py
Python script to convert from CSV to a pretty ASCii table
#!/usr/bin/python
from __future__ import print_function
import prettytable
import csv
import sys
def main(argv):
if len(sys.argv) != 3:
print('Usage: python csv2table.py [input file] [output]\n')
@guyarad
guyarad / Makefile
Created October 5, 2020 10:00 — forked from mpneuried/Makefile
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
@guyarad
guyarad / fix_onedrive.sh
Created November 9, 2020 19:10 — forked from drblue/fix_onedrive.sh
Fix OneDrive for Mac CPU usage
#!/bin/bash
## Fix OneDrive for Mac CPU usage
##
## Seems this is still a problem 5 years later after I created this little gist.
## I have long since stopped using OneDrive (luckily), but according to
## comments below, I have added the new path for OfficeFileCache for macOS
## Mojave (10.14) and Catalina (10.15).
## Run this on macOS Mojave (10.14) and Catalina (10.15)
find ~/Library/Containers/ -type d -name OfficeFileCache -exec rm -r {} +
@guyarad
guyarad / HISTORY.rst
Created January 23, 2021 07:54 — forked from saaj/HISTORY.rst
Simple CPU and RSS monitor that pushes to statsd
@guyarad
guyarad / SIMPLIFY_ONEOF_ANYOF-BUG.md
Last active March 20, 2024 16:09
Simplify-oneof-anyof OpenAPI generator bug

Setup

Download the files in this gist to a folder called bug-repro.

If you wish to use openapi-generator repository, place bug-repro under the root of the repository.

Expected behavior (v7.2.0)

The Item model should have the following fields defined like so: