This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"net/http" | |
"sync" | |
"time" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
export default function LazyLoadedComponent() { | |
return <h2>Lazy loaded component</h2>; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ( | |
<> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |