function useDebounce(state, timeout){
const [current, setState] = useState(state)
useEffect(() => {
const run = setTimeout(() => {
setState(state)
}, timeout)
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
#ifndef __BOARD_TOFU_H__ | |
#define __BOARD_TOFU_H__ | |
#define TOFU_BUTTON1_PIN 33 | |
#define TOFU_BUTTON2_PIN 25 | |
#define TOFU_BUTTON3_PIN 32 | |
#define TOFU_NOTIFICATION_PIN 4 | |
#define TOFU_STEPUP_PIN 14 |
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 { HamburgerIcon } from "@chakra-ui/icons" | |
import { | |
Box, | |
Button, | |
Flex, | |
HStack, | |
IconButton, | |
Image, | |
useDisclosure, | |
VStack, |
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 { useState } from "react" | |
export function useObject<T>(data: T) { | |
const [obj, setObj] = useState(data) | |
const updateObj = (state: Partial<T>) => | |
setObj((last) => ({ ...last, ...state })) | |
return [obj, updateObj] as [T, (state: Partial<T>) => void] | |
} |
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
{ | |
"Create Next Api": { | |
"prefix": "nextapi", | |
"body": [ | |
"import { NextApiRequest, NextApiResponse } from \"next\"", | |
"export default async (req: NextApiRequest, res: NextApiResponse) => {", | |
" try {", | |
" switch (req.method) {", | |
" default:", | |
" throw new Error()", |
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
console.log( | |
"%cSistem ini dibuat oleh:\n\n %c %c Muhammad Wafa \n", | |
"font-size: 16px", | |
"font-size:20px;padding:10px; background:url(https://github.com/mwafa.png) no-repeat;background-size: 40px 40px;", | |
"font-size: 20px; vertical-align:middle; font-weight:bold", | |
"\nGithub >> https://github.com/mwafa\n", | |
"\nLinkedin >>\n\n https://www.linkedin.com/in/muhammad-wafa-587440126/\n\n" | |
) |
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
Server spec: | |
- RAM: 1024 MB | |
- CPU: 2 core | |
- Storage: 30 GB | |
Software Version: | |
Docker: version 18.09.7, build 2d0083d | |
Container: | |
- MYSQL: 5.7 | |
- Redis: latest |
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
#include <SoftwareSerial.h> | |
#include <EEPROM.h> | |
#include <GravityTDS.h> | |
#include "DHT.h" | |
#define DHTPIN 2 | |
#define DHTTYPE DHT22 | |
#define pinTrig 3 | |
#define pinEcho 4 |
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
@font-face { | |
font-family: octicons-link; | |
src: url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAZwABAAAAAACFQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEU0lHAAAGaAAAAAgAAAAIAAAAAUdTVUIAAAZcAAAACgAAAAoAAQAAT1MvMgAAAyQAAABJAAAAYFYEU3RjbWFwAAADcAAAAEUAAACAAJThvmN2dCAAAATkAAAABAAAAAQAAAAAZnBnbQAAA7gAAACyAAABCUM+8IhnYXNwAAAGTAAAABAAAAAQABoAI2dseWYAAAFsAAABPAAAAZwcEq9taGVhZAAAAsgAAAA0AAAANgh4a91oaGVhAAADCAAAABoAAAAkCA8DRGhtdHgAAAL8AAAADAAAAAwGAACfbG9jYQAAAsAAAAAIAAAACABiATBtYXhwAAACqAAAABgAAAAgAA8ASm5hbWUAAAToAAABQgAAAlXu73sOcG9zdAAABiwAAAAeAAAAME3QpOBwcmVwAAAEbAAAAHYAAAB/aFGpk3jaTY6xa8JAGMW/O62BDi0tJLYQincXEypYIiGJjSgHniQ6umTsUEyLm5BV6NDBP8Tpts6F0v+k/0an2i+itHDw3v2+9+DBKTzsJNnWJNTgHEy4BgG3EMI9DCEDOGEXzDADU5hBKMIgNPZqoD3SilVaXZCER3/I7AtxEJLtzzuZfI+VVkprxTlXShWKb3TBecG11rwoNlmmn1P2WYcJczl32etSpKnziC7lQyWe1smVPy/Lt7Kc+0vWY/gAgIIEqAN9we0pwKXreiMasxvabDQMM4riO+qxM2ogwDGOZTXxwxDiycQIcoYFBLj5K3EIaSctAq2kTYiw+ymhce7vwM9jSqO8JyVd5RH9gyTt2+J/yUmYlIR0s04n6+7Vm1ozezUeLEaUjhaDSuXHwVRgvLJn1tQ7xiuVv/ocTRF42mNgZGBgYGbwZOBiAAFGJBIMAA |