A small #ThingUmbrella code snippet for a current shop admin task, to help me with preparing different print size options in both inches and centimete
Altro...
A small #ThingUmbrella code snippet for a current shop admin task, to help me with preparing different print size options in both inches and centimete
Altro...A small #ThingUmbrella code snippet for a current shop admin task, to help me with preparing different print size options in both inches and centimeters, grouped by landscape, portrait or square format.
The script illustrates how to functionally iterate over all possible sizes in a min/max range, converting & formatting units and grouping sizes based on their aspect ratio. All mostly relies on https://thi.ng/transducers and https://thi.ng/units for different transformation/conversion steps.
I'm posting this since in a recent poll people had indicated that they'd like to see more code snippets for using my libraries — maybe someone finds it as an useful reference...
Full source code:
https://gist.github.com/postspectacular/a122ab9c1cd52934b8093461231c6044
#TypeScript #JavaScript #FunctionalProgramming #Transducers #UnitConversion #Photography