Skip to content

Instantly share code, notes, and snippets.

View andy-esch's full-sized avatar
🌳

Andy Eschbacher andy-esch

🌳
View GitHub Profile
@ohaval
ohaval / multi_file_commit.py
Created December 12, 2022 06:30
An example shows how to push a single commit with multiple files to an existing branch using PyGithub
"""
Main Steps:
1. Create blob for each file
2. Create tree with the blobs on top of the specific branch
3. Commit the tree
4. Update the branch to point to the new commit
"""
import os
@rmania
rmania / geopandas_convert_geometry_3D_2D.py
Created March 13, 2017 21:06
flatten geometry series (3D to 2D) in geopandas dataframe
# Often when reading in a ShapeFile from Basemap, you'll get: "ValueError: readshapefile can only handle 2D shape types"
# A trick can be to convert your geometry in your GeoPandas Dataframe and restoring the new flattened 2D geometry
# series back into a shapefile and try again.
# edit from http://stackoverflow.com/questions/33417764/basemap-readshapefile-valueerror
from shapely.geometry import Polygon, MultiPolygon, shape, Point
import geopandas as gp
def convert_3D_2D(geometry):
'''
@kgjenkins
kgjenkins / carson-projection.png
Last active July 18, 2016 21:48
Carson projection in CartoDB PostGIS
carson-projection.png
@kgjenkins
kgjenkins / US48_inset_AK_HI.md
Last active November 26, 2015 14:31
Create CartoDB dataset of US states with inset Alaska and Hawaii (epsg:4326)
SELECT
cartodb_id,
the_geom,
abbrev, name, postal
FROM ne_50m_admin_1_states
WHERE postal NOT IN ('AK', 'HI')

UNION
@iriberri
iriberri / config.json
Created May 18, 2015 13:01
Torque named map
{
"version": "0.0.1",
"name": "namedmap_tutorial_14",
"auth": {
"method": "open"
},
"layergroup": {
"layers": [{
"type": "torque",
"options": {
@TDahlberg
TDahlberg / postgis_workshop_cartodb.md
Last active August 29, 2015 14:13
Boundless Geo PostGIS workshop translated to CartoDB

#Boundless Geo Exercise 11 ##What neighborhood and borough is Atlantic Commons in? Solution:

SELECT name, boroname
FROM nyc_neighborhoods
WHERE ST_Intersects(
  the_geom,(SELECT the_geom FROM nyc_streets WHERE name = 'Atlantic Commons'))
@HeikkiVesanto
HeikkiVesanto / TransSiberianSimplified.geojson
Last active October 18, 2016 17:46
Trans Siberian Route
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a