Skip to content

Instantly share code, notes, and snippets.

View himanshurajora's full-sized avatar

Himanshu Jangid, हिमांशु जाँगिड़ himanshurajora

View GitHub Profile

All I can say about this is that, these are the things a software engineer must make to be a real Engineer.

  • Operating System
  • Compiler
  • Frontend Framework
  • Plugin architecture software
  • Game engine
@himanshurajora
himanshurajora / yield.md
Created January 30, 2024 05:28
Yield Keyword Javascript - With Real life use-cases

The yield keyword in JavaScript is primarily associated with generators, which are a special type of function that can be paused and resumed. Generators are useful for working with sequences of data, asynchronous programming, and creating iterators. Here are some real-life use cases and examples:

Lazy Evaluation and Infinite Sequences:

Generators allow for lazy evaluation, meaning they produce values on-demand rather than generating them all at once. This is particularly useful when working with infinite sequences.

function* infiniteSequence() {
  let i = 0;
  while (true) {
    yield i++;
@himanshurajora
himanshurajora / regex-discussion.ts
Created January 22, 2024 10:00
Regex discussion on Adevent of Code 2023 - Day 1 Part 2
const regex = /(\d)/gmi;
const regex2 = new RegExp(`(?=(?<digit>[0-9]|one|two|three|four|five|six|seven|eight|nine|zero))`, 'gmi')
const input = 'afsdone2f537826sdf5sixf';
const letters = {
one: 1,
two: 2,
three: 3,
@himanshurajora
himanshurajora / personal-email-signature.html
Created September 20, 2023 16:57
Personal Email Signature
<table
cellpadding="0"
cellspacing="0"
style="font-size: medium; font-family: Arial"
class="table__StyledTable-sc-1avdl6r-0 kAbRZI"
>
<tbody>
<tr>
<td>
<table
@himanshurajora
himanshurajora / gulpfile.js
Created May 7, 2023 18:19
GulpJs html live compile and host
const gulp = require("gulp");
const comments = require("gulp-header-comment");
const fileInclude = require("gulp-file-include");
const bs = require("browser-sync");
const path = {
src: {
html: "src/**/*.html",
},
};
@himanshurajora
himanshurajora / gulpfile.js
Created May 7, 2023 17:01
Gulp file with file include in html, basic configuration
const gulp = require("gulp");
const comments = require("gulp-header-comment");
const fileInclude = require("gulp-file-include");
const path = {
src: {
html: "src/**/*.html",
},
};
@himanshurajora
himanshurajora / work direcotry not preserved in bash.md
Created April 27, 2023 04:19
work direcotry not preserved in bash / zsh gnome terminal fix

You can add this command to you shell's confuguration file (.zshrc / .bashrc)

if the vte.sh is not avaible you can just google it

# including this ensures that new gnome-terminal tabs keep the parent `pwd` !
if [ -e /etc/profile.d/vte.sh ]; then
    . /etc/profile.d/vte.sh
fi

Hello brothers,

What do you think I have come up with today. Indeed I am following the 100 things principle up until this day, I know what's good for me and indeed I am doing that.

Tmux

For sure this is what I have learnt today

What? The answer to What is that it a terminal multiplexer, so basically you can have the feel of multiple terminals in a single terminal.

@himanshurajora
himanshurajora / .zshrc
Last active September 5, 2024 08:56
The ZSH configuration you always wanted, and I have it.
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
@himanshurajora
himanshurajora / config.lua
Last active June 19, 2023 17:17
My Lunar Vim Config
--[[
lvim is the global options object
Linters should be
filled in as strings with either
a global executable or a path to
an executable
]]
-- THESE ARE EXAMPLE CONFIGS FEEL FREE TO CHANGE TO WHATEVER YOU WANT