Skip to content

Instantly share code, notes, and snippets.

View e5k's full-sized avatar

Sébastien Biass e5k

View GitHub Profile
@jdbcode
jdbcode / ee_landtrendr_fitted_rgb_thumbnails.py
Last active February 24, 2023 13:52
Earth Engine LandTrendr fitted RGB thumbnail time series
"""
Copyright 2020 Justin Braaten
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@robbibt
robbibt / geometry_mask_example.py
Last active July 22, 2022 12:39
Rasterio geometry mask example for Stack Exchange
import xarray as xr
import geopandas as gpd
import rasterio
# Open your shapefile and xarray object
ds = raster_mask
gdf = vector_mask
# Select shapefile feature you want to analyse
# and reproject to same CRS as xarray
@Raudcu
Raudcu / subtitles_in_legend.py
Last active January 9, 2023 19:25
Custom legend handler to add subtitles within a matplotlib legend
# Adapted to python3 from the accepted answer on https://stackoverflow.com/questions/38463369/subtitles-within-matplotlib-legend
# Legend guide: https://matplotlib.org/3.1.0/tutorials/intermediate/legend_guide.html
import matplotlib.text as mtext
class LegendTitle(object):
def __init__(self, text_props=None):
self.text_props = text_props or {}
super(LegendTitle, self).__init__()
@dkapitan
dkapitan / seabornfig2grid.py
Created July 26, 2018 09:50
Multiple Seaborn plots in a grid
# https://stackoverflow.com/questions/35042255/how-to-plot-multiple-seaborn-jointplot-in-subplot
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import seaborn as sns
import numpy as np
class SeabornFig2Grid():
@redlotus
redlotus / docstrings.py
Created October 2, 2017 04:34
Google Style Python Docstrings
# -*- coding: utf-8 -*-
"""Example Google style docstrings.
This module demonstrates documentation as specified by the `Google Python
Style Guide`_. Docstrings may extend over multiple lines. Sections are created
with a section header and a colon followed by a block of indented text.
Example:
Examples can be given using either the ``Example`` or ``Examples``
sections. Sections support any reStructuredText formatting, including
#!/bin/bash
iatest=$(expr index "$-" i)
#######################################################
# SOURCED ALIAS'S AND SCRIPTS BY zachbrowne.me
#######################################################
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
@natelandau
natelandau / .bash_profile
Last active July 27, 2024 05:39
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management