Skip to content

Instantly share code, notes, and snippets.

@hfs
hfs / bbox2tiles.py
Created March 15, 2023 06:30
Convert a bounding box given as two longitude/latitude pairs into a list of map tile coordinates
#!/usr/bin/env python3
import argparse
import math
import re
import sys
def deg2num(lng_deg, lat_deg, zoom):
lat_rad = math.radians(lat_deg)
n = 2.0 ** zoom
@ryu1kn
ryu1kn / README.md
Last active March 7, 2025 07:31
Getting GCP access token from a service account key JSON file

Getting GCP access token from a service account key

Use your service account's key JSON file to get an access token to call Google APIs.

Good for seeing how things work, including the creation of JWT token.

To create a JWT token, you can replace create-jwt-token.sh script with tools like step.

If you just want to get an access token for a service account,

@TrinityCoder
TrinityCoder / Cargo.toml
Last active July 20, 2022 17:40
Rust: Converting Vec<String> into a C-style 'char**' array to be used in libc library calls, such as in libc::execvp()
# Build by running `cargo make`
# or `cargo build`.
#
# Run by `cargo run`.
[package]
name = "experiment"
version = "0.1.0"
edition = "2018"