- CRUD
- Authentication
- Authorization for Admin
- Create with file support
- Pagination
- Caching
- Logging
- WebSocket
- Race Condition handler
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
// Delete Stylesheet | |
const head = document.head; | |
const linkTags = head.getElementsByTagName('link'); | |
// Remove all <link> tags that have a 'stylesheet' type | |
for (let i = linkTags.length - 1; i >= 0; i--) { | |
const linkTag = linkTags[i]; | |
if (linkTag.getAttribute('rel') === 'stylesheet') { | |
head.removeChild(linkTag); | |
} |
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
// Open course on dicoding.com and paste this script on console. | |
document.getElementsByClassName("js-btn-next-tutorial")[0].click() |
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 useSWR from 'swr' | |
import axios from 'axios' | |
import React from 'react' | |
const index = ({ initialData }) => { | |
const { data } = useSWR('...some API path...', fetcher, { | |
initialData: initialData, | |
refreshInterval: 5000, | |
}) |
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 from 'react' | |
import useSWR from 'swr' | |
import { fetcher } from '../utils' | |
const index = () => { | |
const { data } = useSWR('... some API Fetch ...', fetcher) | |
return ( | |
<div> |
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 from 'react' | |
import axios from 'axios' | |
const index = ({ data }) => { | |
return ( | |
<div> | |
{data.map((item, index) => { | |
return ( | |
<div key={index}>{item.name}</div> | |
) |
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 from 'react' | |
import axios from 'axios' | |
const index = ({ data }) => { | |
return ( | |
<div> | |
{data.map((item, index) => { | |
return ( | |
<div key={index}>{item.name}</div> | |
) |
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, { useEffect, useState } from 'react' | |
import axios from 'axios' | |
const index = () => { | |
const [data, setData] = useState([]) | |
useEffect(async () => { | |
const response = await axios.get('...some API path...') | |
setData(response.data) |
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 videos = document.getElementsByTagName("VIDEO") | |
window.open(videos[0].src) |
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 Fonts = { | |
fontFamily: 'your fonts name', | |
fontSize: { | |
12: '12px', | |
14: '14px', | |
16: '16px', | |
20: '20px', | |
24: '24px', | |
32: '32px', | |
48: '48px', |
NewerOlder