Cut off the remaining wires of the ceiling lamp to about 3 inches in length. Remove 1/2 inch of insulation from the ends of both wires.
Cut off the receptacle end of an extension cord to the length you wish for the lamp's cord. Remove 1/2 inch of insulation from the ends of each of the wires.
Pair up the bare wires on the extension cord with the bare wire ends of the lamp -- one wire from the extension cord to one wire of the lamp. Slide a wire nut over each of the wire pairs and twist it until the wires are connected firmly. Place a piece of electrical tape onto the base of each wire nut for extra security.