I've been trying out @stripe's Treasury feature and ordered a card for business expenses. It arrived today and I didn't expect it to be metal 👀 The UK card design seems different from the US version.
TIL: A UX tip for better managing UI states across tabs or frames.
@nextauthjs uses `BroadcastChannel` to synchronize the authentication state across them.
Besides the UX tip, `BroadcastChannel`'s polyfill can be implemented by leveraging `localStorage` and `storage` event.
next-auth v4's `BroadcastChannel` implementation:
github.com/nextauthjs/next-a…
haha... it's time to change the background! raw.githubusercontent.com/cl….
Wei-Chieh Hsia retweeted
After 48 hours of hard work, thanks to @paradigm_ctf for hosting such an amazing CTF challenge. Time to ramp up my cryptography knowledge this year!
Goal for next year: Top 10 !!!
SHOUT OUT TO my incredible teammates, @paco0x and @twxia!
TIL: when using zsh, put the below setting into the `~/.zshrc`.
```
setopt HIST_IGNORE_SPACE
```
By using a leading space, you can bypass zsh to record the sensitive data in `~/.zsh_history`
TIL: Discord removed localStorage property from window in 2018 for preventing social engineering attack to steal user’s jwt token. Pretty cool way. However, localStorage still retrievable by using a tricky technique. stackoverflow.com/questions/…
This is another level of analogy. Didn't expect that my rusty electrical engineering knowledge is useful at this moment.🤯
This quoted post is unavailable.
TIL: I can use #yubikey as my TOTP (Google Authenticator) backup plan. Secrets can be stored inside my #yubikey (at most 32 codes). Don't need a backup code or store code at @Authy. Once I broke my phone, I could still get them from my🔑 (how it works? developers.yubico.com/OATH/)
Wei-Chieh Hsia retweeted
Here's my favorite git feature that no one knows about:
You can reference commits using the commit message instead of the hash. The ":/" syntax accepts a regex that matches any part of the commit message, returning the youngest matching commit.
git-scm.com/docs/revisions/2…
Wei-Chieh Hsia retweeted
Tip: You can name capture groups for Regular Expressions in JavaScript. Define a named capture in angle brackets <> and they get returned under .groups.
![This feature is about identifying capture groups via names. // Without named capture groups const re = /(\d{4})-(\d{2})-(\d{2})/; const match = re.exec('2021-03-04'); console.log(match[1]); // → 2021 (year) console.log(match[2]); // → 03 (month) console.log(match[3]); // → 04 (day) // With named capture groups 🔥 const re = /(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})/; const match = re.exec('2021-03-04'); console.log(match.groups.year); // → 2021 console.log(match.groups.month); // → 03 console.log(match.groups.day); // → 04 // ... and with destructuring assignment 🔥🔥🔥 const [match, year, month, day] = re.exec('2021-03-04');](https://pbs.twimg.com/media/EzwqDp7VgAAQQnZ.jpg?name=small&format=webp)
ALT This feature is about identifying capture groups via names. // Without named capture groups const re = /(\d{4})-(\d{2})-(\d{2})/; const match = re.exec('2021-03-04'); console.log(match[1]); // → 2021 (year) console.log(match[2]); // → 03 (month) console.log(match[3]); // → 04 (day) // With named capture groups 🔥 const re = /(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})/; const match = re.exec('2021-03-04'); console.log(match.groups.year); // → 2021 console.log(match.groups.month); // → 03 console.log(match.groups.day); // → 04 // ... and with destructuring assignment 🔥🔥🔥 const [match, year, month, day] = re.exec('2021-03-04');
Wei-Chieh Hsia retweeted
New post 🆕 Record tests with the puppeteer recorder built right into DevTools (experimental)
umaar.com/dev-tips/241-puppe…
Helpful for scaffolding out code which would otherwise be tedious to write.
Wei-Chieh Hsia retweeted
PRO TIP: Check the vault's funds before the withdrawal. If the amount withdrawn is less than the vault's idle funds, there's no 0.5% fee.
The 0.5% fee logic is inside the strategy.
👇vault's code
r = the amount withdrawn by you
b = vault's total amount
(not the yvault's token)
Wei-Chieh Hsia retweeted
Turns out Discords image upload algorithm identifies floppy gun man as a naked human and wont upload on regular channels till I add a black bar.
🤠Floppy gun man will not be censored🤠
Insane!!! This chrome extension displays the live lyrics from Spotify by using Picture-in-Picture API !!! The experience is awesome 🤩 chrome.google.com/webstore/d…
javascript indirect/direct eval call: perfectionkills.com/global-e…















