This is my notepad where i collect the useful snippets of OpenSCAD code that i use over and over. Some better curated than others, some formatted for clarity some for efficiency.
for (i = [0: 100]) echo(i, ":", next_pow2(i)); function next_pow2(x) = pow(2, ceil(log(x)/log(2)));