You can showcase your expertise on coding through HackerRank, or with sample projects in little details. This helps to me.
Assuming I do get a good job now, I would be writing code for them, which most likely would be closed source. If I ever want to switch companies after a few years, should I start writing such code samples again?
The thing which irks me most is when companies do not even bother to look at my profile without open-source contributions.
Something simple that’s useful to you. Then stick it up on Github.
(Or maybe even better yet, find a project already doing something you want and help.)