I setup the wifi AP to block youtube for his computer for certain time period.
Also, I reward him with game time / RC air plane building project time with me if he did certain % of Khan Academy each weekend. He's 4th grade and finished 35% of 6th grade math himself and did some javascript program course on Khan Academy.