This file contains hidden or 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
lsof -i TCP:<port> | |
kill -9 <port PID> |
This file contains hidden or 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
General - Structure of an interview (soft-skills) | |
1. Ask if we can record the interview | |
2. Explain interview process in terms of duration and structure (Introduction then we ask questions then he ask questions) | |
3. Introduction of the interviewer/company/tech team | |
4. Which one do you prefer and why: teamwork or working alone? | |
5. Do you like the responsibility of decision-making or would you prefer to leave it to someone else? |
This file contains hidden or 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
const sampleOptions = [ | |
{ id: 'option-type', value: '3' }, | |
{ id: 'option-type', value: '100336' }, | |
{ id: 'option-type', value: '100354' }, | |
{ id: 'option-type', value: '3' }, | |
{ id: 'option-type', value: '109538' }, | |
{ id: 'option-type', value: '3' }, | |
{ id: 'option-type', value: '8303' }, | |
{ id: 'option-type', value: '504' }, | |
{ id: 'option-type', value: '503' }, |
This file contains hidden or 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
function draggableElement({ elementId }) { | |
const element = document.getElementById(elementId); | |
const positions = { | |
pos1: 0, | |
pos2: 0, | |
pos3: 0, | |
pos4: 0, | |
}; | |
element.onmousedown = mouseDown; |
This file contains hidden or 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, useRef, useState } from 'react'; | |
function useComponentVisible(initialIsVisible) { | |
const [isComponentVisible, setIsComponentVisible] = useState( | |
initialIsVisible | |
); | |
const ref = useRef(null); | |
const handleHideDropdown = (event) => { | |
if (event.key === 'Escape') { |
This file contains hidden or 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
const validateEmail = (email) => { | |
if (!email) return false; | |
return /^[\w\-.]+@([\w-]+\.)+[\w-]{2,}$/.test(email); | |
}; |
This file contains hidden or 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
// Tabs.jsx | |
import PropTypes from 'prop-types'; | |
import { useState } from 'react'; | |
import styles from './Tabs.module.css'; | |
export const Tabs = ({ tabHeaders, children, defaultTab }) => { | |
const [currentTab, setCurrentTab] = useState(defaultTab.toLowerCase()); | |
const handleTabSelect = (tabHeader) => { | |
setCurrentTab(tabHeader.toLowerCase()); |
This file contains hidden or 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
const uploadFile = ({ | |
event, | |
onComplete | |
}: { | |
event: ChangeEvent<HTMLInputElement>; | |
onComplete: (file: File, base64File: string) => void; | |
}) => { | |
event.preventDefault(); | |
let base64File: string; |
This file contains hidden or 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
const formatCount = (x) => x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ','); |
This file contains hidden or 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
function retry(fn, retries = 2, err = null) { | |
console.log("Retries: ", retries); | |
if (!retries) { | |
console.log("Done Retrying..."); | |
return Promise.reject(err); | |
} | |
return fn().catch((err) => { | |
console.log("Retrying..."); | |
return retry(fn, retries - 1, err.response); |