Skip to content

Instantly share code, notes, and snippets.

View bjmc's full-sized avatar

Brendan McCollam bjmc

View GitHub Profile
@alexcasalboni
alexcasalboni / aws-lambda-static-type-checker.md
Last active May 22, 2023 07:31
AWS Lambda Static Type Checker Example (Python3)

How to use Python3 Type Hints in AWS Lambda

TL;DR

Static Type Checkers help you find simple (but subtle) bugs in your Python code. Check out lambda_types.py and incrementally improve your code base and development/debugging experience with type hints.

Your Lambda Function code will go from this:

@markc
markc / userChrome.css
Created March 1, 2015 05:47
Thunderbird userChrome.css for HiDPI screen
/* userChrome.css 20090601 (C) Mark Constable <[email protected]> (AGPL-3.0) */
/* Thunderbird support for wide view on a HiDPI screen (Kubuntu DPI 288) */
/* smaller folder tree fontsize */
#folderTree > treechildren {
font-size: 24px !important;
}
/* header at the top of the message content */
#msgHeaderView {
def generate_RSA(bits=2048):
'''
Generate an RSA keypair with an exponent of 65537 in PEM format
param: bits The key length in bits
Return private key and public key
'''
from M2Crypto import RSA, BIO
new_key = RSA.gen_key(bits, 65537)
memory = BIO.MemoryBuffer()
new_key.save_key_bio(memory, cipher=None)