FloatDeterministic
(self, i)
float
Get a random float (0-1) from a pre-calculated list. This is faster, and if you put the same seed in, it will always return the same number.
The downside is that it only has 8192 variations of floats, but that seem like enough for most things.
IsPowerOfTwo
(x)
bool
Return true if the number is a power of two (2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, etc)
Snippet
(source, find, padding)
string
Given a large string, find all occurrences of a substring and return them with padding.
This is useful in situations where you're searching for a word in a hug body of text, and
want to show how it's used without displaying the whole text.
TruncateFilename
(str, maxLength, appendage)
string
If the string is longer than this amount of characters then truncate it
If appendage is defined, it will be appended to the end of truncated strings (ie, "..")