Skip to content

Instantly share code, notes, and snippets.

View elpaso's full-sized avatar

Alessandro Pasotti elpaso

View GitHub Profile
@elpaso
elpaso / gist:7600176
Created November 22, 2013 13:52
AsyncImage glitches
# -*- coding: utf-8 -*-
"""
Test
"""
import kivy
kivy.require('1.0.7')
@elpaso
elpaso / gist:9227318
Created February 26, 2014 10:35
Django truncate HTML with smart insert
# Set up regular expressions
re_words = re.compile(r'<.*?>|((?:\w[-\w]*|&.*?;)+)', re.U | re.S)
re_chars = re.compile(r'<.*?>|(.)', re.U | re.S)
re_tag = re.compile(r'<(/)?([^ ]+?)(?:(\s*/)| .*?)?>', re.S)
re_newlines = re.compile(r'\r\n|\r') # Used in normalize_newlines
re_camel_case = re.compile(r'(((?<=[a-z])[A-Z])|([A-Z](?![A-Z]|$)))')
def add_truncation_text(text, truncate=None):
if truncate is None:
@elpaso
elpaso / MSP430 Makefile
Created February 26, 2014 11:02
msp430.mk
#
# Makefile for msp430
#
# 'make' builds everything
# 'make clean' deletes everything except source files and Makefile
# You need to set TARGET, MCU and SOURCES for your project.
# TARGET is the name of the executable file to be produced
# $(TARGET).elf $(TARGET).hex and $(TARGET).txt nad $(TARGET).map are all generated.
# The TXT file is used for BSL loading, the ELF can be used for JTAG use
#
# -*- coding: utf-8 -*-
"""
***************************************************************************
Tests for Boundless Desktop command line utilities and python modules.
Tests that common GIS related python modules are available and that
selected command line utilities can be invoked from the command line.
---------------------
@elpaso
elpaso / QEP-settings-wrapper.md
Created January 20, 2017 13:48
QGIS overridable settings

QGIS Enhancement: QGIS overridable settings

Date 2017/01/17

Author Alessandro Pasotti (@elpaso)

Contact apasotti at boundlessgeo dot com

maintainer @elpaso

@elpaso
elpaso / connection-spy.py
Created May 3, 2017 16:52
Generate a report of Qt connection in cpp files
#!/usr/bin/env python3
"""
Create a graph of Qt connections
"""
import re
import glob
import sys
import tempfile
@elpaso
elpaso / qgis3_wsgi_server.py
Created October 5, 2017 07:22
A simple QGIS3 WSGI server experiment
#!/usr/bin/env python
# Simple QGIS 3 Server wsgi test
import signal
import sys
from cgi import escape, parse_qs
from urllib.parse import quote
# Python's bundled WSGI server
from wsgiref.simple_server import make_server
@elpaso
elpaso / build.sh
Last active October 13, 2021 04:51
Build script for Qt5 in debug mode with SIP bindings and PyQt5 QWT and QScintilla
#!/bin/bash
############################################################
# This script builds Qt5, QScintilla and qwt with
# sip Python bindings.
# Tested and developed on xenial 64bit
# All other dev packages required to build QGIS need
# to be installed with apt
# Qt is built in debug mode.
set -e
@elpaso
elpaso / processing-on-the-fly-qep.md
Last active March 2, 2018 10:01
Processing on the fly QEP

QGIS Enhancement: Run Suitable Processing Algorithms on Selected Features

Date 2018/03/02

Author Alessandro Pasotti (@elpaso), Nyall Dawson (@nyalldawson )

Contact elpaso at itopen dot it, nyall dot dawson at gmail dotcom

maintainer @elpaso, @nyalldawson

@elpaso
elpaso / layouts-text-table.md
Last active March 12, 2018 10:51
layouts-text-table

QGIS Enhancement: New Layout Widget to Populate a Text Table

Date 2018/03/12

Author Alessandro Pasotti (@elpaso), Nyall Dawson (@nyalldawson )

Contact elpaso at itopen dot it, nyall dot dawson at gmail dotcom

maintainer @elpaso, @nyalldawson