在Hexo中插入Mermaid图表

Mermaid是什么?

Mermaid是一个基于JavaScript的流程图、序列图、甘特图等图表生成工具。使用Mermaid可以方便地在Markdown文档中嵌入各种图表,而无需手动绘制或使用其他辅助工具。

Mermaid支持多种流程图、序列图、甘特图等图表类型,使用简单明了的语法来描述图表元素之间的关系。在插入Mermaid图表之前,需要在Hexo中安装相应的插件,如前面所述。

Mermaid提供了丰富的语法来绘制各种类型的图表,具体语法可以参考官方文档。在Hexo中插入Mermaid图表时,只需要在Markdown文档中使用Mermaid代码块即可。

如何在Hexo中插入Mermaid图表

安装Mermaid插件

1
npm install hexo-filter-mermaid-diagrams

修改配置文件

在hexo的_config.yml文件(根目录的并非主题的)中,添加以下内容:

1
2
3
4
5
6
# mermaid chart
mermaid: ## mermaid url https://github.com/knsv/mermaid
enable: true # default true
version: "7.1.2" # default v7.1.2
options: # find more api options from https://github.com/knsv/mermaid/blob/master/src/mermaidAPI.js
#startOnload: true // default true

修改主题

根据主题不同,修改方式不同,我使用的ayer主题,只要修改主题目录themes/ayer下的_config.yml文件,将Enable选项改为true即可:

1
2
3
4
mermaid:
enable: true
cdn: https://cdn.staticfile.org/mermaid/8.14.0/mermaid.min.js
theme: forest
More...

简单而后容易

读到这篇文章,介绍我们如何处理复杂性,其中几个观点都挺有意思,我记录一下。

容易不等于简单

  • 容易 对应 困难 / 简单 对应 复杂
  • 容易是主观判断 / 简单可以是客观评价

大脑的记忆是有上限的

大脑在同一时间,可以记住的事情是有限的。当我们的代码库变得越来越复杂和相互连接,就越难以理解它的全部。当事物相互交织在一起时,我们不能再孤立地思考不同的部分,而必须一起考虑它们。

每次我认为我需要理解软件的新部分,并且它与另一件事情相关联,我就必须把那个其他的东西也放入我的脑海中,因为我无法单独思考一个而不考虑另一个。这就是它们交织在一起的本质。因此,每个交织都增加了这种负担,而这种负担在考虑事物的数量方面是组合的。因此,从根本上讲,这种复杂性,我指的是事物的编织,将限制我们理解系统的能力。

“复杂”意味着交织、纠缠、编织

“复杂”意味着程序的交织、纠缠、编织,要尽量避免。

如何使困难的东西变简单?

主动学习、实验、尝试。

如何使复杂的东西变简单?

将扭曲和交织的部分分离开来,让每个个部分对其他部分的依赖最小化。

简单的好处

易于理解,易于更改,易于调试。

如何查找英文Podcast的文字稿

背景

最近比较喜欢听一些科技方面的英文Podcast,比如《This American Life》,《How I Built This with Guy Raz》 等。 当然,我英文比较菜,并不能完全脱离文本,当听了一个大概后,还是希望能结合文字稿再精听一下。这时我发现,每个Podcast的风格时不一样的,有些会搭建一个网站,放上历史的音频和文字稿,方便听众;例如《This American Life》就有一个很好用的网站。但有一些就没有。

当我在听没有官方提供文字稿的Podcast时,就比较痛苦,需要到处找文字稿。搜索了全网,我发现一个网站还不错,可以解决问题。

非官方文字稿查询网站

这个网站就是 https://app.podscribe.ai

进入网址,就可以看到这神奇的网站:
podscribe page1

More...

Hexo博客插入图片后如何控制图片大小和样式

背景

在用Hexo写博客时,发现有时原始图片过大,直接引用不太美观,需要缩小一下,研究了一下,Hexo md语法并不支持这样的功能,我在网上找到了方法,纪录一下。

方法

有两个方法:

  1. 使用img 标记来控制图片显示大小:
1
<img src="/images/xxx.png" width="50%" height="50%">
  1. 使用div 加上css 来控制图片的显示和大小:
1
2
3
<div style="width: 40%; margin: 10px">
<img src="/images/xxx.png“>
</div>

其中/images/xxx.png为图片实际地址。经过试用,我选择了方法2,原因是用css可以控制的属性更多,后续也可以做统一的美化修改。关于CSS样式的说明,可以参考这篇文章

Reflections on 'The Six Counterintuitive Rules' - Summary

Summary

The Six Counterintuitive Rules:

  1. Managment is not leadership
  2. Don’t Try to create robots, Focus on managing the what not how.
  3. Godd managers never create a second patient
  4. Spend more time with your high performancers
  5. Set expectaton, but know that you’re not always the one who needs to bring the clarity
  6. Direct is kine. Have the hard conversation - earlier than you think you need to

Inspiration Summary

I used to overlook the types of people needed to achieve our goals and micromanage product design, depriving colleagues of the opportunity to grow. I need to trust my colleagues more, delegate tasks, and set clear expectations to help them develop and free up my time. Communication is essential for success and avoiding it can lead to bigger losses in the long run.

Reflections on 'The Six Counterintuitive Rules' - 6

RULE #6: DIRECT IS KIND. HAVE THE HARD CONVERSATION — EARLIER THAN YOU THINK YOU NEED TO.

People can grow and change at any point in their career. But I believe most people haven’t been given the chance to do so because they haven’t gotten honest feedback. No one’s held up a mirror to them about their work, how they impact others, and the things standing in the way.

Humans don’t like having hard conversations. We build them up in our heads, and then we try to couch them in a lot of useless language that makes it hard for everybody to understand what’s going on. One of the biggest management skills to work on is being direct with people.If you start that habit early, it gets a lot easier to have direct conversations with people. But if you wait until something’s really not working, then you end up surprising your direct reports and having worse conversations that are much more stressful.

I always write down the number one message that a person needs to hear and understand. Then I try to make sure I say it a couple times in the conversation. The following week, I’ll actually have that person repeat it back to me to make sure we’re on the same page. If you can hear back the same messages that you were trying to send, then you know you’re on the same page. That’s when you can start to focus on what you’re both going to do about it.

Inspiration 6: Being direct with people

If a team member has a problem, it’s essential to have an honest conversation with them, even if it’s not something one is inclined to do. Candid communication is not only beneficial to the organization but also an opportunity for personal improvement. Avoiding communication and attempting to solve problems independently may work for a short time, but it is not a sustainable approach and may result in bigger losses in the long run.


Done

GitHub Pages 强制使用HTTPS协议访问

背景

在上一篇文章《实现自定义域名Github Page网站Https访问》,我们实现了网站的https协议的添加,但有一个小问题,用户依然可以通过http协议访问网站。现在大部分网站都实现了强制跳转https网站的功能,以提高网站安全性,那基于github page的网站如何实现这个功能呢?

设置步骤

其实只要在github上进行简单的配置就可以实现了,以下是配置过程:

  1. 在 GitHub 上,导航到站点的仓库,在存储库名称下,单击 “Setting”。
    HTTPS访问1
  2. 在边栏的“Code and automation”部分,单击“Pages”。
3. 在 GitHub Pages 下,选择“Enforce HTTPS”。 ![HTTPS访问3](http://cdn.yunminitools.cn/blog/Https0218-3.png)

设置好了以后,再用http访问网站,自动跳到的https的网址,设置成功。

Reflections on 'The Six Counterintuitive Rules' - 5

RULE #5: SET EXPECTATIONS, BUT KNOW THAT YOU’RE NOT ALWAYS THE ONE WHO NEEDS TO BRING THE CLARITY.

If there’s a new role that’s been poorly defined, providing clarification is the first step. Once you define it, you’ll usually find that someone who’s in that role isn’t actually a fit for what the business needs.

  • Do people’s roles make sense?
  • Do they know how they fit in?
  • How they align to the business?
  • Do they know what’s expected of them?
  • Do they know what success looks like?
    80% of the time when I go into a team that’s struggling, the answers to those questions is no.

Be realistic about what you can offer, but remember that it’s BYOC (Bring Your Own Clarity). I actually need people who bring their own clarity and structure. And that’s because I don’t have a lot of the answers right now. To be a better manager, you have to be really realistic about what you can control and what you can offer — and what you can’t.

Often a low performer isn’t someone who is inherently low performing. It is someone who has the wrong set of circumstances around them — they’re in the wrong job or in the wrong organization. A lot of times when people are struggling it’s not because they’re bad at stuff, but because they don’t know what’s expected of them. Give them the chance to see the gap and say, ‘I know I can do it,’ or ‘This really isn’t for me actually.’

Inspiration 5: Set expectations is important

Setting clear expectations is essential for both high-performing and low-performing employees. In the past, I did not do a good job of setting clear expectations, which impacted high-performing employees’ motivation to achieve even greater goals and low-performing employees’ direction in making an effort to improve.


To Be Continue…

Reflections on 'The Six Counterintuitive Rules' - 4

RULE #4: SPEND MORE TIME THAN YOU THINK YOU NEED TO WITH YOUR HIGH PERFORMERS.

As managers, we often forget that we should be spending most of our time with the highest performers on our team. When you have someone who’s doing really well, the question should be, ‘How can they do even better? How can you make their growth explode?’” , Here are the two tools:

Look back, look forward

Whatever milestone that makes the most sense for that person’s role. I ask them to look back on a project that they just finished and run through these questions:
Look back:

  • What did you like about that? What felt good?

  • What did you hate about it? What didn’t feel good?

  • What’s the most important thing you learned?

  • Do you want to do more of that type of work, or less?

  • What do you want to do differently next time?

Look forward:

  • What’s the next challenge?

  • What’s the next big step or career goal you want to reach for?

  • What type of work do you want to take on, whether it’s a current project in the company or something that might potentially show up in the future?

In essence, it’s about carving out the time to help an individual reflect on their learning, unpack what didn’t work so that they know what to change next time, and then look toward the next challenge on the horizon.

Use the performance review as an opportunity to push for more.

We don’t want them to be too important because we want you to have these conversations all year long. However, the review was a powerful summary moment to both reflect on the last half and how things had gone, but also to push me on what she wanted to see next.

Inspiration 4: Spend more time & Listen

  • In the past, I used to devote a lot of energy to the latter half of team management and neglect the development of high-potential talent. This is certainly a counterproductive approach, as it does not leverage the full potential of the team.

  • The way we communicate is essential, and it’s important to be well-prepared before engaging in communication. This involves actively listening to others, engaging in discussions, and then presenting the goals to be achieved.


To Be Continue…

请我喝杯咖啡吧~

支付宝
微信