I was watching a series and had to shift my subtitles by 38 seconds every time I open a video. After a few times of pain, I ended up writing a script to cut the crap, have some fun, and get a bit into NodeJS file I/O! 😀
Continue readingAuthor Archives: lucia
React: How To Prompt User of Unsaved Data before Leaving Site
There’s a specific function for this: beforeunload
.
Yarn Upgrade All Dependencies to Latest
For reference:
yarn upgrade-interactive --latest
And use a
key to select all of them.
Bound Data Doesn’t Update when Dynamically Updating D3
One big gotcha: select
actually has side effects. It updates the bound data.
Fix: Some FontAwesome Unicodes Show Up as Squares
If some of the unicodes work, but not others:
Continue readingMongoose Unique Not Working?!
Say we want the email
field on our User
model to be unique, so we set the Schema to be:
const UserSchema = new Schema({
email: {type: String, required: true, unique: true}
});
Somehow, it just doesn’t work. As it turns out, there are plenty of reasons why this wouldn’t work. Let’s see which one got you.
Continue readingHow to Auto-Deploy to Server on Git Push
Goal:
- If
git push
onmaster
branch - Then sync files onto server and deploy (e.g., running
yarn run build
or any other scripts)
I’m on DigitalOcean’s server, but this works on any self hosted servers.
Continue readingMac: How to Find Out Which App Is Blocking a Hotkey
If some hotkey doesn’t work for you, it’s likely that it got blocked by some other app in the background.
Continue reading