Skip to content

Instantly share code, notes, and snippets.

@Guts
Guts / db_connections_new.py
Created January 13, 2021 10:16
QGIS API data provider
import pprint
from functools import partial
from qgis.core import QgsDataSourceUri, QgsProviderRegistry
from qgis.PyQt.QtGui import QIcon
from qgis.PyQt.QtWidgets import QDialog, QComboBox
# variables
db_types = {
# point de vigilance, les noms du type de base de données ne sont pas exactement les mêmes...
@Guts
Guts / qgis_resources_preview_table.md
Last active April 11, 2024 08:01
Script to convert a remote QRC (Qt Resources Collection files) into markdown to preview images. This example covers QGIS project.

QGIS embedded images

Remember how to use it:

from qgis.core import QgsApplication
from qgis.PyQt.QtGui import QIcon, QPixmap

images

@Guts
Guts / geojulien_feeds_subscriptions.opml
Last active November 28, 2023 11:04
Flux RSS exportés depuis Feedly
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Geo subscriptions in feedly Cloud</title>
</head>
<body>
<outline text="GIS (en)" title="GIS (en)">
<outline type="rss" text="gisn8" title="gisn8" xmlUrl="http://www.blogger.com/feeds/1381809465952493828/posts/default" htmlUrl="http://gisn8.blogspot.com/"/>
<outline type="rss" text="Spatiality Blog" title="Spatiality Blog" xmlUrl="http://spatialityblog.com/feed/" htmlUrl="https://spatialityblog.com/"/>
@Guts
Guts / .gitignore
Last active July 23, 2021 13:43
Mini RSS Reader in 1h - TP Idgeo
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
@Guts
Guts / moving_folder_tree.py
Created July 29, 2021 14:07
Move folder with all tree files in Python with pathlib and without shutil
#! python3
import logging
from pathlib import Path
logging.basicConfig(level=logging.DEBUG)
source_dir = Path("/tmp/output_build/")
dest_dir = Path("/deployment/")
@Guts
Guts / dev_qgis_plugin_setup.sh
Last active March 28, 2024 10:25
Bash script to quickly set up QGIS to develop a plugin.
#!/bin/sh
set -e
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <git remote> <git local folder>" >&2
echo "Example: $0 git@gitlab.com:Oslandia/qgis/qompligis.git /tmp/qgis_dev" >&2
exit 1
fi