Host your own site - 2020 edition
· ☕ 2 min read
Medium, Dev.to, Hashnode, Wordpress? Or, why should you invest in yourself rather than in platforms? The Problem Developers should write and write often. It may be anything - code snippets, ideas, thoughts, design principles, standards and what not. I have found that writing down things often forces me to solidify abstractions and get more clarity.

No Tracking Information Error in Git
· ☕ 2 min read
Aren’t you following the right way to git? Are you frustrated with the message “There is no tracking information for the current branch”? Keep calm and read on. The Problem I create new Git repositories all the time - just like any other developer. I am too stupid to notice the small things and learn my lessons - unlike any other developer.

Design Emails Using Bootstrap
· ☕ 3 min read
Wondering how you could apply modern UI design to emails? Here’s the answer. The Problem I don’t know about you - but emails are the last thing that I want to design. I end up sending plain text emails for most of my apps, and that works just fine. However, a few projects have more complex requirements.

Valuable Site of the Month (Oct '19) - Online HTML Editor
· ☕ 2 min read
We back with a valuable site of the month after a not-so-brief hiatus. Here’s presenting this month’s pick - an online HTML editor. No.. Not another editor HTML editors are aplenty. Anyone and everyone can whip up a quick site using TinyMCE, CKEditor and the like, provide a preview and call it a day.

Email for NodeJS app using separate server on CPanel
· ☕ 3 min read
Configure email server on a third party host using CPanel, while continuing your app server on your favourite VPS. Background Typically I configure email server to be on the same server as my NodeJS / PHP app. Bad practice? Sure. But, it works just fine for the kind of applications that I write.

Reusable debounce function for Vue
· ☕ 5 min read
Debounce operations in Vue using this 10 line script. Avoid loadash and friends. What is debounce? Delay and throttle operations to wait and collect user input before doing something with the input. The “something” can be updating another field, doing an API call, or starting a timer to self-destruct. Did you not debounce earlier?

Centralized alert for Vuetify
· ☕ 4 min read
Centralize all error, warning and info alerts in one place. I like v-alert and tend to over-use it. It enables us to show detailed notifications (error or otherwise) - without significantly causing user inconvenience. I find v-alert more suitable in my apps than using, say, popup alerts that interrupt users, or “toast” notifications which I find unsuitable for detailed messages.

Include full content in site feed in Hugo
· ☕ 2 min read
Include all content of your posts in your site feed when using Hugo static site generator. By default Hugo will include only summary in your website feed (e.g. in /index.xml). Your theme may already provide a way to provide full content instead of just the summary. If it doesn’t, you can make those simple changes yourself.

Pass all scoped slots b/w components
· ☕ 1 min read
A nice way to pass along all scoped slots to a component. We can pass all props from the source component to target using this code - 1 2 3 4 5 6 7 <wrapper> <b-table v-bind="$attrs" v-on="$listeners"> <template v-for="(_, slot) of $scopedSlots" v-slot:[slot]="scope" ><slot :name="slot" v-bind="scope" /></template> </b-table> </wrapper> Found this in this StackOverflow post.

Asserts are not just for testing
· ☕ 2 min read
Assert is a general-purpose validator and should not be used in the context of testing alone. An assert in Javascript simply checks for truthy values and produces an error otherwise. We use it quite a bit in automated testing when checking for correctness of output for pre-defined inputs. We use asserts like so -

unknown vs. any in Typescript
· ☕ 1 min read
Why use unknown when we have any in Typescript? Type inferences are powerful and allows us to do magic when we don’t know types. 1 2 3 const i: any = 1; console.log(i); // 1 unknown seems to do the same thing. 1 2 let x: unknown = 1; console.

Interfaces as function types in Typescript
· ☕ 2 min read
Let’s get to know interfaces for functions - yes, that’s a thing. We have seen interfaces used as types and interfaces as array types. Since function is an object and interfaces are supported on other objects, they should be supported on functions also. Right? You betcha. What is this blog if we can’t write about all the stuff that no one care’s about?

Modules in Typescript
· ☕ 3 min read
It’s not the why, but more on what of ‘modules’. No Javascript is an island. It was an island about two decades back but Javascript has done some pretty good land reclaimation to form large continents now. So it goes without saying that these are not the days of writing Javascript or Typescript in <script> tag in a single HTML.