Skip to content

Instantly share code, notes, and snippets.

def get_sf_from_gotm(ds):
"""create shape functions following sane et al. ds is a netcdf dataset output from GOTM"""
n_layers = 16
batch = 100
t_initial = 50
t_max = t_initial + batch
# choose a time segment to look at
nuh = ds['nuh'][t_initial:t_max, :, 0, 0]
mld_surf = ds['mld_surf'][t_initial:t_max, 0, 0]
// what is AVM?
const sleep = (n) => new Promise((resolve) => setTimeout(resolve, n));
async function getAboveTheFold(propertyId) {
const r = await fetch(`https://www.redfin.com/stingray/api/home/details/aboveTheFold?propertyId=${propertyId}&accessLevel=1`);
const t = await r.text();
const data = JSON.parse(t.replace('{}&&', ''));
const payload = data.payload;
const addressSectionInfo = payload.addressSectionInfo;
async function screenCap(duration) {
function _startScreenCapture() {
if (navigator.getDisplayMedia) {
return navigator.getDisplayMedia({video: true});
} else {
return navigator.mediaDevices.getUserMedia({video: {mediaSource: 'screen'}});
}
}
const stream = await _startScreenCapture();