Skip to content

Instantly share code, notes, and snippets.

View amitkbiswas01's full-sized avatar

Amit Biswas amitkbiswas01

View GitHub Profile
// problem 1
function isPalindrome(x: number): boolean {
const xStr = x.toString();
for (let index = 0; index < xStr.length / 2; index++) {
const leftIndex = index;
const rightIndex = xStr.length - index - 1;
if (leftIndex === rightIndex) return true;
if (xStr[leftIndex] !== xStr[rightIndex]) return false;
@amitkbiswas01
amitkbiswas01 / diff-to-json.go
Last active February 1, 2022 18:00
Program to convert output from `git diff` for a folder to a JSON file based on the line change.
// Copyright 2022 Amit Biswas. All rights reserved.
// Use of this source code is governed by the
// GNU GENERAL PUBLIC LICENSE v3.0
// Program to convert output from `git diff` for a folder to a
// JSON file based on the line change. If the diff for a file is
// nothing other than line number changes, it excludes the file
// from JSON listing.
// For example, if the diff for file A is like below, where the
@amitkbiswas01
amitkbiswas01 / ubuntu-after-install.md
Last active April 22, 2021 05:30
personal-dev-setup todos after installing new os

Things I do after installing Ubuntu

  1. Change Software and Update settings.
  2. Make password visible.
sudo visudo # Defaults	pwfeedback
  1. Update and Upgrade and Clean.
sudo apt update &amp;&amp; sudo apt upgrade