Skip to content

Instantly share code, notes, and snippets.

View ajzeigert's full-sized avatar
💀
Literally dead

Andy Zeigert ajzeigert

💀
Literally dead
View GitHub Profile
pg_dump -Fc db_name > backup_file_with_date -U username -h endpoint.host.com
createdb db_name
pg_restore -d db_name backup_file_name_with_date
@ajzeigert
ajzeigert / KMLtoSHP.py
Last active April 12, 2023 19:53
Convert KML/KMZ with table data in description field to Shapefile with data in actual fields
# Convert KML/KMZ to Shapefile
# This script converts an input KML/KMZ file to an ESRI Shapefile
# and additionally parses any HTML table found in the "description" field
# and converts the data to actual fields
# Dependencies must be installed first: gdal, fiona, lxml
# Example usage: python KMLtoSHP.py inFile.kmz outFile.shp
import os
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ajzeigert
ajzeigert / tarot.json
Last active September 7, 2024 09:49
tarot.json
{
"tarot": [
{
"name": "The Fool",
"suite": "major",
"image": "deck/RWS_Tarot_00_Fool.jpg",
"description": "With light step, as if earth and its trammels had little power to restrain him, a young man in gorgeous vestments pauses at the brink of a precipice among the great heights of the world; he surveys the blue distance before him-its expanse of sky rather than the prospect below. His act of eager walking is still indicated, though he is stationary at the given moment; his dog is still bounding. The edge which opens on the depth has no terror; it is as if angels were waiting to uphold him, if it came about that he leaped from the height. His countenance is full of intelligence and expectant dream. He has a rose in one hand and in the other a costly wand, from which depends over his right shoulder a wallet curiously embroidered. He is a prince of the other world on his travels through this one-all amidst the morning glory, in the keen air. The sun, which shines behind him, knows whence he came, whi
@ajzeigert
ajzeigert / buildings_sample.geojson
Created October 15, 2016 21:01
Test of mapbox gl js builidng extrusion with Bend lidar test data
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ajzeigert
ajzeigert / fails.geojson
Last active August 4, 2016 17:32
Basic example of using Mapbox GL JS map classes for style changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ajzeigert
ajzeigert / index.html
Last active June 21, 2016 18:18
Testing some layer stuff in mapbox gl js
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>Seismic test</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.20.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.20.0/mapbox-gl.css' rel='stylesheet' />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
@ajzeigert
ajzeigert / svg_embed.html
Created March 3, 2016 20:12
Proper way to embed an SVG with backward compatibility
<!-- Instead of this -->
<img src="path/to/image.svg"/>
<!-- Use this -->
<div style="width:100%;height:100%"> <!-- Vary this according to your needs -->
<object height="100%" width="100%" data="path/to/image.svg" type="image/svg+xml">
<!-- For IE, but will load either way -->
<img src="path/to/image.png"></img>
</object>
</div>
@ajzeigert
ajzeigert / getDirection.js
Last active March 3, 2016 17:29
Function that converts degrees to cardinal and intercardinal directions
// I used this for aspect specifically
function getDirection(d){
if (d < 22.5 ) {
return 'N';
} else if ( d < 67.5 ) {
return 'NE';
} else if ( d < 112.5 ) {
return 'E';
} else if ( d < 157.5 ) {
@ajzeigert
ajzeigert / index.html
Created January 21, 2016 21:56
Pulsing markers in Mapbox GL JS
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title></title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.12.2/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.12.2/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }