Skip to content

Instantly share code, notes, and snippets.

View martin-rdz's full-sized avatar

martin_rdz martin-rdz

  • Leipzig
View GitHub Profile
@martin-rdz
martin-rdz / blue_planet.ipynb
Created February 7, 2021 09:22
Jupyter notebook to calcute the fraction of water, that coveres the Earth.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@martin-rdz
martin-rdz / bash_helpers.md
Last active September 1, 2022 07:38
Collection of terminal one-liners

bash helpers

Loop over numbers

for i in $(seq -f "%02g" 1 11); do wget ftp://arlftp.arlhq.noaa.gov/archives/gfs0p25.v1/201903${i}_gfs0p25; done

for i in $(seq -f "%02g" 1 31); do python run_conversion_batch.py --date 201903${i}; done

Loop over dates

@martin-rdz
martin-rdz / python_data_structures.md
Last active September 14, 2019 08:20
Short overview on python built-in data structures and numpy arrays

Python data structures in the context of scientific programming

Built-in

Several data structures are available in python natively, such as tuples, lists and dictionaries. All of them can hold any python object, for example floats and strings, but other tupels, lists, dictonaries as well.

atuple = (11, 21)
alist = [1, 3, 4, 7, 12, 16, 19, 27]
@martin-rdz
martin-rdz / watchdog.ps1
Created December 7, 2018 18:37
a small watchdog for PowerShell
# Before first PowerShell usage you might have to adapt the policies
# Get-ExecutionPolicy -List
# Set-ExecutionPolicy Unrestricted -Scope CurrentUser
# --------------------------------------------------------------------------------
# This setup is only necessary once
# Insert the password into the empty string below and run script
# powershell creates a text file with the (encrypted credentials, Windows Data Protection API)
# then the watchdog acesses it...
#$secureStringPwd = "test" | ConvertTo-SecureString -AsPlainText -Force
@martin-rdz
martin-rdz / timestamps_to_grid.ipynb
Created February 17, 2018 11:09
retrieve the index boundaries for a time grid based on a timestamps array
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.