Skip to content

Instantly share code, notes, and snippets.

View spestana's full-sized avatar
❄️

Steven Pestana spestana

❄️
View GitHub Profile
@scottyhq
scottyhq / goes-l1b-fsspec.ipynb
Created February 14, 2023 23:30
reading goes L1B on aws with fsspec and rioxarray
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Pip is a package manager of python. You can download Python libraries from some Python repositories like PyPI. You can also download libraries from a git repository. This is gonna be the issue to be explained in this article.

I don't like to memorize things all the time. So, I guess, I couldn't be working without internet :). Whenever I need to install some python libraries from a git repositories, I see a lot of way to do it. It is really confusing. This should be the reason why I can't memorize it. I can see how a very simple requirement is handled with to many confusing way. There shouldn't be to many way. Some of them is not working neither. At last, I decided to blog it.

As you may know, you can use two protocols which are http and ssh to do something on git repositories. Using protocol ssh instead of http may provide some ease of use. Because of nature of ssh, you can do something with your primary/public keys. So, you don't have to input your credentials all the time. But I'll be

@bradyrx
bradyrx / shapefile_xarray_demo.ipynb
Last active January 29, 2024 21:24
Masking with shapefiles and xarray
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Need to sync a fork with the main repo?

Let's say you've forked a repository and cloned it to your local machine. Your Favorite Collaborator has added a pull request and had it approved by the repository maintainer; you'd now like that code in your personal fork. Here's how.

Make sure you've cded into your fork of the repository on your computer.

1. set upstream

You need to tell the fork where its original version lives. This is called "setting the upstream":

@acannistra
acannistra / save-your-work.md
Last active September 11, 2018 20:15
Saving Work from GeoHackWeek JupyterHub

Preserving Your Work on JupyterHub

This week we're using a great service called JupyterHub, which allows everyone at GeoHackWeek to learn using the same computing environment. However, though you can edit the files and experiment with the the tutorial_contents repository that your personal jupyterhub contains, you won't be able to git push immediately. This is because the default version of the repo points to the geohackweek version on GitHub, and not your personal version.

Simply put: you might want to save your work. Here's how.

1. Open A Terminal on JupyterHub.

Navigate to https://jupyterhub.geohackweek.org/. Find the New dropdown menu, and click Terminal.

@jrleeman
jrleeman / rgb_animation.py
Created September 11, 2017 17:10
GOES-16 RGB Animation
from datetime import datetime
from scipy import interpolate
from siphon.catalog import TDSCatalog
from netCDF4 import Dataset
import matplotlib.pyplot as plt
from matplotlib import patheffects
import cartopy.feature as cfeat
import cartopy.crs as ccrs
import numpy as np
from metpy.plots import add_logo
@jbwhit
jbwhit / post-save-hook.py
Last active September 21, 2023 04:50
Saves Jupyter Notebooks as .py and .html files automatically. Add to the ipython_notebook_config.py file of your associated profile.
import os
from subprocess import check_call
def post_save(model, os_path, contents_manager):
"""post-save hook for converting notebooks to .py and .html files."""
if model['type'] != 'notebook':
return # only do this for notebooks
d, fname = os.path.split(os_path)
check_call(['jupyter', 'nbconvert', '--to', 'script', fname], cwd=d)
check_call(['jupyter', 'nbconvert', '--to', 'html', fname], cwd=d)