Skip to content

Instantly share code, notes, and snippets.

View JackAtOmenApps's full-sized avatar
💭
Happily typing away

Jack at Omen Apps JackAtOmenApps

💭
Happily typing away
View GitHub Profile
@cvanelteren
cvanelteren / multilayer_layout.py
Last active January 8, 2024 20:53
Flat multilayer layout networkx
import proplot as plt, cmasher as cmr, pandas as pd, numpy as np, os, sys, networkx as nx, warnings
def multilayer_layout(
G: nx.Graph,
subset_key="layer",
layout=nx.spring_layout,
separation: float = 10.0,
) -> dict:
# set positions
@danzig666
danzig666 / geopackage_whole_project.py
Created August 11, 2020 09:22
Save whole QGIS project to geopackage
# input: all layers
# save path: save_layerpath project property / current project majority path
# replaces all postgis datasources with gpkg!
##########################
from qgis.utils import iface
from qgis.core import *
from qgis.PyQt.QtWidgets import *
from PyQt5.QtCore import *
from processing.tools import dataobjects
@smcoll
smcoll / django_migration_pk_to_uuid.py
Last active January 24, 2024 15:55
Django migration converting integer pk table to UUID pk table
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import uuid
from django.db import migrations, models
def fill_mymodel_uuid(apps, schema_editor):
db_alias = schema_editor.connection.alias
MyModel = apps.get_model('myapp', 'MyModel')