How to Sync Your Telegram Channel with HappyNotes

Happy Notes app recentlys supports to sync new notes to your specified telegram channel based on the rules you set. If you want to enjoy seamless note synchronization between your Telegram channel and the HappyNotes app, follow these easy steps:

Step 0: Find and Add @getidsbot

  • Open Telegram and search for @getidsbot.
  • Start a chat with the bot by clicking on "Start."

Step 1: Create Your Telegram Bot

  • Search for @BotFather in Telegram and start a conversation.
  • Use the /newbot command to create a new bot.
  • Follow the prompts to give your bot a name and username.
  • Note: The bot's username must end with "bot" (e.g., MySyncBot).

Step 2: Get Your Telegram Bot Token

  • After creating the bot, @BotFather will provide you with a token. This token is essential for integrating your bot with other services, so keep it safe.

Step 3: Add Your Bot to Your Telegram Channel as an Admin

Convenient Method:

  1. Open the conversation with your newly created bot in Telegram.
  2. Tap on the bot's icon in the top right corner.
  3. Click on "Add to Group or Channel".
  4. Select the channel you want to add the bot to, and it will automatically be added as an admin with the necessary permissions.

Alternative Method:

  1. Go to your Telegram channel's settings.
  2. Select "Administrators" and manually add your newly created bot as an admin.
  3. Ensure the bot has the necessary permissions to send and manage messages.

Step 4: Manually Write the First Message to the Channel

  • Send a message to your channel as you usually would. This message is necessary to identify the channel ID later.

Step 5: Forward the Message to @getidsbot

  • Forward the message you just sent to @getidsbot.
  • The bot will reply with the channel ID. Keep this ID safe; you’ll need it for the next step.

Step 6: Configure Telegram Sync in HappyNotes

Step 7: Test the Setting

  • Use the "Test" option in HappyNotes to send a test message to your Telegram channel.
  • Ensure the message is successfully sent, confirming the integration is working.

Step 8: Enjoy Syncing Your Notes with Telegram!

  • With everything set up, your notes will now sync with your Telegram channel automatically.
  • You can now easily access your notes from within Telegram, making your workflow even smoother.

Google Chrome认为的我最经常访问的网站

通过在地址栏输入依次输入 A ~ Z, 根据其自动完成的情况,可以约略推断一个人最经常访问的网站有哪些。网友椒盐豆豉在她的最新博文浏览器自动补全 A to Z 看上网习惯分享了她最经常使用的网站,沟起了我的兴趣。于是我在这里列出了我的。

A: https://app.hibob.com 现司用来请年假病假设置年度目标的平台
B: https://blog.shukebeta.com 我的博客
C: https://claude.ai 明明chatgpt用得更多,但我都是从收藏夹里进,所以...
D: 现司的CI/CD网站
E: 现司的wiki (euronet打头)
F: https://flomoapp.com
G: https://github.com
H: https://happynotes.shukebeta.com 我正在开发的笔记app,支持同步到 telegram 频道
I: https://inoreader.com 我最常使用的rss阅读器
J: 前司一个内网网站
K: 现司 elk logs (kc-logs.oneeuronet.com)
L: localhost:3000 (最近的一个ts side project)
M: https://mail.google.com
N: n/a
O: https://openai.com 我开通了它家的API
P: https://poe.com 另一个免费AI集散地
Q: n/a
R: https://racknerd.com (我用的一个vps提供商)
S: https://shukebeta.github.io (居然不是我的 https://shukebeta.com ) T: https://twitter.com
U: n/a
V: n/a
W: https://web.telegram.org
X: https://xnw.com 校内外,前前前司的主产品网站,也是我的作品之一
Y: https://youtube.com
Z: https://zed.dev

你的会是哪些? 何不现在就试试?

What did I do yesterday? This Script Can Help

As a programmer, I often get so focused on solving problems that I forget to prepare for standups. The daily meeting doesn't allow extra time for preparation. If you struggle to remember what you did yesterday, like I did, this short worklog script can help.

The Worklog Script

Save the following script as worklog and put it into your ~/bin or any other bin directory in your PATH environment variable. Don't forget to make it executable with chmod +x worklog.

#!/usr/bin/bash

days=1
if [ "$1" != "" ]; then
  days=$1
fi

echo
echo -n "On project $(git remote -v | head -n1 | awk '{print $2}' | sed -e 's,.*:\(.*/\)\?,,' -e 's/\.git$//')"
echo
echo
git --no-pager log --no-merges --pretty=tformat:"- %ad | %s%C(auto)%d [%h]" --date=short --reverse --all --since=${days}.days.ago --author="$(git config user.name)" 2>&1
echo

How It Works

  1. Default Days Setting:

    days=1
    if [ "$1" != "" ]; then
      days=$1
    fi
    

    This part sets the default number of days to 1. If you provide a different number as an argument when running the script, it updates the days variable accordingly.

  2. Fetching Project Name:

    echo
    echo -n "On project $(git remote -v | head -n1 | awk '{print $2}' | sed -e 's,.*:\(.*/\)\?,,' -e 's/\.git$//')"
    echo
    

    This part retrieves the project name from the Git remote URL and displays it. It uses a combination of git remote -v, awk, and sed commands to extract and format the project name.

  3. Generating the Git Log:

    git --no-pager log --no-merges --pretty=tformat:"- %ad | %s%C(auto)%d [%h]" --date=short --reverse --all --since=${days}.days.ago --author="$(git config user.name)" 2>&1
    

    This part generates the Git log for the specified number of days. It includes:

    • --no-pager: To prevent paging the output.
    • --no-merges: To exclude merge commits.
    • --pretty=tformat: To format each commit log line.
    • --date=short: To display dates in short format.
    • --reverse: To show the oldest commits first.
    • --all: To include all branches.
    • --since=${days}.days.ago: To limit the log to commits from the specified number of days ago.
    • --author="$(git config user.name)": To filter commits by the current Git user.
  4. Outputting the Result:

    echo
    

    Finally, it prints a blank line for better readability of the output.

Running the Script

To see what you have done since 1 day ago, simply run:

worklog

If you want to see the work done in the last 7 days, run:

worklog 7

Handling Multiple Projects

If your work involves multiple projects, the following script can help:

Save the following script as wlog and put it into your ~/bin directory. Don't forget to make it executable with chmod +x wlog.

#!/bin/bash

# Define an array with the project directories
project_dirs=(
    /d/git/xemt-core/dfx
    /d/git/apollo/mock
)

# Loop through each project directory and run the commands
for dir in "${project_dirs[@]}"; do
    (cd $dir && worklog "$@" && cd - >/dev/null)
done

How It Works

  1. Project Directories:

    project_dirs=(
        /d/git/xemt-core/dfx
        /d/git/apollo/mock
    )
    

    Define an array containing the directories of your projects.

  2. Loop Through Projects:

    for dir in "${project_dirs[@]}"; do
        (cd $dir && worklog "$@" && cd - >/dev/null)
    done
    

    Loop through each directory, change to that directory, run the worklog script with any passed arguments, and then change back to the previous directory. The cd - >/dev/null part suppresses output from the directory change.

This script helps me quickly summarize my work for daily standup meetings. Customize the project directories in the wlog script to match your projects and streamline your standup preparation.

[Solution] How to limit Google Chrome Cache Size

Click the title to see the details. By the way, this solution not only works on windows, but also works on Linux platforms: You need to find the correct place on linux platform to add the parameter though.

Using `git diff HEAD` to show All Changes

You probably know:

  • git diff shows unstaged changes.
  • git diff --cached shows staged changes.

But how do you see all changes in one go? Just use:

git diff HEAD

Here's the breakdown:

  • git diff compares the working directory to the staged index. If nothing is staged, it's the same as git diff HEAD.
  • git diff --cached compares the staged index to HEAD. It's a shortcut for git diff --cached HEAD.
  • git diff HEAD (or git diff <commit/branch/tag>) compares your current working directory with the specified commit.