😄 你好~ 我是 yihong0618,生活工作在大连。 喜爱游戏,跑步,读书,编程和有趣的东西。 项目大多和这些相关。
你可以到我的网站来玩, 📫 如果你想聊聊,可以给我发邮件, 也可以来到我的 tg 频道
也欢迎赞助我杯可乐 Sponsor Me
Yesterday you said tomorrow.
记录下的跑步 13 年。
关于我的 2021 的一些记录。
License: MIT License
这个 issue 记录自己的花费。试试记账吧。。。今天是2021-01-20,从今天开始记注:~~分类写在后面,用英文逗号分隔。~~分类写在下面
Month | Number |
---|---|
1月 | 673 (元) |
2月 | 1592 (元) |
3月 | 2378 (元) |
4月 | 1888 (元) |
5月 | 2741 (元) |
6月 | 2040 (元) |
7月 | 195 (元) |
8月 | 34 (元) |
这个 issue 记录我的生活。碎碎念,不如意,开心,懊悔。
珍惜眼前
156
不如从今天开始。
我应该是搞定了小米的 api, 想办法自动记录。
只是现在不太知道怎么表现才好。
今天膝盖有些疼,连续称体重 10 天左右了,好像是瘦了 4 斤 之前没太称。
现在是 152 左右。理论上这个月过完能到 150
目标呢?
这次的目标很远大,想瘦到 126 并保持。
所以还有 26 斤。倒是还好,50斤我也瘦过。
大概呢,用 4 个月完成。
这个 issue 开始记周记,今天是周日,不如从今天开始之前看到一篇文章,说是写公开周记。嗯,我觉得周记是不错的选择,周的单位也正好,不长不短。
Month | Number |
---|---|
4月 | 1 (周) |
5月 | 4 (周) |
6月 | 4 (周) |
7月 | 4 (周) |
8月 | 5 (周) |
9月 | 4 (周) |
10月 | 4 (周) |
11月 | 5 (周) |
12月 | 4 (周) |
作者真自律!点赞
testhhhhhhhhh
这个 issue 记录自己刷的新番,今年要多看一点儿哈哈哈哈哈哈。
这个 issue 记录自己 2021 的美食旅程。
2021.02.05 准备重构这个变成表格了。
2021.02.08 重构完成
格式: 菜在第一行,用空格分隔。
看了“黑影儿”的早起跑步记录。决定把自己的跑步也改成早上,还能给媳妇儿子做早餐,背单词。不如从明早开始
Month | Number |
---|---|
2月 | 10 (天) |
3月 | 31 (天) |
4月 | 30 (天) |
5月 | 30 (天) |
6月 | 27 (天) |
7月 | 27 (天) |
8月 | 12 (天) |
9月 | 6 (天) |
10月 | 2 (天) |
11月 | 15 (天) |
12月 | 16 (天) |
有些困扰自己的问题,一些是有答案的,一些是没有的。
但记录在这里的,大约是公开场合无法问出来的,如果你看到了,希望讨论的话,非常感谢。
记录在这里吧。
I see the .py files used in the repository. I am not a Python Dev but I would like to generate the daily records like you did.
Can you please add a "usage" section with instructions on how to do it?
It will be very helpful. Thank you!
这个 issue 记录自己 2021 的读书
从最开始的用 GitHub 的 Issues 写博客,到尝试用 GitHub 记录的年度数据已经一年有余了,从最开始有想法 2020, 到 2021 加了很多功能,把大部分的记录自动化,一点一点记录也算是有些心得了,这篇文章就介绍一下我是怎么做了,能帮助到同样感兴趣的大家就更好了。也算是践行这 2 年对我影响最大的文章之一
好,我们把这些结合起来,记录自己的一年~
Issues 的代码思路为获取 label -> 通过 label 找 issues -> issues 的评论特定格式 -> 通过函数解析 -> 整合 -> 通过正则替换 README 中的原有数据 (README 可以写注释,而注释是不显示的,利用这个完成显示和替换)
def main(
login_dict,
github_token,
repo_name,
):
my_num_stat_str = MY_NUMBER_STAT_HEAD
# API STAT STR
for name, value_dict in MY_STATUS_DICT_FROM_API.items():
try:
url = value_dict.get("url")
md_name = f"[{name}]({url})"
# maybe a better way?
total_data, streak, today_check = value_dict.get("daily_func")(
*login_dict.get(name, tuple())
)
total_data_str = str(total_data) + value_dict.get("unit_str", "")
my_num_stat_str += make_stat_str(
md_name, total_data_str, streak, today_check
)
# just a tricky code for others for use
except Exception as e:
print(e)
continue
u = Github(github_token)
# COMMENTS STAT STR
for name, value_dict in MY_STATUS_DICT_FROM_COMMENTS.items():
try:
labels, map_func, reduce_func = LABEL_DAILY_DICT.get(name)
except:
# tricky for mine
continue
func = value_dict.get("daily_func")
if not func:
break
issues = u.get_repo(repo_name).get_issues(labels=labels)
total_data, streak, today_check, url, month_summary_dict = func(
issues, map_func, reduce_func
)
# change the issue body for month summary
unit = value_dict.get("unit_str", "")
for i in issues:
body = ""
for b in i.body.splitlines():
# from the summary table
if b.startswith("|"):
break
body += b + "\r\n"
body = body + "\r\n" + make_month_summary_str(month_summary_dict, unit)
# edit this issue body
i.edit(body=body)
name = f"[{name}]({url})"
total_data_str = str(total_data) + unit
my_num_stat_str += make_stat_str(name, total_data_str, streak, today_check)
replace_readme_comments("README.md", my_num_stat_str, "my_number")
关于早起这个数据和 issue 因为自己喜欢诗歌,我找了一个获取一句诗的 API, 然后自动评论,评论是带时间戳的,正好记录自己的起床时间。
那么是怎么触发的呢?
我试用的是 iOS 系统,而 iOS 有个重要的功能是“捷径”,利用捷径可以触发 Actions workflow 的 api, 触发 api 就有时间戳了,再判断是不是早起,给自己发送就好了。
捷径的触发条件是闹钟关闭,为了保险起见,我可能比闹钟起的早,再加一条关闭背单词软件,解决了用 GitHub 记录早起的问题。
关于如何利用捷径配合 Actions 我写过一篇文章 -- 巧妙利用 iOS 的快捷指令配合 GitHub Actions 实现自动化
而早起这句诗,我期待好久的 -- 苟利国家生死以,岂因福祸避趋之。还没随机到,随到这一天我决定跑 19.26 km.
利用了我写的 GitHubPoster 项目,自动生成 svg 引入,而自动跑的脚本也在那个项目上。
利用我写的 github-readme-stats 自动替换生成。
全部利用 Issues 评论 -> 触发 Actions -> 自动替换 README 的注释区域生成
def replace_readme_comments(file_name, comment_str, comments_name):
with open(file_name, "r+") as f:
text = f.read()
# regrex sub from github readme comments
text = re.sub(
GITHUB_README_COMMENTS.format(name=comments_name),
r"\1{}\n\3".format(comment_str),
text,
flags=re.DOTALL,
)
f.seek(0)
f.write(text)
f.truncate()
def parse_cook_issue_table(me, issues):
comments_str = MY_FOOD_STAT_HEAD
food_dict = defaultdict(lambda: ["", "", 0])
for issue in issues:
comments = issue.get_comments()
for c in comments:
if not isMe(c, me):
continue
date_str = format_time(c.created_at)
food_list_str = c.body.splitlines()[0]
food_list = food_list_str.split(" ")
for food in food_list:
if food not in food_dict:
food_dict[food][0] = f"[{date_str}]({c.html_url})"
food_dict[food][1] = f"[{date_str}]({c.html_url})"
else:
food_dict[food][1] = f"[{date_str}]({c.html_url})"
food_dict[food][2] += 1
for k, v in food_dict.items():
comments_str += MY_FOOD_STAT_TEMPLATE.format(
name=k, first_date=v[0], last_date=v[1], times=v[2]
)
return comments_str
这个 Issue 记录自己今年收藏的书签。或者有意思的东西。
还是要打游戏的吧。
这个 issue 记录下自己 2021 的游戏记录。
这个 issue 记录自己 2021 年看的电影
不如从今天开始,这个 issue 记录自己冥想。不知道有啥用,那就试验一下吧。
Month | Number |
---|---|
1月 | 11 (分钟) |
2月 | 9 (分钟) |
3月 | 35 (分钟) |
4月 | 28 (分钟) |
5月 | 13 (分钟) |
6月 | 8 (分钟) |
7月 | 11 (分钟) |
8月 | 18 (分钟) |
9月 | 7 (分钟) |
10月 | 15 (分钟) |
11月 | 27 (分钟) |
12月 | 8 (分钟) |
这个 issue 记录自己的教训。今年快过完了,明年把这个主题的放前面。
这个 issue 记录我 2021 刷的剧。
这个 issue 记录自己的每日 todo list, 不如从今天开始- [ ] 激励自己- [ ] 记录自己
Month | Number |
---|---|
4月 | 46 (个) |
5月 | 21 (个) |
6月 | 22 (个) |
7月 | 4 (个) |
8月 | 10 (个) |
9月 | 10 (个) |
10月 | 10 (个) |
从第一次背 50 音,已经过去好多年了。最多学到初级下册的第五课。
每次都没坚持下来。
嗯,
我又开始了,2021 年争取慢慢进入日语世界
目标呢?不敢说,争取 7 月能过个 N3,不行就12月再看吧,如果能坚持下来,今年争取 N2.
今天已经开始学了。
初级下的单词已经背一周了。
开始认真起来吧。
具体如何学还没想好,
但开始很重要。
2021.07.16 补充
12 月试试吧。
目前的策略是把 N3 的单词全部背完。一天学习一个小时到两个小时。
报名 N3
大概这样,不如从今天开始?
思路 - 每天
这个 issue 纪录自己的核心锻炼
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.