Skip to content

Instantly share code, notes, and snippets.

Replace verbose license headers with SPDX identifiers

Proposal for uber/h3.

Problem

Every H3 C source file includes a 15-line Apache 2.0 license header with copyright years:

/*
#include <stdio.h>
#include <stdlib.h>
#include "h3Index.h"
#include "iterators.h"
#include "polyfill.h"
#include "polygon.h"
#include "test.h"
#include "utility.h"
@ajfriend
ajfriend / cache_work.c
Created November 28, 2025 04:19
Failed attempt to speed up the LatLng loop area calculation
typedef struct {
double s;
double c;
double lng;
} LatLngPre;
static inline LatLngPre precompute_latlng(LatLng x) {
double lat = x.lat / 2.0 + M_PI / 4.0;
LatLngPre llp = {.s = sin(lat), .c = cos(lat), .lng = x.lng};
# Justfile for https://github.com/uber/h3/pull/1042
_default:
@just --list
purge:
rm -rf build
build:
-mkdir build
import h3
import geopandas
import pandas as pd
import matplotlib.pyplot as plt
import contextily as cx
h = '8c196938064c5ff'
# convert to h3.LatLngPoly, which is compatible with

How to get bat to highlight your justfiles.

From https://hynek.me/til/bat-justfile/

In the form of a justfile rule:

mkdir -p "$(bat --config-dir)/syntaxes"
cd "$(bat --config-dir)/syntaxes"
git clone https://github.com/nk9/just_sublime.git
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.
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.