How to Fix: Could not establish connection. Receiving end does not exist

If you are developing a Chrome extension with message passing, then you might have received the following error: Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist.. There was some type of behavior change that happened post Chrome 72 that affected the way channels are opened. Essentially, if you try to call runetime.connect() before you have a a channel open, then you will get this error (Stackoverflow).

Kafka Nodejs Example with Producers and Consumers

Let’s take a look at a Kafka Nodejs example with Producers and Consumers. We will be creating a kafka producer and consumer in Nodejs. If you haven’t already, check out my previous tutorial on how to setup Kafka in docker. I already created a topic called cat that I will be using. Kafka Producer We are going to use the npm module called kafka-node to interface with our kafka and zookeeper.

Flying a Drone With Javascript

Flying a drone with javascript probably sounds crazy and hard. Do I use a framework? Will the 10 GB of node_modules weigh it down? NOPE! It’s all pretty simple to do. The other day I came across a neat drone called the DJI Tello. It is a relatively inexpensive quadcopter that offers a simple SDK which can be accessed over WiFI. Using the NodeJS dgram library, I can send commands via UDP to the drone to perform actions such as takeoff, left 20, and land.

Scrape Google Search Using Puppeteer

For my side project, I needed to scrape Google search using a headless browser. I ended up using the Nodejs library called puppeteer. It’s a headless browser that uses chromium. Install puppeteer npm install puppeteer Scrape Google Search using Puppeteer First, let’s go to the google homepage, type something in, and click the search button. try { (async () => { const browser = await puppeteer.launch(); const page = await browser.

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.

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.

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.

Meltdown and Spectre – Possible Javascript Vulnerabilities

This has been a very interesting New Year. So far, 2018 has brought us two of the biggest bugs to hit CPUs in the past 12 years: Meltdown and Spectre. Intel is struggling to get their Meltdown bug under control while Amazon and Microsoft brutally await its impact on their cloud services. Both Meltdown and Spectre are serious issues, but Meltdown is easier to exploit and gives attackers more valuable information.

GPU Programming in Javascript

You probably don’t think about Javascript when you hear the words GPU programming. However, it should come as no surprise that there is a library to do anything and that includes GPU Programming in Javascript. Let’s get one thing clear though, you should probably not do this if you are looking to do serious GPU programming. For serious GPU programming, I recommended that you work with Nvidia’s CUDA in C and C++.

Javascript for of vs for in vs for each

If you are new to Javascript (or even a seasoned js developer), you will probably get confused when trying to understand the different types of for loops. So let’s go through the javascript for of vs for in vs for each loop. Standard for loop Suppose we have an array called myArray. Here’s how you would iterate through it using the standard for loop: var myArray = ['Cat','Dog','Horse']; for(let i =0; i< myArray.