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
| for i in $(find . -name '*.py'); do python-modernize -wn -f default "$i"; done |
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
| docker volume prune | |
| docker stop $(docker ps -a -q) | |
| docker rm $(docker ps -a -q) | |
| docker rm $(docker ps -q -f 'status=exited') | |
| docker rmi $(docker images -q -f "dangling=true") |
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
| it('should render with the correct text with sync act', () => { | |
| act(() => { | |
| ReactDOM.render(<AsyncApp/>, el); | |
| }); | |
| expect(el.innerHTML).toContain('unloaded val'); | |
| }); | |
| it('should render with the correct text with async act', async () => { | |
| await act(async () => { | |
| ReactDOM.render(<AsyncApp/>, el); |
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
| export const AsyncApp = () => { | |
| const [data, setData] = useState('unloaded value'); | |
| const [clickCount, setCount] = useState(0); | |
| const simulatedFetch = async () => { | |
| const fetchedValue = await Promise.resolve('fetched value'); | |
| await new Promise(res => { | |
| setData(fetchedValue); | |
| res(); | |
| }); | |
| }; |
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
| it('should render with the correct text without act', () => { | |
| ReactDOM.render(<App/>, el); | |
| expect(el.innerHTML).toContain('unloaded val'); | |
| }); | |
| it('should render with the correct text with act', () => { | |
| act(() => { | |
| ReactDOM.render(<App/>, el); | |
| }); | |
| expect(el.innerHTML).toContain('sync val'); |
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
| export const App = () => { | |
| const [data, setData] = useState('unloaded value'); | |
| useEffect(() => { | |
| setData('sync val'); | |
| }, []); | |
| return ( | |
| <div> | |
| <h2>{data}</h2> |
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
| # Hacky MMR to TCX bulk -> get these from MMR CSV, run in terminal while loged in | |
| listOfWork=" | |
| https://www.mapmyrun.com/workout/export/<id1>/tcx | |
| https://www.mapmyrun.com/workout/export/<id2>/tcx | |
| https://www.mapmyrun.com/workout/export/<id3>/tcx | |
| " | |
| for workout in "$listOfWork" | |
| do | |
| echo "$workout" |
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 getUserProfile = id => lookupProfile(id); |
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 getUserProfile = (id: number): Promise<UserProfile> => lookupProfile(id); |
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
| // The Result type we expect back. | |
| // See https://developer.github.com/v3/repos/#get | |
| interface Result { | |
| repo: { | |
| id: number; | |
| name: string; | |
| description: string; | |
| html_url: string; | |
| }; | |
| } |
NewerOlder