Showing posts with label React. Show all posts
Showing posts with label React. Show all posts

To Do List

I'm interviewing for a "real" job.  My position with the Office of Conflicts Counsel is, of course, a real job, but it's part time and isn't really a coding job except to the extent I'm making it one, so I'm looking for something else.  It's popular these days for interviewers early in the hiring process to assign "code screenings" or "coding assessments" or whatever you'd like to call them to make sure the person they're interviewing knows what they're doing.  I like to think my work speaks for itself, but obviously that's wishful thinking so I have to do these too.

The problem is that I've probably forgotten more about coding than a lot of people have ever learned and there's no real way to predict what will be on these assessments ahead of time.  This is all a roundabout way of saying that I had one of these assigned recently that was assessing my knowledge of Python and React.  I spent entirely too much time on one of the Python problems and ran out of time to solve the final React problem.  The purpose was to build a basic "To Do List".  It didn't (and wasn't meant to) interface with a backend so it wasn't persistent beyond reloading the page, had no login mechanism so even if it did persist the ToDos would be shared with everyone on the internet, but I still managed to shit the bed.

In my defense, the React website I have up was entirely static content before I did this assessment, I was out of practice building anything more complicated, and they had pre-defined a somewhat awkward structure for the components that I wasted more time than I should have trying to squeeze my solution into rather than just rewriting it in a way that worked.

Rather than take my failure lying down, I built the thing on my own to include on my website.  It's still shit (ahem...is of limited practical use), has none of the styling that had been included with the assessment, and was no help whatsoever in mitigating my poor performance on the assessment (they've moved on to other candidates).  It did, however, give me enough of a kick in the ass to make sure I actually start writing more proper React code so I remember how to do it next time.  I also did every single React exercise on HackerRank and got the relevant certifications.

Might have been a better idea to do all that BEFORE failing the assessment, but win some / lose some.

Legislator Lookup

I've rebuilt this little widget several times by now.  Enough times from long enough ago that I don't even remember now where I initially reverse engineered the services that enable it to function.  Probably the Delaware legislature's website since they also have a "find my legislator" widget on there.

The concept is simple enough.  Put in your address (in Delaware) and it spits out your legislators.  Under the hood it starts by geo-locating your address into a lat/lon which then gets fed into a separate service that looks up the districts you're a part of using different URL parameters on a single delaware.gov endpoint for your Election District, Representative District, Senate District, and County [Council] District.

I take it a step further and follow the URL provided for the state legislators to their legislative profiles and scrape the email address and photo to include in the output.

It's not overly complicated, but in the course of writing code for local political parties it's something that has often been useful or at least cool looking.  I've done it so many times that this particular rewrite, with the benefit of VS Code's LLM-driven auto completion, was done in a couple of hours and uses Next.js, Tailwind, and all the other newfangled fanciness.