This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /// script | |
# requires-python = ">=3.13" | |
# dependencies = [ | |
# "ngff-zarr", | |
# "numpy", | |
# "rich", | |
# ] | |
# | |
# [tool.uv] | |
# exclude-newer = "2025-03-18T14:10:36.371318-04:00" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as assert from "jsr:@std/[email protected]"; | |
import * as fflate from "npm:[email protected]"; | |
import * as pako from "npm:[email protected]"; | |
const base = new URL( | |
"https://raw.githubusercontent.com/zarr-developers/zarr_implementations/5dc998ac72/examples/zarr.zr/gzip/.zarray", | |
); | |
const BYTES = await fetch(new URL("0.0.0", base)) | |
.then((r) => r.arrayBuffer()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) 2024 Trevor Manz - MIT License | |
/** | |
* Type-safe error handling utilities inspired by Python's try/except. | |
* | |
* @module | |
*/ | |
// deno-lint-ignore no-explicit-any | |
type InstanceType<T> = T extends new (...args: any[]) => infer R ? R : never; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* MIT License | |
* | |
* Copyright (c) 2024 Trevor Manz | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /// script | |
# requires-python = ">=3.11" | |
# dependencies = [ | |
# "requests<3", | |
# "rich", | |
# ] | |
# /// | |
import requests | |
from rich.pretty import pprint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function sayHello() { | |
console.log("hello from github gist") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { assert } from "jsr:@std/[email protected]"; | |
import * as fflate from "npm:[email protected]"; | |
import * as pako from "npm:[email protected]"; | |
async function decode_stream(stream: ReadableStream) { | |
const reader = stream | |
.pipeThrough(new DecompressionStream("gzip")) | |
.getReader(); | |
let bytes: Uint8Array; | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
import dataclasses | |
import httpx | |
import zarr | |
import zarr.storage | |
import zarr.util | |
def get_tile_size(info: dict) -> int: |
We can't make this file beautiful and searchable because it's too large.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
country,year,population,gdp_per_capita,life_expectancy,continent | |
Afghanistan,1800,3280000,683,28.21,Asia | |
Afghanistan,1801,3280000,683,28.2,Asia | |
Afghanistan,1802,3280000,683,28.19,Asia | |
Afghanistan,1803,3280000,683,28.18,Asia | |
Afghanistan,1804,3280000,683,28.17,Asia | |
Afghanistan,1805,3280000,683,28.16,Asia | |
Afghanistan,1806,3280000,683,28.15,Asia | |
Afghanistan,1807,3280000,683,28.14,Asia | |
Afghanistan,1808,3280000,683,28.13,Asia |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder