Skip to content

Instantly share code, notes, and snippets.

View mmattamala's full-sized avatar

Matias Mattamala mmattamala

View GitHub Profile
@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 / 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 / step_to_rviz.md
Created September 27, 2023 07:27
STEP to DAE (for URDFs)
@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 / pytorch_xavier.md
Last active July 4, 2022 16:08
Pytorch 1.10 compilation on Xavier
@mmattamala
mmattamala / conda_m1_rosetta.md
Created July 1, 2022 13:30
Setup rosetta environment on M1 conda installation

From conda-forge/miniforge#165 (comment)

CONDA_SUBDIR=osx-64 conda create -n rosetta python   # create a new environment called rosetta with intel packages.
conda activate rosetta
python -c "import platform;print(platform.machine())"
conda config --env --set subdir osx-64  # make sure that conda commands in this environment use intel packages
@mmattamala
mmattamala / linux_fusion360.md
Created November 7, 2020 12:40 — forked from probonopd/linux_fusion360.md
Autodesk Fusion 360 on Linux

Autodesk Fusion 360 on Linux

In the Web Browser

Ubuntu, Fedora, openSUSE, CentOS, SUSE Linux Enterprise, Debian,... users can finally use Autodesk Fusion 360 in the Linux Browser now.

https://myhub.autodesk360.com

On Chromium 55.0.2843.0 I get NET::ERR_CERTIFICATE_TRANSPARENCY_REQUIRED.

@mmattamala
mmattamala / integrantes.txt
Created September 1, 2020 20:21
Integrantes de Ciencia de Datos en Astronomia Primavera 2020
Vicente Aitken A.
Rodrigo Altamirano M.
Benjamín Angulo C.
Cristóbal Braga Viñals
Benjamín Briceño E.
Diego Cabezas R.
Claudia Campanini García
Anggelo G. Campos Miranda
Nicolás Correa G.
Héctor Díaz
@mmattamala
mmattamala / Using Generic Blue Pill (STM32F103C8T6).md
Last active June 14, 2022 19:43
Configuring generic Blue Pill STM32 boards in Windows