Skip to content

Instantly share code, notes, and snippets.

View moosetraveller's full-sized avatar

Thomas Zuberbühler moosetraveller

View GitHub Profile
@yassineAlouini
yassineAlouini / csv_to_geojson.py
Created January 19, 2017 09:57
Load a CSV file with latitude and longitude columns and transform it into a GeoJSON.
import pandas as pd
import geopandas as gpd
from shapely.geometry import Point
import json
def df_to_gdf(input_df):
"""
Convert a DataFrame with longitude and latitude columns
to a GeoDataFrame.
@jchandra74
jchandra74 / openssl.MD
Last active February 16, 2024 21:23
HOWTO: Create Your Own Self-Signed Certificate with Subject Alternative Names Using OpenSSL in Ubuntu Bash for Window

HOWTO: Create Your Own Self-Signed Certificate with Subject Alternative Names Using OpenSSL in Ubuntu Bash for Window

Overview

My main development workstation is a Windows 10 machine, so we'll approach this from that viewpoint.

Recently, Google Chrome started giving me a warning when I open a site that uses https and self-signed certificate on my local development machine due to some SSL certificate issues like the one below:

Self-Signed SSL Issue in Chrome

@kgjenkins
kgjenkins / README.md
Last active November 30, 2022 09:38
QGIS Python to automatically update layer from data source

The following Python code will, every 30 seconds, automatically update the data from the source for any QGIS layer with 'autoUpdate' in the layer name. Each time it updates, it will put the timestamp in the layer name, although you could leave that part out.

This is particularly useful for remote data sources like json-over-http or even local CSV files that might be changed by another program while the QGIS project is open.

Just paste the code into the QGIS Python console.

import threading
import datetime
@jmablog
jmablog / shortcodes.lua
Created January 30, 2021 17:23
A Pandoc lua filter that applies Pandoc fenced Div styling (https://pandoc.org/MANUAL.html#divs-and-spans) to Word and Latex/PDF output, as well as HTML.
function Div (elem)
if FORMAT:match 'docx' then
if elem.classes[1] == "notes" then
elem.attributes['custom-style'] = 'Notes'
return elem
else
return elem
end
elseif FORMAT:match 'latex' then
if elem.classes[1] == "notes" then
This gist I write, because I couldn't find step by step instructions
how to install and start postgresql locally and not globally in the
operating system (which would require sudo).
I hope, this will help especially people new to postgresql!
####################################
# create conda environment
####################################