Skip to content

Instantly share code, notes, and snippets.

View mmattamala's full-sized avatar

Matias Mattamala mmattamala

View GitHub Profile
@mmattamala
mmattamala / pytorch_xavier.md
Last active July 4, 2022 16:08
Pytorch 1.10 compilation on Xavier
@mmattamala
mmattamala / timing.py
Last active September 19, 2023 13:04
Simple Python timing class with context manager support to track multiple events and average the timings using exponential moving average (EMA)
#!/usr/bin/env python
import time
"""
A simple Timer class with context manager support
"""
class Timer:
def __init__(self, ema=1.0):
@mmattamala
mmattamala / step_to_rviz.md
Created September 27, 2023 07:27
STEP to DAE (for URDFs)
@mmattamala
mmattamala / x11_docker_mac.md
Created November 26, 2023 23:00 — forked from cschiewek/x11_docker_mac.md
X11 in docker on macOS

To forward X11 from inside a docker container to a host running macOS

  1. Install XQuartz: https://www.xquartz.org/
  2. Launch XQuartz. Under the XQuartz menu, select Preferences
  3. Go to the security tab and ensure "Allow connections from network clients" is checked.
  4. Run xhost + ${hostname} to allow connections to the macOS host *
  5. Setup a HOSTNAME env var export HOSTNAME=`hostname`*
  6. Add the following to your docker-compose:
 environment:
@mmattamala
mmattamala / example.py
Last active May 2, 2024 08:21 — forked from matthewfeickert/README.md
Simple cProfile example with snakeviz
import cProfile
from scipy.optimize import minimize
def main():
# c.f. https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.minimize.html
func = lambda x: (x[0] - 1) ** 2 + (x[1] - 2.5) ** 2
x0 = (2, 0)
@mmattamala
mmattamala / install nano.sh
Created December 28, 2024 21:37 — forked from BlakeGardner/install nano.sh
Syntax highlighting in nano on Mac OS
# Last updated May, 2024 for Apple silicon Macs
# Install Homebrew if you don't already have it: https://brew.sh
# install nano from homebrew
brew install nano nanorc
# update your nanorc file
echo 'include "'"$(brew --cellar nano)"'/*/share/nano/*.nanorc"' >> ~/.nanorc
# close and re-open your terminal and you'll have syntax highlighting