What's the most important piece of code you've written?
My answer is as follows... The most important piece of code I've written was a rudimentary 2d tile engine in QB64 for an RPG I never finished. It's memorable and important to me because of what writing it did for my confidence as a developer. At the time, writing a tile engine "from scratch", in my mind, would make me a "professional".
I had been following a Game Development YouTube series called "Adventures In Game Development". I wanted to be a game developer! It was my dream! I was a novice developer when I took on that challenge. After a few articles and discussions with some people in various IRC channels, I began.
A few hours later, I saw a map appear that I had hardcoded which contained 0's, 1's. When I saw the square patch of grass with water in the middle (my clever map design), I thought I could accomplish anything. It was one of those moments that changed my life.
I'm not kidding when I say I had wanted to write a tile engine for a year, at least, before I was actually able to do it. I was probably around 14 years old, at the time.
I hope you enjoyed reading my answer to this question and I look forward to reading yours!
EDIT
I found the link to one of the articles I read when writing the tile engine.
http://www.petesqbsite.com/sections/tutorials/tutorials/rpg_tut2.txt
EDIT 2
Another important piece of code I've written was the prototype for this game.
http://hdfgame.com/
I helped with the commercial version a bit but it was awesome to see my prototype turn into the first commercial game that I helped release. The prototype was simple but it had the basic functionality that Hexapod Defense Force has.
I wrote a lot of code for payments processing at an Indian e-commerce shop & see/make it scale from 100s of QPS to ~200k QPS. Just having the code paths exercised by so many people over a day gives me joy.
One change that I will not forget that made the highest "perceived" impact with a one line change. The payments flow was at a different domain the rest of the site. This meant the users incurred a fresh set of DNS lookup, TCP connection establishment & a SSL handshake cost. The change was to load a "pixel" image from the payments domain a page before. It dropped the first call latency from 550ms to 100ms :-)