In this guide, we will discuss how we can create a javascript library and publish it to npm. In a previous post we had built a small script for creating a nested tree menu. We will convert that into a npm package here.

Step 1: Initialize the directory and the repo.

Let’s create a folder for the library and add a file there. This would be a good time to do git init and create a remote github repo to track it as well. (If you are new to this, you can check github howto here)

Step 2: Add scripts and stylesheets inside the src folder

In this guide we intend to build the package and then…

While building a dashboard layout, I recently had a requirement for a nested tree menu. It would preferably have to support any arbitrary level of nesting. There were some packages available already like JSTree — but they were built to support a lot of extra functionalities like changing the menu theme, adding branches dynamically etc which made them bigger than I needed them to be. I didn’t need any of those features and hence decided to build it myself. This short post is intended to document the same

Designing the html structure

The default choice for any menu type structure is to go with…

Nginx access logs are a very important data source for web traffic analysis. Analysing these logs can provide us information like the frequency of hits to specific urls, traffic from specific ips etc. While this is useful by itself, for it to be a proper analytics datasource, it should also be possible to analyse user behaviour over time — monitoring things like when the user signs up, when the user converts to a paying customer etc using the log entries themselves. …

I am planning to do a series of posts where we will progressively build a demo ecommerce website using Flask, SQLAlchemy and React. The boilerplate repositories prepared for these posts might serve as useful starter kits for others. Plus it will help the reader get a feel of building a production grade website from scratch.

These posts will be based on some of my learnings obtained from building an ecommerce website for the past 6 years. Since I mostly worked on backend apis, devops and analytics — my posts will be focused more on those areas. …

Web browsers have become increasingly very powerful over the past few years. Many features which were earlier offered only by mobile apps are now available on web as well. This has primarily been due to Google’s investments in Chrome browser (and Mozilla’s work on Firefox as well) and some allied technologies like Progressive Web Apps

Service Workers are the core piece of the technology that enabled PWAs to compete with native apps in terms of the functionality offered. You can get a good introduction to how these service workers work from this tutorial created by google and this MDN article

I had recently setup a Jupyterhub server for my company and wanted to blog about the same. Before we get into the setup instructions, it might be useful to have a brief overview of the Jupyter eco-system. When I started I was confused by the various terms which were being thrown around. So this post will be kind of a glossary of the various technologies which together constitute the Jupyter eco-system.

First there was the shell

According to multiple surveys, Python is either the most popular or the second most popular programming language in the world. Frameworks like Django, Flask etc have made it a…

Google’s Waymo is a threat to Uber, but not just because it has the obvious head start in the autonomous car business. While that would indeed reduce Uber’s eventual market share in this segment, Waymo’s arrival also threatens Uber in a more fundamental way. In my opinion, it also threatens Uber’s ability to continue to operate the normal taxi business which is the far bigger business still. Here is why.

Self driving cabs — Taxi business or Car rental business?

The popular perception is that if the legislation permits fully autonomous vehicles eventually, self driving cars will have a major advantage over human driven cabs since they would have removed…

Recently I had to create some jupyter notebooks to analyse a database. Since the database credentials were not meant to be committed as part of the code, I decided to keep them as environment variables. And it turned out to be surprisingly tricky to access the environment variables in the notebook. The first complication was that it was a Jupyterhub server and not a single instance notebook. When you launch a jupyter notebook directly from the command line, it has access to the environment variables defined in the .bashrc startup scripts. But that is not the case here. We will…

So, China is moving to abolish term limits and essentially let Xi Jinping do a Mao if he prefers so.

On the one hand, this is sad and scary because I had really wanted to believe that CPC had become a very pragmatic and stable political organization which would guarantee the stability and predictability that the global economy desperately needs now.

On the other hand, as an Indian, this is quite exciting because, it is yet another opportunity for India to rise to the top. America committed political suicide last year and now it looks like China is on…

When I kept the five rupee coin on the juice shop’s table, something felt different about it. On picking it up and checking it again, I realized it was not a 5 Rupee coin at all. It was a 20p coin from 1971! Some shopkeeper must have given it instead of a 5 rupee coin.

Here are some photos of it next to the current brass colored 5 rupee coin which was minted in 2011.

Both are remarkably similar in color and thickness.

The old 20p coin is slightly smaller in diameter.

Surya Sankar

Entrepreneur, Full stack web developer, Product Manager. Dabbling with data science now. Interested in Economics, Politics and History.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store