Welcome to my encyclopedia of shitty code!
-
Feign + Eureka: UnknownHostException when Attempting to Invoke a Service
PROBLEM When attempting use Feign to invoke a service through Eureka, the following exception occurs:- SOLUTION Go to the donkey-kong-service app and add the following line to the application.properties:- Now, when Feign tries to invoke the service, the IP address will be used instead of the OS’ reported hostname. Read More…
-
Spring Boot: Restarting App using Dev Tools with IntelliJ IDEA
Spring Boot provides spring-boot-devtools module that allows the app to “smartly” restart whenever the files on the classpath have changed. Because the rarely changed classes (ex: 3rd party JARs) are separated out into a different classloader from the app’s actively developed classes’ classloader, it allows Spring Boot to quickly restart the app compared to “cold… Read More…
-
Spring Boot: Connecting to IBM MQ over JMS using non-IBM JRE
There are several ways to connect to IBM MQ:- This article shows you how to connect with Spring’s JmsTemplate. CONNECTIVITY INFO Typically, the MQ admin will provide the following connectivity info that allows you to connect to MQ:- DEPENDENCY Add the following dependency:- SPRING CONFIGURATION While the connectivity info can be hardcoded in Spring Boot’s… Read More…
-
React: Debugging Layout Thrashing
PROBLEM When the React app grows larger over time, it is highly likely to run into situations where the component keeps re-rendering for no apparent reason. There are many reasons why this is happening… to name a few…. parent component re-renders, this.props or this.state has changed, etc. The key is to quickly find out what… Read More…
-
Groovy: Handling Byte Order Marks When Reading a File
PROBLEM Given a file with the following content:- When reading the file:- … the following values are printed:- Even though the value is trimmed, there is still a leading space in front of text. A further inspection reveals the leading space is not a regular space:- SOLUTION Some editors prepend a special Unicode character called… Read More…
-
Spring Web: Encode ‘+’ Value Using UriComponentsBuilder
PROBLEM Given the following code… When using Spring Web 4.3.18.RELEASE, the URL is properly encoded:- However, when using version between 5.0.0.RELEASE and 5.0.7.RELEASE, the URL containing “+” value does not get encoded:- SOLUTION There is a ticket opened regarding this breaking change. To properly encode “+” value, use 5.0.8.RELEASE or later. Then, ensure encode() is… Read More…
-
React + Recompose: Calling Multiple HOC Wrappers
PROBLEM Sometimes, wrapping a React component with multiple High Order Components (HOC) can get rather unwieldy and unreadable. For example:- SOLUTION To fix this, we can leverage recompose library. Now, we can rewrite the above example like this:- Keep in mind, the HOC order defined in compose(..) is important. Read More…
-
Webpack + ESLint: Automatically Fix ESLint Errors
PROBLEM Given the following webpack.config.js… When running any Webpack command, ESLint may find violations and halt the entire process with the following error message:- SOLUTION Certain errors (ex: trailing commas, wrong indentation, extra semicolon) are easily fixable. There’s no need to halt the process and wait for developers to fix these obvious errors. To configure… 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 indiscriminately. He floats from one technology to another like a moth and stings the problem sets like a mosquito. This author codes Java while drinking Espresso and writes Spock specifications while listening to Groovy beats. He masters Google Cloud Platform just like how 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 faze him, for he does not know enough to be afraid of in the first place. GCP, GCS, GCR, GKE, GWT… everything sounds the same to him. He never fears acronyms, synonyms, or antonyms, for he has ChatGPT in his back pocket. 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; if he doesn’t, that’s okay because he has the attention span of a squirrel. The blog posts are his buried walnuts, in case he needs them one day.
In conclusion, this author is full of something. He apologizes in advance if you are trying to solve your company’s real problems with his shitty solutions. There, he has successfully written paragraphs of nonsense because every professional blogging website needs a section about the author, with a too-cool-to-smile portrait staring sideways into the abyss.