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 lxml | |
import requests | |
url = "https://www3.bcb.gov.br/sgspub/consultarvalores/consultarValoresSeries.do?method=consultarValores" | |
payload = { | |
"optSelecionaSerie": "7460", | |
"dataInicio": "31/01/1994", | |
"dataFim": "01/12/2021", | |
"selTipoArqDownload": "1", | |
"chkPaginar": "on", |
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
const FolderTree = ({folders}) => ( | |
<ul> | |
{folders.map(folder => ( | |
<Item key={folder.name} folder={folder} /> | |
))} | |
</ul> | |
); | |
const Item = ({folder}) => { | |
const [isOpen, setIsOpen] = useState(false); |
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
<li key={folder.name}> | |
{folder.name} | |
+ {folder.contents?.length && ( | |
+ <FolderTree folders={folder.contents} /> | |
+ )} | |
</li> |
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
const FolderTree = ({folders}) => ( | |
<ul> | |
{folders.map(folder => ( | |
<li key={folder.name}> | |
{folder.name} | |
</li> | |
))} | |
</ul> | |
); |
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
describe('FolderTree component', () => { | |
it('should allow select deeply nested folders', () => { | |
render(<FolderTree folders={sampleData} />); | |
openFolder('/home'); | |
openFolder('/home/michel'); | |
selectFolder('/home/michel'); | |
expect(folderIsSelected('/home/michel')).toBeTruthy(); | |
}); | |
}); |
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
<ul> | |
<li><button type="button">-</button> /home <button type="button">select</button> | |
<ul> | |
<li><button type="button">-</button> /home/michel <button type="button">select</button> | |
<ul> | |
<li><button type="button">+</button> /home/michel/Documents <button type="button" disabled="">selected</button></li> | |
<li><button type="button">+</button> /home/michel/Pictures <button type="button">select</button></li> | |
</ul> | |
</li> | |
</ul> |
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":"directory","name":"usr","contents":[ | |
{"type":"directory","name":"bin","mode":"0755","prot":"drwxr-xr-x","contents":[ | |
{"type":"link","name":"X11","target":".","mode":"0777","prot":"lrwxrwxrwx","contents":[]} | |
]}, | |
{"type":"directory","name":"games","mode":"0755","prot":"drwxr-xr-x","contents":[ | |
]}, | |
... | |
] |
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 python:alpine | |
RUN pip3 install Django |
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
const [global, useGlobal] = useGlobal(); | |
useGlobal.mockReturnValueOnce([mockedGlobal, mockedUseGlobal]); | |
const reducerFunc = useGlobal('someReducerFunc'); | |
useGlobal.mockReturnValueOnce(mockedReducerFunc); |
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
const [global, setGlobal] = useGlobal(); | |
useGlobal.mockReturnValueOnce([mockedGlobal, jest.fn()]); | |
const reducerFunc = useGlobal('someReducerFunc'); | |
useGlobal.mockReturnValueOnce(mockedReducerFunc); |
NewerOlder