Skip to content

Instantly share code, notes, and snippets.

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

Jagdish Parihar jatin510

🏠
Working from home
View GitHub Profile
@jatin510
jatin510 / wait-group.go
Created April 27, 2023 05:15
Implementing wait group in golang
package main
import (
"log"
"net/http"
"sync"
"time"
)
func main() {
@jatin510
jatin510 / Trie.test.ts
Last active December 12, 2022 15:59
Tries In Typescript
import { Trie, TrieNode } from './trie';
import { assert } from 'chai';
describe('Trie', () => {
describe('with a single word', () => {
let trie: Trie;
beforeEach(() => {
trie = new Trie();
trie.insertWord('hey');
@jatin510
jatin510 / LazyLoadedComponent.tsx
Created November 23, 2022 17:33
To demonstrate LazyLoading in react
import React from 'react';
export default function LazyLoadedComponent() {
return <h2>Lazy loaded component</h2>;
}
@jatin510
jatin510 / routes.tsx
Last active November 10, 2022 05:59
Navigation in React
import React from "react";
import { BrowserRouter, Routes, Route, NavLink } from "react-router-dom";
import Home from "./components/Home";
import About from "./components/About";
import Contact from "./components/Contact";
function App() {
return (
<>
@jatin510
jatin510 / StopWatch.tsx
Created November 3, 2022 02:09
React StopWatch
import { useEffect, useState } from 'react';
export default function StopWatch() {
const [counter, setCounter] = useState(0);
const [running, setRunning] = useState(true);
useEffect(() => {
if (running) {
const intervalId = setInterval(() => {
setCounter(counter + 1);