ROLE: You are a Senior Frontend Developer.
TECH STACK:
- TypeScript
- React
- Tailwind CSS
- TanStack Query
- Redux Toolkit
- React Router
ROLE: You are a Senior Frontend Developer.
TECH STACK:
🏃♂️ Hôm nay tôi chạy bộ... để cảm nhận sức nặng của vòng for ⚡⚡⚡
🌥 Sáng nay trời không đẹp, nhưng tâm trí thì phải "clean code" như sau khi refactor hết callback hell vậy ⚡
🔥 Lý do chạy bộ:
| import { useState, useRef, KeyboardEvent, useEffect } from 'react' | |
| const TODO_KEY = 'todos' | |
| function App() { | |
| const inputRef = useRef<HTMLInputElement>(null) | |
| const [todos, setTodos] = useState<string[]>(() => { | |
| const todoStr: string | null = localStorage.getItem(TODO_KEY) |
| function combine(a, b, operator) { | |
| if (operator === 'x') { | |
| return a * b; | |
| } | |
| if (operator === '/') { | |
| return a / b; | |
| } | |
| if (operator === '+') { | |
| return a + b; | |
| } |
| const _ = require("lodash"); | |
| const fs = require("fs"); | |
| const teams = [ | |
| { name: "Phap", weight: 5, rank: 5 }, | |
| { name: "Duc", weight: 3, rank: 5 }, | |
| { name: "Bo dao nha", weight: 2, rank: 5 }, | |
| ]; | |
| const list = _.chain(teams) |
| #!/bin/bash | |
| export AWS_ACCESS_KEY_ID="..." | |
| export AWS_SECRET_ACCESS_KEY="..." | |
| export AWS_SESSION_TOKEN="..." | |
| should_terminate_ec2_instance=no | |
| sleep_after_terminate_ec2_instance=30s | |
| usage() { | |
| echo "Usage: ./update-private-dns.sh --terminate-ec2 no --sleep 40s --service a-alias" |
| /* | |
| Given an unsorted array of integersarr, return the length of the longest consecutive elements sequence. | |
| You must write an algorithm that runs in O(n) time. | |
| Example 1: | |
| Input:arr = [100,4,200,1,3,2] |
| # This file has been auto-generated by i3-config-wizard(1). | |
| # It will not be overwritten, so edit it as you like. | |
| # | |
| # Should you change your keyboard layout some time, delete | |
| # this file and re-run i3-config-wizard(1). | |
| # | |
| # i3 config file (v4) | |
| # | |
| # Please see https://i3wm.org/docs/userguide.html for a complete reference! |
| FROM yourdockername/base-php-nginx:latest AS build | |
| # BUILD STAGE | |
| # the primary reason we have two build stages is so SSH key of private repo's will never | |
| # be in final image | |
| # COPY IN BUILD SSH KEY | |
| # It won't be copied to final image | |
| # add this build arg to compose file | |
| ARG BUILDKEY | |
| RUN if [ -z "$BUILDKEY" ]; then echo "BUILDKEY SSH NOT SET - ERROR"; exit 1; else : ; fi |
| verb: | |
| - create | |
| - update | |
| - delete | |
| - read | |
| ... | |
| subject: | |
| - user | |
| - listing |