Skip to main content
Categories
General

Utility tools to boost your command line experience

If you are a programmer, you may spend a good amount of time on the command line. Here is a small set of utility tools which have helped me.

bat command

You may have come across the cat command, which helps you in viewing the contents of a file.

cat command preview

It certainly is very helpful, but what if we could make it better? Enter the bat command, or as described on its repository A cat(1) clone with wings.

The command really does add wings to the cat command, bat supports syntax highlighting for a large number of programming and markup languages, integration with git and automatic paging if the content doesn’t fit on your screen, here is a preview of the command.

bat command preview

Installation instructions can be found here, take it on a test drive! If you find this useful, you can alias the bat command for cat and make it your default way of viewing file contents.

Overriding the cat command using alias :

alias cat='bat'

fzf fuzzy finder

If you are lazy and looking to run commands you ran earlier but don’t exactly recall the exact usage, you must have done a Ctrl+R to search through history, fzf enhances this and gives you a preview, here is the command in action.

fzf preview

Installation instructions can be found here, you can also use fzf to preview files in a directory by combining it with bat, for a quick preview.

Alias for fzf + bat preview :

alias preview="fzf --preview 'bat {}'"

fzf + bat alias preview

That’s about it for now, I hope this helps!


Ever since I came to know about the possibility of a headless setup for WordPress, I have always been tempted to try it out.

I tested out a simple setup based on Next.JS on my local setup, before going ahead with Frontity on my blog with high traffic, which now has 2 posts counting this one 😅

You can check out the simple implementation here https://github.com/thrijith/headless-wp which is based on this https://webdevstudios.com/2019/01/03/headless-wordpress-with-react-and-nextjs-1/

The setup is pretty straightforward you may follow this, to get started.

Run npx frontity create mysite-frontity-app && cd mysite-frontity-app, select your desired theme and it will create a starter setup for your Forntiy app, run npx frontity dev, to launch the app, it will use a demo site to get the posts data for your newly created site.

Go ahead and edit frontity.settings.js and point @frontity/wp-source => api field to your WordPress site, run npx frontity dev again you should now see posts from your site instead of data from the demo site.

Deploying your site in Vercel

Frontity has a dedicated section which covers the deployment on Vercel ( Previously Zeit )

Once your app is set up correctly, it will be visible in your Vercel Dashboard, it will create a random URL for your site, you can test your site there.

You can also set a custom domain for your site, settings for the same can be found under Project => Settings => Domains, you’ll also have to set up an ALIAS record to point your custom domain.

Settings Page
Sample ALIAS record in https://porkbun.com/ ( My domain registrar )

Please note it may take a couple of hours to reflect the change.

PS: I might be trying Gatsby next and see how that goes, it is possible by the time you come across this post, all this setup might be long gone 😜 hope this helps you in some way.


Categories

Hello world!

Hey folks 👋

My name is Thrijith Thankachan.

I am a Software Developer by profession. 👨‍💻

This is my blog, I am not sure at what frequency I’ll post/update things here. 🤷‍♂️

Most likely, I’ll post stuff mainly around coding and other things I like…