😠 querySelector나 getElementbyClassName으로 엘리먼트 찾으면 array 같지만 아닌 다른 저장 포맷으로 저장된다
array-like object를 array로 바꿔준다.
1 2 3 4 5 6 7 8 9 10 11
const buttons = document.getElementsByClassName("btn"); console.log(buttons); // buttons는 Array가 아니기 때문에 // 아래와 같이 forEach를 사용할 수 없다. buttons.forEach((button) => { button.addEventListener("click", () =>console.log("I ve been clickeds")); }); ---------------- Array.from(buttons).forEach((button) => { button.addEventListener("click", () =>console.log("I ve been clickeds")); });
const target1 = friends.find((friend) => friend.includes("@yahoo.com")); // 조건을 넣어주면 forEach를 돌리면서 그에 맞는 값을 리턴해준다 // 찾은 첫번째 값만 반환해준다 // 없으면 undefined반환한다 console.log(target1);
==> /** * 변수 */ constsayHi = (aName = "anon") => { return`Hello ${aName}`; } /** * 함수 */ constadd = (a, b) => a + b; console.log(`hello how are you ${add(6, 6)}`);
# dns cloudflare sudo snap set certbot trust-plugin-with-root=ok sudo snap install certbot-dns-cloudflare
cloudflare api token 넣기
1 2 3 4 5 6
mkdir -p ~/.secrets/certbot vi ~/.secrets/certbot/cloudflare.ini ---------------------------------- # Cloudflare API token used by Certbot dns_cloudflare_api_token = IdgrE2pGEQxdq43kQPJ8***************** chmod 600 ~/.secrets/certbot/cloudflare.ini
----------------- ubuntu@dev-project-app:~$ sudo certbot certonly --dns-cloudflare \\ > --dns-cloudflare-credentials ~/.secrets/certbot/cloudflare.ini \\ > -d *.4084.live Saving debug log to /var/log/letsencrypt/letsencrypt.log Enter email address (used for urgent renewal and security notices) (Enter 'c' to cancel): [email protected]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Please read the Terms of Service at <https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf>. You must agree in order to register with the ACME server. Do you agree? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (Y)es/(N)o: Y
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Would you be willing, once your first certificate is successfully issued, to share your email address with the Electronic Frontier Foundation, a founding partner of the Let's Encrypt project and the non-profit organization that develops Certbot? We'd like to send you email about our work encrypting the web, EFF news, campaigns, and ways to support digital freedom. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (Y)es/(N)o: Y Account registered. Requesting a certificate for *.4084.live Waiting 10 seconds for DNS changes to propagate
Successfully received certificate. Certificate is saved at: /etc/letsencrypt/live/4084.live/fullchain.pem Key is saved at: /etc/letsencrypt/live/4084.live/privkey.pem This certificate expires on 2022-02-26. These files will be updated when the certificate renews. Certbot has set up a scheduled task to automatically renew this certificate in the background.