Skip to content

Instantly share code, notes, and snippets.

@marirs
marirs / rust-cross-compile-diesel-postgresql
Last active December 9, 2022 05:11
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 April 4, 2024 05:04
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 June 30, 2024 09:27
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: