Skip to content

Instantly share code, notes, and snippets.

@marirs
marirs / rust-cross-compile-diesel-postgresql
Last active September 15, 2024 16:30
Rust Cross Compile Diesel-PostgreSQL for Linux on Mac M1
# Download the Source
```bash
cd /tmp/
wget https://ftp.postgresql.org/pub/source/v14.2/postgresql-14.2.tar.gz
tar xvf postgresql-14.2.tar.gz
cd postgresql-14.2
```
# Configure
# - with openssl
@marirs
marirs / rust-cross-compile-openssl
Last active October 31, 2024 15:39
Rust OpenSSL Cross Compile for Linux on Mac M1
# Install the toolchain
```bash
brew tap SergioBenitez/osxct
brew install x86_64-unknown-linux-gnu
```
# this should get installed in:
# /opt/homebrew/Cellar/x86_64-unknown-linux-gnu/
# Installing the macOS OpenSSL - if not already installed
@Integralist
Integralist / Python Asyncio Timing Decorator.py
Last active October 24, 2024 12:28
Python Asyncio Timing Decorator
import asyncio
import time
def timeit(func):
async def process(func, *args, **params):
if asyncio.iscoroutinefunction(func):
print('this function is a coroutine: {}'.format(func.__name__))
return await func(*args, **params)
else: