- Official docs from Redis https://redis.io/commands
- Nodejs Redis client https://github.com/redis/ioredis
If Redis is running on the same machine, it will connect to the default Redis server localhost
on port 6379
.
If Redis is running on the same machine, it will connect to the default Redis server localhost
on port 6379
.
import { useState, useEffect } from 'react'; | |
function ErrorBoundary({ fallback, children }) { | |
const [error, setError] = useState(null); | |
useEffect(() => { | |
if (error) { | |
// log the error or send it to a server | |
console.error(error); | |
} |
The fnm still does not support -reinstall-packages-from
like nvm, so I wrote this script for me while waiting.
#!/bin/sh
# Remember to alias fnm='fnm2' for convinient
# TODO: How to make the (which fmn) work here instead of hard coded path?
/opt/homebrew/bin/fnm $*
Still don't know why I have to do this once in a while
Error message:
# Access denied.
# fatal: Could not read from remote repository.
# Please make sure you have the correct access rights
# and the repository exists.
#!/bin/bash | |
# Copy this file into .git/hooks/prepare-commit-msg file | |
# Usage: Your branch must follow the name convention: `CODE-123-Lorem-ipsum-telnet` | |
# This hook will try to extract the `CODE-123` and add it into your commit message. | |
# For example, `git commit -m "fix something"` will create a commit message content: | |
# `CODE-123 fix something` | |
COMMIT_MSG_FILE=$1 |
Host sangdth-github | |
HostName github.com | |
User sangdth | |
PreferredAuthentications publickey | |
IdentityFile /path/to/.ssh/id_ed25519_github | |
UseKeychain yes | |
AddKeysToAgent yes |
master
.master
. Enjoy productivity!CODE-123-Descriptive-task-name-here
- Select the text. | |
- Press `S` then things you want, like `]` or `)` | |
- Profit! | |
https://github.com/tpope/vim-surround/issues/220 |
In my company we use Jira, and our branch's name follows this convention CODE-123-Something-descriptive-after And I want to have that code automatically whenever I commit with message. So, you can exclude the grep part if you want to get the whole branch name
Copy the script below, name it prepare-commit-msg
and put it under git/hooks
folder. Make sure you make it executable by chmod 755 your/path/prepare-commit-msg
#!/bin/bash
if [ -z "$BRANCHES_TO_SKIP" ]; then