Skip to content

Instantly share code, notes, and snippets.

@Majramos
Majramos / simple_idw.ipynb
Last active December 14, 2023 17:47
Simple inverse distance weighted (IDW) interpolation with python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pmacMaps
pmacMaps / clip_layers_by_other_layers.py
Created June 24, 2020 15:26
Function and demo to Use ArcPy Search Cursors to loop through a layer and clip other layers by each feature in that layer
# Note: this script is designed to run with Python 3 and ArcGIS Pro ArcPy
# import modules
# arcpy => provides access to Esri ArcGIS Pro
# os => provides convient way to construct file paths
# sys => provides way to capture errors
# re => used for snake case helper function (taken from https://www.30secondsofcode.org/python/s/snake)
import arcpy, os, sys
from re import sub
@ThomasG77
ThomasG77 / README.md
Last active April 8, 2024 20:17
Run PyQGIS in Jupyter Notebook
@AtulKsol
AtulKsol / psql-error-fix.md
Last active April 10, 2024 07:41
Solution of psql: FATAL: Peer authentication failed for user “postgres” (or any user)

psql: FATAL: Peer authentication failed for user “postgres” (or any user)

The connection failed because by default psql connects over UNIX sockets using peer authentication, that requires the current UNIX user to have the same user name as psql. So you will have to create the UNIX user postgres and then login as postgres or use sudo -u postgres psql database-name for accessing the database (and psql should not ask for a password).

If you cannot or do not want to create the UNIX user, like if you just want to connect to your database for ad hoc queries, forcing a socket connection using psql --host=localhost --dbname=database-name --username=postgres (as pointed out by @meyerson answer) will solve your immediate problem.

But if you intend to force password authentication over Unix sockets instead of the peer method, try changing the following pg_hba.conf* line:

from

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fitnr
fitnr / county-epsg.csv
Last active April 10, 2024 21:33
List of State Plane coordinate systems and their various ID codes.
COUNTYFIPS NAME STATEPLANEFIPS EPSG
16079 Shoshone County 1103 26970
16073 Owyhee County 1103 26970
16071 Oneida County 1101 26968
16077 Power County 1101 26968
16075 Payette County 1103 26970
06115 Yuba County 0402 26942
06111 Ventura County 0405 26945
06113 Yolo County 0402 26942
31177 Washington County 2600 32104
@mbostock
mbostock / .block
Last active March 27, 2024 22:16
Vector Tiles
license: gpl-3.0
redirect: https://observablehq.com/@d3/vector-tiles