Flash Joule heating for nanomaterials synthesis, waste upcycling, and hydrogen production