Skip to content

Instantly share code, notes, and snippets.

View rlizzo's full-sized avatar

Rick Izzo rlizzo

  • NVIDIA
  • Morristown, NJ
  • 06:20 (UTC -04:00)
  • LinkedIn in/rlizzo
View GitHub Profile
@rlizzo
rlizzo / lai-iam-policy-v2.json
Created January 23, 2023 06:48
Lightning AI BYOC IAM policy - 2023-01-23
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"autoscaling:*",
"cloudwatch:*",
"codebuild:*",
"ec2:*",
"ecr:*",
@rlizzo
rlizzo / script-template.sh
Created December 17, 2020 03:05 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rlizzo
rlizzo / metadata
Last active April 11, 2020 19:40
Tensorwerk - Hangar-py Individual CLA
{
"name": {
"title": "Full Name",
"type": "string",
"githubKey": "name"
},
"email": {
"title": "E-Mail",
"type": "string",
"githubKey": "email",
from line_profiler import LineProfiler
def do_profile(follow=[]):
def inner(func):
def profiled_func(*args, **kwargs):
try:
profiler = LineProfiler()
profiler.add_function(func)
for f in follow:
profiler.add_function(f)
@rlizzo
rlizzo / grpc_asyncio.py
Created August 26, 2018 19:39 — forked from mmellison/grpc_asyncio.py
gRPC Servicer with Asyncio (Python 3.6+)
import asyncio
from concurrent import futures
import functools
import inspect
import threading
from grpc import _server
def _loop_mgr(loop: asyncio.AbstractEventLoop):
@rlizzo
rlizzo / numpy-fast-symmetric-pad.py
Created December 14, 2017 16:52 — forked from slode/numpy-fast-symmetric-pad.py
A faster numpy pad algorithm where the padding mode is symmetric along the axes.
"""
Copyright (c) 2017 Stian Lode,
stian.lode@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@rlizzo
rlizzo / DicomNoMeta.py
Created December 6, 2017 08:43
Anonymize DICOM data
'''
DicomNoMeta.py
For University Hospital in Krakow DICOMs
Jan Witowski / Garage of Complexity
Usage: DicomNoMeta.py <path>
Anonymizes all personal data
'''
import dicom