Who said that the code in this repository is fast and tiny? :)
Here are two versions: tiny.py in 62 lines of code, very easy to read, but pretty slow. The other one, fast.py is a bit harder to read, but it is orders of magnitude faster.
for each pixel
compute color
for each pixel
emit a ray from the origin trough the pixel
if the ray intersects the sphere
paint sphere color
else
paint background
for each pixel
emit a ray from the origin trough the pixel
for all objects in the scene
select the frontmost intersection point
if the ray intersects the scene
paint intersection point color
else
paint background
for each pixel
emit a ray from the origin trough the pixel
for all objects in the scene
select the frontmost intersection point
if the ray intersects the scene
recursively emit a reflected ray
cumulate colors through reflexions
else
paint background