My Shitty Code

Embracing the Messiness in Search of Epic Solutions

Home

Welcome to my encyclopedia of shitty code!

  • Managing the Order of AJAX Calls on Input Field’s Keyup Event

    SCENARIO Consider the following code:- When user types an employee’s name, “Mike”, in the search field, a web service call is fired per character typed. In this example, the following web service calls are made:- Let’s assume this web service searches the input string against databases (or flat files, Facebook API, etc) and returns a […] Read More…

  • Pretty Print JSON in JavaScript

    PROBLEM You want to display a JSON object in JavaScript. TAKE 1 While this works, I find this approach inconvenient when viewing the output in Firebug because I have to click on each generated link to view the details. TAKE 2 … will generate this:- This approach will display the entire JSON object as one […] Read More…

  • Reading Directory/File’s ACL Directly from Java

    Prior to Java 7, there’s no way to read a directory/file’s ACL directly from Java. With Java 7, you can write something like this:- When you execute the code above, you will get something like this:- Read More…

  • Managing Log4j Configuration for Both Development and Production Environments

    PROBLEM Most of the time, we set the Log4j’s log levels to something lower (debug or info) during our local development. Once it is ready for production, we normally set the Log4j’s log levels to something higher (warn or even error) to prevent meaningless information from flooding the server log. One way to do this […] Read More…

  • Configuring Cobertura Exclusion to Work with Maven Site

    PROBLEM The Cobertura Maven Plugin doesn’t respect the exclusion configuration. For example, if you have the following pom.xml, the exclusion configuration does absolutely nothing when you execute mvn site. SOLUTION To fix this, you will need to define the Cobertura Maven Plugin under both <build> and <reporting>. Read More…

  • Hello World!

    … and I’ll begin to write shitty code from this day forward… Read More…

About Author

This author has 20+ years of experience in software engineering and cloud engineering. In an industry where knowledge becomes obsolete in the next three months, he learns anything that crosses his path with no mercy. He codes Java while drinking Espresso and writes Spock specifications while listening to Groovy beats. He masters Google Cloud Platform just like he masters the art of predicting the movement of dark clouds over his backyard, where 60% of the time, he is right every time.

This author suffers from the Dunning-Kruger effect, where he overestimates his competence and underestimates his ignorance. Technology buzzwords never scare him, for he does not know what to be afraid of in the first place. GCP, GCS, GCR, GKE, GWT, JWT… they all sound the same to him. This author is a jack of all trades but a master of none. He writes like he knows all the answers, yet he googles for better solutions from elsewhere. He fakes it until he makes it, and if he doesn’t, that’s okay because he has the attention span of a squirrel.

By now, you should know this author is full of shit, and he apologizes in advance if you are trying to solve your company’s real problems with his shitty solutions.