Skip to content

Instantly share code, notes, and snippets.

@nkhitrov
nkhitrov / logger.py
Last active May 6, 2024 15:18
Configure uvicorn logs with loguru for FastAPI
"""
WARNING: dont use loguru, use structlog
https://gist.github.com/nkhitrov/38adbb314f0d35371eba4ffb8f27078f
Configure handlers and formats for application loggers.
"""
import logging
import sys
from pprint import pformat
@Juul
Juul / lte_mbim_from_scratch.md
Last active May 6, 2024 15:17
How to use 4G LTE modems like the MC7455 on both Debian/Ubuntu and OpenWRT using MBIM

The purpose of this document is to get you familiar with the concepts and command line tools involved with connecting to the internet using modern 4G LTE modems on both Debian/Ubuntu and OpenWRT.

This writeup is based on my experiences with the Sierra Wireless AirPrime MC7455 modem and a Calyx (Sprint) SIM card, but it should apply to most modern 4G LTE modems.

High level overview

These are the steps required:

  • Physically connect antennas
@sergiobd
sergiobd / Dockerfile
Created September 4, 2023 07:46
Dockerfile for 3D Gaussian splatting
## Unofficial Dockerfile for 3D Gaussian Splatting for Real-Time Radiance Field Rendering
## Bernhard Kerbl, Georgios Kopanas, Thomas Leimkühler, George Drettakis
## https://repo-sam.inria.fr/fungraph/3d-gaussian-splatting/
# Use the base image with PyTorch and CUDA support
FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-devel
# NOTE:
# Building the libraries for this repository requires cuda *DURING BUILD PHASE*, therefore:
@WeirdConstructor
WeirdConstructor / RustAudioLinkCollection.md
Last active May 6, 2024 15:13
Rust Audio Link Collection

Weird Constructor's (slightly opinionated) Rust Audio Link Collection

@leohoy
leohoy / ALKIS.py
Last active May 6, 2024 15:08
A python based NAS XML converter to any geo format with the help of gdal and geopandas
from osgeo import ogr
import os
import geopandas as gp
from sys import getsizeof
dictwhichfileiswhichclass={}
for filename in os.listdir('ALKIS'):
if filename.endswith(".xml"):
file1 = open('ALKIS/{}'.format(filename), "r+")
data = file1.read()
@luzfcb
luzfcb / configurar_pyenv.md
Last active May 6, 2024 15:08
instalar pyenv no ubuntu
@mimukit
mimukit / block_youtube_shots.md
Created December 6, 2022 18:33
Disable youtube shots on browser using ublock origin

How to block youtube shorts using ublock origin

  • Add the following script to your ad blocker. I used Ublock Origin (Dashboard > My Filters). It may work with other add-ons.
www.youtube.com##:xpath(//ytd-grid-video-renderer[descendant::a[contains(@href,"shorts")] and not(contains(@class,"shelf"))])
  • Click on Apply changes.
@AustinEast
AustinEast / haxeflixel-pixel-perfect.md
Last active May 6, 2024 15:07
Pixel perfect rendering with HaxeFlixel on desktop targets

To get Haxeflixel to maintain 1:1 pixel rendering at any scale for desktop targets:

In your Project.xml, add a new window property with an desktop conditional, resizable set to false, and the desired width/height to match the resolution you'd like to maintain.

<window if="desktop" resizable="false" width="320" height="180" />

Apply a shader to the FlxGame instance or the main FlxCamera instance as a filter. The base FlxShader can even just be used if the project doesn't require custom shaders.

FlxG.game.setFilters([new ShaderFilter(new FlxShader())]);
@scivision
scivision / Readme.md
Last active May 6, 2024 15:16
build script for LLVM & Flang-f18 Fortran compiler

Build script for Flang-f18 + LLVM

This is a Bash script (macOS, Linux, ...) for building Flang-f18 and LLVM from source. It is adapted from Jeff Hammond

Ninja is recommended for best build efficiency and speed.

bash build-flang-f18.sh
@mattiasgustavsson
mattiasgustavsson / gist:b97e9e59e5e1742dcabff60179fcda67
Created April 7, 2022 14:13
Simple string allocation system, allowing for freeing all allocated strings in one go
#define STR_NEW( pool, str ) ( pool = memcpy( (char*) memcpy( malloc( ( str ? strlen( str ) : 0 ) + 1 + \
sizeof( char* ) ), &pool, sizeof( char* ) ) + sizeof( char*), str ? str : "", ( str ? strlen( str ) : 0 ) + 1 ) )
#define STR_FREE( pool ) while( pool ) { char* STR_FREE_TMP = ( pool - sizeof( char* ) ); \
pool = ( *(char**)STR_FREE_TMP ); free( STR_FREE_TMP ); }
//---------------------------
char* strpool = NULL;