Skip to content

Instantly share code, notes, and snippets.

View krishnathota's full-sized avatar
🏠
Working from home

Krishna Thota krishnathota

🏠
Working from home
View GitHub Profile
@krishnathota
krishnathota / word-search-puzzle-position-finder.js
Last active February 1, 2024 11:02
Word Search Puzzle - Position finder
//* Function to solve a word search puzzle
function wordSearch(board, words) {
board = board.map((row) => row.split(''));
//* Define the possible directions to move on the board
const directions = [
[-1, 0, '↑'], // up
[1, 0, '↓'], // down
[0, -1, '←'], // left
[0, 1, '→'], // right
@krishnathota
krishnathota / JS Memory usage.txt
Last active October 22, 2021 08:45
Finding JS memory usage of a chrome tab
Add the below flags while running chrome
--enable-precise-memory-info --js-flags="--expose-gc"
Ex:
"C:\Program Files\Google\Chrome Beta\Application\chrome.exe" --user-data-dir="C:/ChromeDevSession" --disable-web-security --ignore-certificate-errors --enable-precise-memory-info --js-flags="--expose-gc"
@krishnathota
krishnathota / Logger
Created October 22, 2021 04:25
Logger service
Logs to console, can be extended to localstorage, webapi
@krishnathota
krishnathota / Delete with Rimraf from context menu
Created October 22, 2021 03:54
Delete with Rimraf from context menu
Install the node module rimraf globally
npm i -g rimraf
Copy the delete.bat file into system32
Run the reg file below or follow the below steps
In Regedit go to -> HKEY_CLASSES_ROOT\Directory\shell\
Right-click on Shell and select New > Key
Name the key' Delete with Rimraf'
@krishnathota
krishnathota / krishna.omp.json
Created October 15, 2021 16:42
oh-my-posh custom theme
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"final_space": false,
"osc99": true,
"console_title": true,
"console_title_style": "template",
"console_title_template": "{{if .Root}} ⚡ {{end}}{{.Folder | replace \"~\" \"🏚\" }} @ {{.Host}}",
"blocks": [
{
"type": "prompt",
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
}
#Import-Module PSColors
#Import-Module posh-git
Import-Module -Name Terminal-Icons
@krishnathota
krishnathota / SubSink
Last active June 22, 2021 02:02
Use SubSink to Unsubscribe automatically
import { Injectable, OnDestroy } from '@angular/core';
import { SubscriptionLike } from 'rxjs';
import { SubSink } from 'subsink';
/**
* @description Keeps hold of your subscriptions and unsubscribes them when component is destroyed.
* This uses 'SubSink' library to achieve this.
* @usage Extend your component from this 'MyComponent extends Unsubscribe'. Call super() in your component's constructor.
* @important Please keep a note that if you happen to implement OnDestroy in your component,
* you have to explicitly call super.ngOnDestroy() to invoke un-subscription for the component.
* @param sub; Subscription list. Assign your subscriptions in your component to 'sub'
@krishnathota
krishnathota / chat-frontend.js
Created November 12, 2020 03:43 — forked from martinsik/chat-frontend.js
Node.js chat frontend and server
$(function () {
"use strict";
// for better performance - to avoid searching in DOM
var content = $('#content');
var input = $('#input');
var status = $('#status');
// my color assigned by the server
var myColor = false;

Dev Setup

  1. Homebrew/terminal/bash
  2. OSX Productivity - Window Management/Quick Launcher/Hyperswitch
  3. OSX Settings - Dock/Finder
  4. Web Browser - Extensions - AdBlock, Privacy Badger, OneTab, JSONViewer, Stylus, Vue Devtools, React Devtools
  5. Node.js - nvm
  6. Code Editor - vs code
  7. Code Editor Extensions
  8. Break timer and Flux