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 CardSerializer(serializers.ModelSerializer): | |
| title = serializers.CharField() | |
| song = SongSerializer(read_only=True) | |
| thumbnail = HyperlinkedSorlImageField( | |
| '300x300', | |
| options={"crop": "center"}, | |
| source='image', | |
| read_only=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
| class WorkViewSet(viewsets.ModelViewSet): | |
| queryset = Work.objects.all() | |
| serializer_class = WorkSerializer | |
| def get_queryset(self): | |
| queryset = Work.objects.order_by('-pinned', '-year') | |
| return queryset |
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
| git rm -r --cached . && git add . && git commit -am 'git cache cleared' && git push origin master |
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
| 504b 0304 1400 0800 0800 eb83 5456 0000 | |
| 0000 0000 0000 0000 0000 3200 1000 646a | |
| 7072 6f6a 205b 4531 3735 3638 3233 2d38 | |
| 3934 382d 3438 4136 2d42 3738 392d 3235 | |
| 4230 3641 4236 3842 4244 5d2e 6a73 6f6e | |
| 5558 0c00 5aa0 f363 5aa0 f363 f601 1400 | |
| abe6 5250 504a cc49 2b4a 4d29 cecb 2c28 | |
| 482d 5152 b052 a806 8a02 c591 4494 52b2 | |
| 12f3 d2f3 7513 5372 33f3 148a 4b12 8b4a | |
| 0a8a f2b3 5293 4b14 60b4 9e92 0e44 5b69 |
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, { useState } from 'react'; | |
| import MyComponent from './MyComponent'; | |
| function MyButton() { | |
| const [showComponent, setShowComponent] = useState(false); | |
| const handleClick = () => { | |
| setShowComponent(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
| const [profileObject, setProfileObject] = useState({ | |
| name: "", | |
| slug: "", | |
| profile_image: "", | |
| }); |
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
| <iframe height="500px" src="https://sc-embed.vercel.app/af5dc561-2fcb-499b-b168-6aa8e12f6dd2" title="Songcard"></iframe> |
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
| styles = { | |
| margin: "auto", | |
| maxWidth: "600px", | |
| padding: "20px", | |
| }; |
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
| <iframe height="500px" src="https://sc-embed.vercel.app/3223555a-904b-46c4-abfa-a529589b4b56" title="Songcard"></iframe> |
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 getServerSideProps = (async (context) => { | |
| const id = context.query.id; | |
| const res = await fetch(`https://api.../posts/${id}/`, { | |
| ... | |
| }); | |
| context.res.setHeader( | |
| "Cache-Control", | |
| "public, s-maxage=604800, stale-while-revalidate=59" |
OlderNewer