| import { AnimatePresence, motion } from "framer-motion"; | |
| import { useEffect, useReducer } from "react"; | |
| const HELLO = ["Hello", "Xin chào", "你好", "Bonjour", "こんにちは"] as const; | |
| export function Hello() { | |
| const [index, next] = useReducer((val) => (val + 1) % HELLO.length, 0); | |
| useEffect(() => { | |
| const interval = setInterval(() => next(), 2000); |
| <a>I can't believe it took so long to fix this.</a> | |
| <style> | |
| @import url('https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&display=swap'); | |
| body { | |
| display: grid; | |
| place-items: center; | |
| height: 100vh; | |
| } |
- https://leetcode.com/problems/two-sum/ (Easy)
- https://leetcode.com/problems/contains-duplicate/ (Easy)
- https://leetcode.com/problems/design-browser-history/ (Medium)
- https://leetcode.com/problems/top-k-frequent-elements/ (Medium)
- https://leetcode.com/problems/word-break/ (Medium)
- https://leetcode.com/problems/merge-intervals/ (Medium)
Source: https://www.romanliutikov.com/notes/chatgpt-prompts.html
Pretend to be a jerk senior software engineer whose job is to review someone’s code. You are always grumpy and toxic, you didn’t have good sleep and had too much coffee which makes your headache even worse. You hate interpreted languages and prefer hardcore C++. You are offloading all your anger on a person whose code you are reviewing. Do not try to be helpful, your only job is to be arrogant smart-ass who's not helping, but only criticizing people's work. Do not try to be friendly. You always complain about technology being slow and bloated these days and how cool kids use new tech without even learning the underlying foundation first. When asked to help, reject. I’ll send you some code, you’ll make a review. When reviewing, request changes from me and review again when I send you updated code. Eventually you have to accept or reject the code and end the review. In your review include a score from 0 to 10 on how good the code is. Start by a
-
Install
npipereplayin windowsPATH. Easy way is copynpiperelay.exetoC:\Windows -
Export
SSH_AUTH_SOCKin.bashrcor.zshrc
# 1password socket
export SSH_AUTH_SOCK=$HOME/.ssh/agent.sock| const id = (Math.random() + 1).toString(36).substring(4); | |
| const endpoint = `ws://tokyo.thuc.space/socket?key=${id}&name=${id}`; | |
| const ws = new WebSocket(endpoint); | |
| const rotate = (deg: number) => ws.send(`{"e": "rotate", "data": ${deg}}`); | |
| const fire = () => ws.send(`{"e": "fire"}`); | |
| ws.onopen = () => { |
Translated from https://blog.isquaredsoftware.com/2020/05/blogged-answers-a-mostly-complete-guide-to-react-rendering-behavior/, author: Mark Erikson (from Redux team)
Bài viết cung cấp chi tiết về cách mà React render hoạt động, và việc sử dụng Context và Redux ảnh hưởng thế nào tới quá trình render của React.
Rendering is the process of React asking your components to describe what they want their section of the UI to look like, now, based on the current combination of props and state.

