Why I Switched From WordPress to Hugo

WordPress isn’t awful. In fact, I recommend WordPress to everyone who wants to start a blog. Despite this, I switched from WordPress to Hugo a couple of weeks ago. The real reason came down to cost and simplicity. Cost Running a WordPress blog meant that I needed a good shared hosting environment with a MySQL server and PHP execution. I first tried Hostgator, and it was sufficient enough while my blog had less than a hundred of visitors per month. [Read More]

Read System Environment Variables in Angular

A few weeks back I was working on a project where I needed to read system environment in Angular 7 from a Docker container before it builds. After days of searching, I came across a solution from multiple sources on the internet. Keep one thing in mind, you will only be able to inject environment variables before your Angular app builds. Unlike Nodejs, you will not get real time access because you are running in an browser environment. [Read More]

How to Setup Search on Hugo

Setting up search your static site built using Hugo or Jekyll is not as difficult as it sounds. If your static site is hosted on GitHub pages (which mine currently is), then you will not be able to use php or any server side scripting. Therefore, we must rely on a pure javascript solution. Using Lunr.js Lunr is a popular library used to parse through data and return the most accurate match based on a search query. [Read More]

JWT Tokens in Express and NodeJS

The JSON Web Token (JWT) is the easiest standard for protecting APIs and passing in claims data. A JSON Web token allows the server to verify the authenticity of the user and provide them access to protected API routes and data.  A simple JWT flow goes as follows: The user sends login credentials to the server The server verifies user against the database then returns a JWT token if valid The user sends that token in the header with every request to API. [Read More]

React Login with Google Firebase

There are many opinionated solutions for building a React Login with Google Firebase. I generally prefer an approach where the user isn’t shown the main UI until he is logged in. And if the user logs out, we immediately kick him back to the login screen. Luckily, this isn’t hard to do at all. Dependencies The only dependency you will need is the Firebase API. You can install this form the Node Package Manager. [Read More]

How to build a Chrome Extension

Chrome extensions¬†are really cool. They allow the user to extend the capabilities of their browser and can incorporate really well into existing apps. So let’s take a look at how to build a Chrome Extension in less than 10 minutes. Chrome Extensions are written in Javascript, so I recommend that you have a basic understanding of Javascript before proceeding with this tutorial. What we’re building We are going to build a simple chrome extension that will allow you to search google for any text that you highlight on a page. [Read More]

Blockchain and Decentralization will NOT fix the Internet

Stop saying that blockchain and decentralizing everything will fix the Internet. There has been a lot of news around Cambridge Analytica abusing Facebook profile data, and Facebook for mining user data without explicit permission. Yes, I agree that these are very bad things that need to be addressed. And I also agree that while Facebook is at the front-lines of this digital privacy war, we could also blame many other companies like Google, Twitter, Amazon, etc for similar practices. [Read More]

React Native StackNavigator Tutorial

I have spent hours trying to figure out how to actually use the React Native Stacknavigator to navigate between screens. All the tutorials and guides seem to be missing important information, and the official React Native documentation is truly lacking in substance. So I want to save you some headache and give you a quick and easy setup to using the React Native StackNavigator. You need to Eject If you created your react-native project using the command: [Read More]

Google Poly API Javascript and NodeJS

Google has been working on an interesting project called Poly. With Poly, you have access to hundreds of 3D objects that can be used to build VR games or with AR content. The interesting about Poly is that all of the graphics are available on demand. Think of it like Google Fonts just for 3D objects. So let’s take a look at how you can get started with Google Poly API Javascript and NodeJS bundle. [Read More]

React Context API

I’m sure you have probably heard of the fancy new React Context API. It’s a new way for you to manage application state. If you are building a large react application, you have probably encountered a problem where you needed to access and share data across multiple¬†components. For example, we might have information on the currently authenticated user that multiple components need information on. To solve this issue, you might use a library like Redux or Mobx. [Read More]
api  context  react