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
// SITE - https://angel.co | |
const scroll = () => { | |
const scrollingElement = document.scrollingElement || document.body; | |
scrollingElement.scrollTop = scrollingElement.scrollHeight; | |
}; | |
const sleep = (time = 2) => | |
new Promise((resolve) => setTimeout(resolve, time * 1000)); |
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
// SITE - https://remote.co/ | |
const sleep = () => new Promise((resolve) => setTimeout(resolve, 2 * 1000)); | |
const getCompanyInfo = (elem) => { | |
const [openings, companyName] = elem.innerText.split('\n'); | |
const link = elem.querySelector('a').getAttribute('href') | |
return { | |
companyName, | |
openings, |
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
// SITE - https://www.workatastartup.com | |
const scroll = () => { | |
const scrollingElement = document.scrollingElement || document.body; | |
scrollingElement.scrollTop = scrollingElement.scrollHeight; | |
}; | |
const sleep = () => new Promise((resolve) => setTimeout(resolve, 2 * 1000)); | |
const getOpenings = (elem) => [...elem.querySelectorAll('.jobs-list>.job>.job-line>.job-details')] |
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
syntax on | |
colorscheme monokai | |
set tabstop=8 softtabstop=0 expandtab shiftwidth=4 smarttab | |
set autoindent | |
set number | |
autocmd BufNewFile * startinsert |
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
FROM node:latest | |
RUN apt-get update && apt-get install vim -y | |
RUN mkdir -p ~/.vim/colors && \ | |
git clone https://github.com/crusoexia/vim-monokai.git && \ | |
cp vim-monokai/colors/monokai.vim ~/.vim/colors/ && \ | |
rm -rf vim-monokai | |
RUN git clone https://gist.github.com/11aecdb37904750ca469f34b97239d6f.git vimrc-config && \ |
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
[@react.component] | |
let make = (~name) => { | |
// the whole body of this method comes under render lifecycle. | |
name -> React.string; | |
}; |
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
type state = { counter: int }; | |
// Assign intial state in constructor method | |
let initialState = () => { counter: 0 }; | |
[@react.component] | |
let make = () => { | |
let (state, setState) => React.useState(initialState); | |
"initial state is set using hooks" -> React.string; |
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
[@react.component] | |
let make = (~name, ~) => { | |
let (counter, setCounter) => React.useState(() => 0); | |
// This will allow the change of the state/props only if certain props are passed or changed to. | |
React.useEffect1( | |
() => { | |
if (name === "componentDidUpdate") { | |
setCounter(_ => counter + 1); | |
None |
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
[@react.component] | |
let make = () => { | |
let (counter, setCounter) = React.useState(() => 0); | |
React.useEffect(() => { | |
let clearTimeout = Js.Global.setTimeout(() => setCounter(_ => counter + 1), 500); | |
Some(Js.Global.clearTimeout(clearTimeout)) // This will be called when the component will be un-mounted | |
}); | |
("Counter is updated " ++ counter -> string_of_int ++ " times.") -> React.string; |
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
[@react.component] | |
let make = (~name: string) => { | |
let (counter, setCounter) = React.useState(() => 0); | |
// Enter any thing you want to enter in componentDidMount. | |
React.useEffect1( | |
() => { | |
setCounter(_ => counter + 1); | |
None | |
}, |
NewerOlder