Posts

Difference between __dirname vs __filename vs process.cwd() : once and for all

Image
Recently I started working with nodejs, one of the most popular backend technologies in today's era. After spending some time with nodejs , I quickly realised that I am facing some difficulties figuring out the tiny differences among three of node's global objects, i.e __dirname, __filename and process.cwd . The main reason of causing this confusion is that they are closely related to each other and behave almost equally in certain scenarios. That's why I sat down today to clear the confusion and figure out the differences . This post is about writing down all those details for future references and helping out people who are in the same shoe now, in the past or in the near future. At first lets see what the official documentation of node says about these three global objects. __dirname It will return the directory name of the current module. I like to remember it as it returns the absolute directory path of the script or js file (the one which we run using node com...

Violation of Inappropriate Ads Policy : One Stop Solution

Image
If you are like me who recently gets an inappropriate ad violation policy notice from google play and as a result of it , google play removed your app from play store, then we are in the same ship and there is no doubt that this post is written for you people. Google does like to play with us a lot , I must say it's a learning for me as I am getting more acquainted with all those hidden policy violations. It does increased my knowledge a lot while trying to find the solution for this kind of problem. Well, enough jibber jabber, lets dive into the main solution part. In this post I will show you how you can get rid of this mighty policy violation and put your app back on play store. What it looks like Here is the glimpse of an email regarding ad violation policy in case you are not sure what I am talking about. What's the effect If you don't take actions within one day then you will also get an admob action required as a consequence of this policy violation error...

Azure Sql Firewall Configuration

Image
In this post I will show you how to configure firewall settings for Azure SQL server in order to connect from your local development machine or from some remote machine where your application is hosted. More or less, the process is same. What is firewall, in azure's case IP firewall Technically speaking, firewall is a software program which prevents unauthorized access to your system. We can think of firewall as a bouncer waiting outside of the midnight party club. The bouncer only allows the spectators to pass through the club's door whoever has the pass/invitation to join the party.  Pretty cool, huh. As network traffic passes through the firewall, the firewall decides which traffic to forward and which traffic not to forward, based on rules that we have defined. In azure SQL we have to add some firewall rules for allowing trusted users to pass through the wall of winterfell. In azure world , the users who can have access to SQL server are called clients. By allowi...

Google play console configuration for IAP, Part 1

Image
No doubt, configuring In-app purchase inside google play console is a long, tiresome process. This is particularly true if you are just starting out or new to this In-app purchase world. I will try my best to explain the steps needed for the configuration of in app purchase. From now on we will call this IAP as this saves some typing for me, hope you guys don't mind on that. However,  covering the full procedure in a single post is not going to be suitable for readers. That's why I am breaking the full procedure in a series of posts and this article is the first one of them. To successfully test & publish app with in app purchase, we need to do following Download and integrate in app billing library inside the code of your android app Upload that app to play console Configure for in app purchase inside play console Setup sandbox/test environment in order to test the app with IAP What I am not going to discuss or write about How to code or integrate in app ...

SQL Query : Part 1

You are probably thinking that this is going to be another sql query tutorial. Well the answer is both yes and no. I am tired of searching and reading all those sql tutorials again and again where each of this tutorials explain all those concept from top to bottom, which I don't need. We programmers easily forgot sql query syntax but not the concept. So I created my own list to save a lot of searching time. I am not posting all queries in a single post. I had divided all queries into several parts. This is the first part. I am using mysql for the RDMS. I also includes some common mysql command along with sql queries. This post only contains queries which includes database creation, table creation, view data from table. Start mysql server mysql -u root -p This command will prompt for password,  enter the password you set for your local mysql server. Resetting root user password for mysql server ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass...

How to build an apk with React Native

Image
For the last couple of days , I am trying to build an apk with this new React Native in order to show the app to other people that I created with this new technology. The official react documentation states how I should build an signed apk. At first I thought it will be a pain in the ass to build a signed apk. So I go for building an unsigned apk in order to bypass the process of generating a key or keystore or stuffs like that. As a result I was able to build an apk which is not installable on android phone. Every time I try to install the apk , "This app can not be installed" was smiling at me. I scratched my head trying to figure out what was going on, then I came across to android's official documentation  about signing your apk. It clearly states that you must have your apk signed either in debug mode or in release mode in order to install the apk on the device. Here's what this documentation says, " Android requires that all apps be digitally signed wi...