All code explained below is available on my GitHub here
In this scenario your client wants some JSON representation modified from some integer to a string. A common example might be the sample response below:
In the above example,
gendercan either be a
1for male and
2for non-binary. This data would’ve been fetched from some backend DB as a record where
genderis configured to be an integer value.
The client would also like to reformat the value of
occupationto be slugged and lowercased. e.g. “Frontend Developer” → “frontend-developer”
Unfortunately, the clients DB is already populated with hundreds…
To be honest, this will not be impressive to a lot of developers out there. But for me it was an acomplishment and a moment of learning as a developer that consistently feels slow to catch up, not to mention often intimidated & needed a way to ease his own imposter syndrome. For now anyway.
Before I explain, let me show you my old work flow
Did you know that if you create a Github repository with your username you can unlock a secret? Go on, give it a try! You’ll be pleasently surprised with this alert
At the time of this writing, it has been 7 months since the COVID19 pandemic had taken over the world. Making it harder for me & my group of friends to meet with each other. And then one day, one of us decided to put us all together in a Discord channel so we can still hang out virtually.
Discord lets you install bots like Pancake to do other stuff like loading songs from YouTube & playing it on voice channel everyone listening.
And then one day I thought “why waste such an opportunity?” I immediately got to work. At…
(Disclaimer: Since I use Python 3 & Django on a daily basis i’ll be using snippets from them as examples.)
Since last year up until now i’ve been struggling with a concept of DRY coding. In a nutshell, “Do not repeat yourself”. So if you can find stuff that’s pretty repetitive, then chances are you ought to automate this to a single source. This way when specification changes you can reduce having to do multiple changes.
And this is great for production code. And probably okay for test code right?
Well, theoretically (i thought) yes. We just don’t want to…