Programming

Prisma Migrate: Baselining your existing database
9/25/2021

Prisma Migrate: Baselining your existing database

I have been using KeystoneJs for one of my projects. Keystone uses Prisma. I have been putting off using migrations for a while now so, I already have my production site with data and I do not want to lose my data to start using migrations. For this purpose, there is a technique called baselining […]

Introduction to Polar Coordinates, plotting on radial diagrams
5/5/2021

Introduction to Polar Coordinates, plotting on radial diagrams

Trigonometry “the foundation” the branch of mathematics dealing with the relations of the sides and angles of triangles and with the relevant functions of any angles. Google Basics of Trigonometry Trigonometry in its core has a very simple foundation. Although being so simple, it blows my mind that its the base to all the complex […]

Upgrading NextJs v11 to 12 hopefully to 13
4/17/2023

Upgrading NextJs v11 to 12 hopefully to 13

upgrading NextJs from v11 to 12. Webpack@4 is no more supported so first Upgrade Webpack v4 to v5 Simply run yarn up webpack Try running NextJs yarn dev Still uses webpack v4… Using webpack 4. Reason: webpack5 flag is set to false in next.config.js https://nextjs.org/docs/messages/webpack5 Change webpack5 to true in next.config.js Run NextJs again. ValidationError: […]

SQL to get Products and related data from PostgreSQL
10/19/2021

SQL to get Products and related data from PostgreSQL

The objective of this exercise for me was to dump all the product data as CSV / JSON so I could index them into Algolia. The exercise consisted of multiple steps to get to the required form of data. I will run through all those steps and explain what is happening.

Prisma Migrate: Consolidate / Squash Migrations
9/25/2021

Prisma Migrate: Consolidate / Squash Migrations

When working on a new feature requiring schema updates, you may end up creating multiple fragments of migrations. This YouTube video explains how you could consolidate or squash these migrations without having to lose your local data.

JavaScript Tutorial for Beginners
8/28/2021

JavaScript Tutorial for Beginners

I have tried to put together a video tutorial series on YouTube. Please support by subscribing to my YouTube and leaving your feedback on the videos.

Heroku PostgreSQL database backup and restore
5/29/2021

Heroku PostgreSQL database backup and restore

If you are new to Heroku and PostgreSQL and need to backup/restore data to and from your PostgreSQL database in Heroku, it might be overwhelming to get it right. This post has everything you will need to do just that.

Building SVG Clock using ReactJs
5/5/2021

Building SVG Clock using ReactJs

DEMO: https://df2y4.csb.app/ GitHub: https://github.com/dejavu1987/react-svg-clock This blog post is an exercise from my previous blog post Introduction to Polar Coordinates, plotting on radial diagrams. If you have not read the post and have no idea how radial coordinates work. Please go to the post and read and come back. If you are confident, lets go build […]

Build Minesweeper game using ReactJs
4/26/2021

Build Minesweeper game using ReactJs

Here is the demo of Minesweeper game I built using ReactJs. http://react-minesweeper.anilmaharjan.com.np/ I will be creating a step-by-step guide on, all the possible challenges, (hard parts) and the way I approached them. These are just one of the ways we can approach these problems. I appreciate your feedback and PR with suggestions and improvements. The […]

Low waste data modeling using graph
5/1/2021

Low waste data modeling using graph

Hello internet, I decided to write this up after presenting a talk about it to my colleagues at Inviqa recently. I will try to walk you through this mindblowing journey of modeling your data from scratch to building a graphQl API, to consuming the API and then serving it in a ReactJs app.

React MD v1 w/ Gatsby No!
11/2/2020

React MD v1 w/ Gatsby No!

Please avoid using ReactMD v1 with GatsbyJs, since ReactMD 2 is out with full rewrite, that could be an option if you want to stick with ReactMD. I had started to port this blog from WordPress to Gatsby and I had used React-MD ‘s Gatsby starter to start with the project. Because of issues in […]

ML5 with Webpack and TypeScript
10/31/2020

ML5 with Webpack and TypeScript

Why TypeScript? TypeScript allows you to add static typing to your javascript, which adds a possibility to type check on your code during compile time. Even better your IDE itself will be able to tell you if there are any issues with your data types, etc in realtime. Additionally, it can be used by your […]

Docker compose update php.ini
10/24/2020

Docker compose update php.ini

How to configure the php.ini in your docker container? Here is how you can update your config files like php.ini, httpd.conf, php-fpm.conf, .htaccess, etc in a docker container through the host filesystem. On the root folder of your project where your docker-compose.yml is, add a new file to replace some config file, in your PHP […]

Machine Learning – On your Browser
10/21/2020

Machine Learning – On your Browser

Inviqa Engineering CoP 22.10.2020
Machine Learning on your Browser.

9/20/2019

Gatsby with WordPress

Static site generation Why? When? How? Dynamic sites are slower, expensive, complex, hackable. When? If the site is mostly content and no heavy communication with server to update / calculate content in realtime. Best use case, Portfolio website, company website, blogs, etc. Static site generation with Gatsby Gatsby is powerful tool to create static sites […]

Javascript reduce function on array of objects
5/18/2018

Javascript reduce function on array of objects

Array.reduce() function in javascript is one of the most interesting functions, but it may be tricky if you haven’t worked with it on an array of objects.

4/1/2018

Visual Studio Code: Customize find/search match highlight color

 To customize the highlight color of the find matches in visual studio code go to: File > Preferences > Settings > User Settings and add following to workbench.colorCustomizations and choose the colors. “workbench.colorCustomizations”: { “editor.findMatchBackground”:”#6f7700″, “editor.findMatchHighlightBackground”:”#833d03″ }

2/15/2016

CSS targetting for IE 10+ excluding Edge

Use the following media query to target your css particularly for IE10+ browsers @media all and (min-width: 64em) and (-ms-high-contrast: none), (-ms-high-contrast: active) { /* IE10+ CSS styles go here */ }

Angular | Watch an object or an array
3/17/2015

Angular | Watch an object or an array

  $scope.$watch(‘objectOrArray’,function(newVal, oldVal){ // Do Something },true);  

Apache2 on Ubuntu ignores sites-enabled conf (vhost config)
1/12/2015

Apache2 on Ubuntu ignores sites-enabled conf (vhost config)

I am using Vagrant to host my local dev environment in Ubuntu. I found this issue, Apache2 on Ubuntu ignores sites-enabled *.conf After few tries figured out, you need to edit the default 000-default.conf file and comment out the configurations there or just delete the file.

© 2024 Anil Maharjan