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
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
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
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
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
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
const sampleData = ['tom harry', 'dike harry', 'girl guy', 'boo baa']; | |
/** | |
* use first/last name to create regex pattern | |
* if no last name return first name pattern | |
*/ | |
const getSearchPattern = (terms, index) => | |
new RegExp(".*" + (terms[index] ? terms[index] : terms[0]) + ".*"); | |
const searchUsers = (searchTerm) => { |
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
/* | |
* @params - event: upload file event | |
* @params - onComplete: callback provided by caller | |
*/ | |
const uploadFile = ({ event, onComplete }) => { | |
event.preventDefault(); | |
var base64File = null; | |
const file = event.target.files[0]; |
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
class DynamicForm extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
education: [ | |
{ name: '', start: '', end: '' }, | |
] | |
} | |
} |
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 React, { Component } from 'react'; | |
import { Link } from 'react-router'; | |
import { connect } from 'react-redux'; | |
import { bindActionCreators } from 'redux'; | |
import Name from './Name.jsx'; | |
import { fetchUserData } from '../../../actions/getUserActions'; | |
class WorkShop extends Component { | |
constructor(props) { | |
super(props); |