Skip to content

Instantly share code, notes, and snippets.

View dafvid's full-sized avatar
🍍

David Stenwall dafvid

🍍
View GitHub Profile
@nwesterhausen
nwesterhausen / mca.py
Last active August 25, 2024 00:39
Python class to read minecraft region files.
"""Code to read .mca region files
I modified the javascript library mca-js to create this file.
mca-js: https://github.com/thejonwithnoh/mca-js
This is largely just a python interpretation of that script.
-----------
MIT License
Copyright (c) 2019 Nicholas Westerhausen
@wido
wido / dnskey_to_dsrecord.py
Created July 18, 2016 11:58
Calculate DS record from DNSKEY with Python 3
"""
Generate a DNSSEC DS record based on the incoming DNSKEY record
The DNSKEY can be found using for example 'dig':
$ dig DNSKEY secure.widodh.nl
The output can then be parsed with the following code to generate a DS record
for in the parent DNS zone
@jczaplew
jczaplew / postgis2geojson.py
Last active March 23, 2023 19:08
A tool for extracting data from PostGIS into GeoJSON and TopoJSON. UPDATE: Added a dedicated repo for contributions - https://github.com/jczaplew/postgis2geojson
'''
A simple tool for exporting from a PostGIS table to GeoJSON and TopoJSON. Assumes Python 2.7+,
psycopg2, and TopoJSON are already installed and in your PATH.
Adapted from Bryan McBride's PHP implementation
(https://gist.github.com/bmcbride/1913855/)
by John Czaplewski | jczaplew@gmail.com | @JJCzaplewski
TODO:
- Add argument for SRS