Skip to content

Instantly share code, notes, and snippets.

View alpha-beta-soup's full-sized avatar
🌏

Richard Law alpha-beta-soup

🌏
View GitHub Profile
@ChocopieKewpie
ChocopieKewpie / mapextend_test.py
Last active July 9, 2024 08:29
map_extend geopandas
import numpy as np
from shapely.ops import unary_union, voronoi_diagram
from shapely.geometry import Polygon, MultiPolygon
import geopandas as gpd
import pandas as pd
def read_data(file_path):
return gpd.read_file(file_path)
def create_outline(df):
@toraritte
toraritte / github_issues_to_docx.md
Last active September 12, 2024 22:12
A long and stupid way to save GitHub issues in Word DOCX format

The long and stupid way is listed below, but hoping that someone has a way quicker and nicer solution. (Didn't have time to come up with a proper Node or Deno solution, so I spent better part of the day on this abomination.[quote][1])

  1. "Install" [GitHub CLI][gh] and [Pandoc]

    nix-shell -p gh pandoc
    
  2. Export GitHub issues in JSON

@johnniehard
johnniehard / MBTiles: Pipe GeoJSON from PostGIS to Tippecanoe.md
Last active April 11, 2020 20:49
MBTiles: Pipe GeoJSON from PostGIS to Tippecanoe

I had a large dataset in postgis and wanted to avoid the hassle of first exporting it to a several GB geojson file before tiling it with Tippecanoe.

ogr2ogr -f GeoJSON /dev/stdout \                                                                            
PG:"host=localhost dbname=postgres user=postgres password=thepassword" \
-sql "select * from a, roi where a.geom && roi.geom" \
| docker run -i -v ${PWD}:/data tippecanoe:latest tippecanoe \
--output=/data/yourtiles.mbtiles
@timgentry
timgentry / powerbi_json_to_csv.rb
Created October 18, 2018 12:41
Converts PowerBI JSON payload to CSV
require 'json'
require 'csv'
hash = JSON.parse(File.read('querydata.json'))
CSV.open('data.csv', 'w') do |csv|
hash['results'].each do |result|
data = result['result']['data']
descriptor = data['descriptor']
dsr = data['dsr']
@perrygeo
perrygeo / Dockerfile
Last active June 27, 2024 13:18
Minimal debian image with Python 3.6 and geo python tools
FROM python:3.6-slim-stretch
ADD requirements.txt /tmp/requirements.txt
RUN apt-get update && \
apt-get install -y \
build-essential \
make \
gcc \
locales \
@tkh44
tkh44 / index.js
Created August 25, 2017 19:25
Getting react-leaflet working with SSR (next.js)
import React from 'react'
export default class extends React.Component {
constructor () {
super()
this.state = { components: undefined }
this.markers = new WeakMap()
}
componentDidMount () {
@bubbobne
bubbobne / geometry_geojson.yaml
Last active November 2, 2023 19:08
A #swagger #geojson geometry description
#MIT License
#
#Copyright (c) 2017 Daniele Andreis
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
#copies of the Software, and to permit persons to whom the Software is
#furnished to do so, subject to the following conditions:
#
@dweinstein
dweinstein / Dockerfile
Created March 14, 2014 15:37
testProject
FROM ubuntu
MAINTAINER David Weinstein <[email protected]>
# install our dependencies and nodejs
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update
RUN apt-get -y install python-software-properties git build-essential
RUN add-apt-repository -y ppa:chris-lea/node.js
RUN apt-get update
RUN apt-get -y install nodejs
@parnelandr
parnelandr / Food.csv
Last active December 30, 2015 21:29
Reusable Bar Chart
Food by Deliciousness
Source: Andrew Parnell
Metadata Notes: Things I think are yummy
Food Rating
Bananas 5
Green Beans 4
Egg Salad Sandwich 7
Ice Cream 10
Vegemite 3.5