This is just a real project I made for myself. A little bit overmade led lamp fed by a 9V cell with light control which consists in a 20k trimmer I had, but in reality 10k was enough, so I added a 22k resistor in parallel to reduce the resistance of the trimmer. The 47k and 2.2k resistors are there to support the control of the amount of current flowing to the base of the transistor. This kind of lamps have a very low current consumption.
In my real lamp, the leds are white, not yellow.