Skip to content

Instantly share code, notes, and snippets.

@pecard
pecard / .md
Last active February 20, 2021 11:14
Wind trajectory with ECMWF ERA-5 hourly wind data

GEE Code script

/**
 * @license
 * Copyright 2020 Google LLC.
 * SPDX-License-Identifier: Apache-2.0
 * 
 * Generates wind trajectory maps and animations from ECMWF ERA-5 hourly wind
 * data. A set of random points are drawn within an area of interest; a path is
@pecard
pecard / bird_vertical_profile.R
Last active February 20, 2021 11:13
Create bird vertical profile with data from ENRAM repository.
# Packages ----
library(bioRad)
library(rhdf5)
library(tidyverse)
library(lubridate)
library(zoo)
library(RColorBrewer)
library(patchwork)
@jherax
jherax / arrayFilterFactory.1.ts
Last active January 23, 2026 08:02
Filters an array of objects with multiple match-criteria.
type FilterOperator = 'AND' | 'OR';
type FiltersBy<T> = {
[K in keyof T]?: (value: T[K]) => boolean;
};
/**
* Factory function that creates a specialized function to filter
* arrays, by validating all filters (AND operator),
* or validating just one of the filters (OR operator).
* @param operator Method to validate all filters: AND, OR