10.4.3 Can you answer these questions?

10.4.3.1 Lualatex Precompile Preamble Stops Randomly
10.4.3.2 Inserting code environment in an endnote
10.4.3.3 \includegraphics that works differently within and outside of figure environment
10.4.3.1 Lualatex Precompile Preamble Stops Randomly

https://tex.stackexchange.com/landing/r/digest?cta=question&id=706466

to speed up the compilation of my tex-file I came across the idea of precompiling the preamble following this explaination:https://web.archive.org/web/20160912114941/http://www.howtotex.com:80/tips-... 
[luatex] [preamble]
 
asked by simonroof https://tex.stackexchange.com/landing/r/digest?cta=user&id=309263 Score of 1
10.4.3.2 Inserting code environment in an endnote

https://tex.stackexchange.com/landing/r/digest?cta=question&id=706442

I am currently writing a report in which I have to include many bits of code in endnotes on a different page. Doing every reference manually seems unnecessarily tedious. I found a way to insert python ... 
[code] [endnotes]
 
asked by Galou https://tex.stackexchange.com/landing/r/digest?cta=user&id=311960 Score of 1
10.4.3.3 \includegraphics that works differently within and outside of figure environment

https://tex.stackexchange.com/landing/r/digest?cta=question&id=706597

I want to redefine \includegraphics so that while it works as usual within a figure environment, it is centered automatically outside of figure environments. 
This is my try: 
\documentclass{article} 
\... 
[beamer] [macros]
 
asked by user182849 https://tex.stackexchange.com/landing/r/digest?cta=user&id=182849 Score of 1