This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A short gist derrived from dlsw on how to test if a DLL is on your PATH. (Best with try/except blocks) | |
import os | |
from ctypes import WinDLL | |
from _ctypes import FreeLibrary # DON'T FORGET THE '_' | |
dll = "mod_spatialite.dll" # or whatever DLL your heart desires | |
assert not dll in os.listdir(os.getcwd()) # Ensures that the DLL will not false-positive load because it's in the current working dir | |
loaded_dll = WinDLL(dll) # Attempt to load DLL. If the DLL is not on PATH or in os.getcwd() it will raise a WindowsError | |
FreeLibrary(loaded_dll._handle) # if successful, we should be good neigbors and unload it | |
del loaded_dll # completely rid of the memory instance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Addition to geopandas.io.sql.py | |
by Garin Wally / Windfall Spatial, Nov 10, 2015 | |
""" | |
# Place with the other imports | |
import shapely.wkt | |
def read_spatialite(sql, con, geom_col, crs=None, index_col=None, | |
coerce_float=True, params=None): | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
hellfire.py | |
This script serves as a double-click DLL dependency-diagnostics utility. | |
Usage: | |
1. Place this script in a folder containing one or many DLL(s) to test | |
2. Double-click this script | |
3. Read the Windows error-popup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
"""distribution_yaml.py: Converts Paths and GBDs to dicts, then to a yaml file. | |
This script 'walks' through a folder structure (including ESRI Geodatabases) | |
and outputs a .yaml pseudo-schema of the directory-tree and geodatabase(s). | |
MIT License (MIT) | |
Copyright (C) 2015 Garin Wally / Windfall Spatial | |
This code was modified from code by Blake Miller, found here: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import os | |
import codecs | |
from subprocess import Popen, PIPE | |
import apsw | |
db = "test.sqlite" | |
sqlite = "sqlite3_test.sql" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import locale | |
n = unicode(raw_input().decode(locale.getpreferredencoding())) | |
# Where the input is `José` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
get_users.py -- Searches Window's /Users/ file for write-accessable user folders | |
and returns a list of write-accessible folder names (i.e. likely user name). | |
""" | |
import os | |
def get_users(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
swtich.py -- JS switches in Python (proof of concept) | |
Author: Garin Wally; Nov 2016 | |
Just took the JavaScript tutorial at codecademy and thought switches were | |
pretty cool, so I coded one up in Python. | |
I have to admit, this implementation is not great, not pretty, and likely | |
not shorter than a standard if/elif/else block. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Makes a geojson-dashboard config.json file from an input geojson file. | |
Author: Garin Wally; Aug 2017 | |
Use: | |
> python make_config.py us_bounds.json | |
""" | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///// Variables | |
///// Removals | |
///// Replacements/Alterations | |
import minetweaker.item.IIngredient; | |
/////////////////////////////////////////////////////////////////////////////// | |
// Variables | |
/////////////////////////////////////////////////////////////////////////////// |
OlderNewer