Skip to main content

Posts

The ever so common var, let and const

 So in JavaScript world, in whichever way you go, you finally end up with some very basic concepts.   I skipped certain basics while learning JavaScript. Later in life, I regretted it, but then, of course, you don't repeat the same mistake twice. So the very common and pretty basic thing you could see in JavaScript is the concept of  var, let  and  const.   What are they? How do they differ from each other?   Simply put  var, let  and  const  are keywords within JavaScript. All three of them are used to declare a variable. So why do we need three of them? JavaScript is weird. You can even use a variable without initialization in JavaScript. So why take the time to write a keyword. Now for JavaScript, there is a concept called global scope. In a simple browser where you could see JavaScript quite common, the global scope refers to the window object. And in the NodeJs module, this will be the global scope of the module. So if you simp...

Aah..the costly hobby of typing on a mechanical keyboard

 Lockdown happened swift and quick in India. Come forth April I am surfing through the internet and subreddits. I found one particular subreddit named mechanical keyboards. Until then I was happy with my two membrane keyboards, I could game, I could type at a blistering pace (so I thought) everything was normal. But then this clicky heavenly beauty strikes my mind. I could not take it out of my mind. The sweet sweet sound of the key being pressed on a clicky switch, the smoothness of the linear and my personal favourite of the tactility. After many research and study, I decided to buy a mechanical keyboard. But by then the whole world was changed. I learnt that no decent mechanical keyboards are cheap and to get a hold on one of them in India is not an easy feat. After researching a lot, importing one was not an option. The import duty exceeds even 100% some times.    Meckeys was a super cool site to buy mechanical keyboards in India. Thanks to them (but not fully satisf...

My continous fight against a bitcoin miner

I was working on a medium sized company. And one day during one of my project I got the chance to work on a project. And then I got the chance to setup our company server as the development server for the project. I started to setup the server as usual with all the usual stuffs (It's time I do something about it). My initial code setup was a-okay, until I found out that the webpage takes a little bit more to load. This was happening now and then. And when I chat to my colleagues I get to know that they also suffer from the same fate. They thought it was the network issue. I started to look for the issue, in the server. You know how it is. There is no GUI, but all you have is a terminal and that's that. During HTML page inspection on the browser, I could see that at the very end of the page after all the scripts loaded there was this "cute" little piece of script that's been called like 7 or 8 times. https://xmr.omine.org/assets/v7.js (https! so secure...) Well as ...

NUOREACT - Nuomorphism in react simplified

Last month (i.e May of 2020), during the lockdown, I started wandering over the npm community and the ways to build an npm package, so that I have my signature on the open-source world. I was working as a full stack developer then, and my front-end work was in reactjs. Initially, I was frightened to develop something in react but then I fall in love with the idea of reactjs.  My work became my hobby and loved the idea of reusable components with less amount of code. The component re-usability and the ease of developing one ignited an idea of another npm package. But unlike last time ( LNFC ), I was not so set on building one npm package for react components. So I started learning how to create one and then managed to do so. The package is called nuoreact, simply an acronym for nuomorphism and reactjs. Nuomorphism is a design concept, that is well explained in this blog post  here I was intrigued by the concept of nuomorphism, and the mediocre nuomorphism component packages in ...

My experience with firebase

I started using firebase for one my project for the past couple of weeks now, and it has its ups and downs to say. Initially, I had a very warm relationship with firestore and authentication when I used the later for one of my world cup prediction app. Which after a little bit of struggle I managed to make it work. I thought this is cool. I should use it more often. Then I created a blood donation app using firebase this time, using its authentication and as well as a firestore feature to store the info relating to the blood groups of persons who are registering to the app. But then I see problems. I see that its not easy to take the counts of people who have O +ve blood, you just need to keep that glued in somehow (I used a counter variable if you ask me!), and then needs to update two or three places in order to run the app smoothly(hey, its NoSQL what do you expect!). I was running the code here and there updating the firestore DB multiple times increasing my read and wr...

The hassle of firebase in flutter

I recently did a firebase integration in flutter to enable cloud messaging services in my app. I guess you all know what it means. The power of customized, fast notifications in my flutter app. I thought being firebase and being flutter has its own perks (since both is backed by Google). But in reality it's not that easy. I wanted to integrate androidX support inside my android folder for the flutter app to work. Well the official doc of integrating firebase to flutter is good( https://firebase.google.com/docs/flutter/setup ), but it does not provide you with the full details though. Apart from the steps described in this doc. I followed some more steps to achieve what I was looking for. In the app level build.gradle file, under the dependencies section, i added the following implementation 'androidx.multidex:multidex:2.0.0' then the 2 lines which includes  androidTestImplementation under dependencies section is changed to the following. androidTestImplementation 'com...

My first ever npm package

So lately I published my first npm package. It gave me immense joy to share it with you here. But it's not something I was planning to do. Things happen you know. Quickly and unexpectedly. I was working on a MEAN stack project for the last 2-3 months. When working on the backed of stuff, I was going on creating files and doing the same or somewhat same set of codes over and over again. If it's something related to user, then the file name of the controller is user.controller.js and the service file name is user.service.js. With method, names are getUser, or getUsers, or deleteUser. And if it's on some other stuff, say a device, most of the logic remains the same, except this time the name of the method and files changes to deleteDevice and device.controller.js etc. You get the point. So which means I am wasting a lot of time on somethings that I could automate, time which I could easily focus on optimizing the code and making it bug-free. So I wanted to hav...