--- a/lib/services/note_tag_service.dart
+++ b/lib/services/note_tag_service.dart
@@ -9,6 +9,5 @@ class NoteTagService {
Future<Map<String, int>> getMyTagCloud() async {
var apiResult = (await _noteTagApi.getMyTagCloud()).data;
if (!apiResult['successful']) throw ApiException(apiResult);
- return apiResult['data'].map((item) => {item['tag'] as String: item['count'] as int});
- }
+ return { for (var item in apiResult['data']) item['tag'] as String : item['count'] as int }; }
+ }
I found this brilliant answer at Stack overflow. It is way more clearer and useful than Microsoft's official one
You can use inline modifiers as follows:
// case insensitive match
Regex MyRegex = new Regex(@"(?i)[a-z]+"); // case insensitive match
or, inverse the meaning of the modifier by adding a minus-sign:
// case sensitive match
Regex MyRegex = new Regex(@"(?-i)[a-z]+"); // case sensitive match
or, switch them on and off:
// case sensitive, then case-insensitive match
Regex MyRegex = new Regex(@"(?-i)[a-z]+(?i)[k-n]+");
Alternatively, you can use the mode-modifier span syntax using a colon :
and a grouping parenthesis, which scopes the modifier to only that group:
// case sensitive, then case-insensitive match
Regex MyRegex = new Regex(@"(?-i:[a-z]+)(?i:[k-n]+)");
You can use multiple modifiers in one go like this (?is-m:text)
, or after another, if you find that clearer (?i)(?s)(?-m)text
(I don't). When you use the on/off switching syntax, be aware that the modifier works till the next switch, or the end of the regex. Conversely, using the mode-modified spans, after the span the default behavior will apply.
Finally: the allowed modifiers in .NET are (use a minus to invert the mode):
x
allow whitespace and comments
s
single-line mode
m
multi-line mode
i
case insensitivity
n
only allow explicit capture (.NET specific)
If you haven't read Step1 to Step 5, click Step 1 ~ Step 5
-
Open the HappyNotes App:
-
Open https://happynotes.shukebeta.com with your favorite broswer and then navigate to the **Settings** page.
-
Access Telegram Sync Settings:
- Within the Settings page, look for the "Note Sync - Telegram" option.
- Tap on it to open the sync settings page.
-
Add a New Sync Configuration:
- On the sync settings page, click on the "+ Add" button to create a new sync configuration.
-
Enter the Required Information:
-
Source Note Choose the appropriate source note to sync from the options provided (e.g., Public, Private, All, Tag).
- All - for backup purpose. It will sync every new note to the channel you specified. (Please don't use a public channel if you have any private notes!!!)
- Private - only sync private notes to specified channel, you definitely should not use a public channel for this type of notes!
- Public - only sync public notes to specified channel - if you use a telegram channel for your blog or microblog purpose, this option is for you!
- Tag - only sync notes that are tagged with specific tag, You must know that it does not check the private/public flag, every new note that has the specified tag will be sent to the specified channel.
-
Channel Id: In the "Channel Id" field, enter the Channel Id you obtained earlier which looks like -100123456789
.
-
Channel Name: This is a remark for the channel id, you can use the same channel name on Telegram or anything else you want.
-
Telegram Bot Token: In this field, paste your Telegram Bot Token . I strongly recommend you to use copy/paste feature instead of manually typing the token to avoid typos.
-
**Token Remark: ** Just like the channel name, this Token Remark helps you remember which token you are using for this channel. You can use your bot's name or anything else you want.
-
Save the Configuration:
- After filling in the details, click the "Save" button to store your sync configuration.
-
Test the Sync Setting:
- Once saved, you'll see your new configuration listed on the sync settings page.
- Tap the "Test" button to send a test message to your Telegram channel.
- If the test is successful, you’ll receive a confirmation message in your Telegram channel indicating that the sync is working, and the Test button will disappear.
-
Activate or Adjust Sync Settings:
- You can Disable or Activate or Delete a setting based on your requirements.
- Make sure your bot is active and configured correctly to ensure smooth synchronization.
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:
- Open the conversation with your newly created bot in Telegram.
- Tap on the bot's icon in the top right corner.
- Click on "Add to Group or Channel".
- 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:
- Go to your Telegram channel's settings.
- Select "Administrators" and manually add your newly created bot as an admin.
- 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.
通过在地址栏输入依次输入 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
你的会是哪些? 何不现在就试试?