Read through a DZone article which talks about a JDK released by Amazon called Amazon Corretto. This is a good news for Java community. It is a production ready JDK backed by Amazon and has been tested heavily by them. This is really an exciting development.
Author Archives: cyberaka
Prettify JSON on Terminal
I love using curl command on my Mac terminal to debug my REST endpoints. However the REST call JSON output used to come in a blob of text which required further formatting in an Editor like Visual Studio Code. To allay this problem I ended up installing “jsonpp” using homebrew.
brew install jsonpp
So now I just pipe the output of my curl command to the jsonpp program and I get a fully formatted JSON.
$ curl http://localhost:8080/test | jsonpp
{
"year": 2018,
"month": 2,
"worked": 18,
"leaves": 2
}
Curl Command New Line Post Output
I like to use curl instead of UI tools like Postman for debugging my RESTful web services traffic whenever possible. I however didn’t like my output being messed up by the bash prompt being suffixed to the output. Something like the following:
$ curl -H "$auth_token" http://localhost:8080/xyz/abc-efg ["-","A","B","C","D","E"]$
So basically what I needed was to have a new line forced after the curl output. A quick search on internet yielded this article. So I executed the following command on my terminal.
$ echo '-w "\n"' >> ~/.curlrc
After doing this when I execute the same curl command I get the following output.
$ curl -H "$auth_token" http://localhost:8080/xyz/abc-efg ["-","A","B","C","D","E"] $
So now the bash prompt is actually coming on a new line by default!
Validating Signature in PDF documents in Acrobat Reader
I received a digitally signed document from a trusted source. However when I proceeded to take a print it came out with “Signature Not Verified” in place of the signature field. This was not going to work so I did some googling and found out this link. It basically allowed me to validate the signature and take a printout with “Signature Valid” in place of the digital signature.
Leveraging Jackson to convert Date to JSON
I used this link to learn about conversion of java.util.Date object to JSON notation which was understandable by JavaScript and Human readable in network tab.
Triggering download of file using JavaScript
I recently needed to write a small piece of download code. So you pass in the ID of the document to a REST API and it should give you back a blob of the actual file. The problem however is how to actually save this blob of binary data into a local file. So a quick Googling threw up some interesting links which I finally used to finalize my solution.
Fractal Folders
I have asked myself this question a number of times. What is the best possible way to structure my UI code? Should I cluster the files using functionality or by the type of file? etc. etc.
I found a partial answer in Fractal Folders while learning ReactJS. This basically proposes that for an UI page there are many functionalities which it is comprised of and the artefacts related to these sub-functionality should be clustered as sub-folders.
Storyboard your ideas
I wanted to convey / pitch an idea to somebody. To do this I used a storyboarding tool called Story Board That. This tool allowed me to create a pitch that clearly conveyed an idea. Overall a good tool!
BPMN Doubt: Difference between Pools and Lanes
What is the difference between Pool and Lane in BPMN?
Its a common newbie question while doing BPMN modeling. The rule of thumb is “Swimming pools have multiple lanes”. So you can model a pool and then lanes inside it. This article provides in-depth knowledge on this concept.
Uninstalling and reinstalling brew
I use brew utility for all my terminal based installation needs. However recently I had to deal with a corrupted brew install. To fix this I followed this link. The uninstallation and reinstallation worked fine and I now have a working brew instance.
The commands as mentioned in the above link are:
$ cd `brew –prefix`
$ rm -rf Cellar
$ brew prune
$ rm -rf Library .git .gitignore bin/brew README.md share/man/man1/brew
$ rm -rf ~/Library/Caches/Homebrew
$ ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”