Skip to content

Instantly share code, notes, and snippets.

View JimmyLv's full-sized avatar
🎯
Focusing

JimmyLv_吕立青 JimmyLv

🎯
Focusing
View GitHub Profile
@JimmyLv
JimmyLv / ai-journal-in-roam.js
Last active October 2, 2023 07:02
#[[AI interstitial journaling]] Inside Roam Research can look up what I just edited by time period (25 mins) and then automatically summarize what I just did via GPT. 🤣 tweet backlink: https://x.com/Jimmy_JingLv/status/1708725446395748503?s=20
const twentyFiveMinutesAgo = Date.now() - (25 * 60 * 1000);
const YOUR_OPENAI_API_KEY = ''
const blocks = window.roamAlphaAPI.q(`[
:find ?text
:where
[?e :block/string ?text]
[?e :edit/time ?time]
[(> ?time ${twentyFiveMinutesAgo})]
]`);
@JimmyLv
JimmyLv / zettelkstan.css
Last active January 29, 2023 06:58
Add Zettelkstan number system for Numbered List in Roam Research, It is best to apply this CSS only on the target [[📝 Zettelkasten]] page, via [[roam/css]]
.rm-level-0 {
counter-reset: top-counter;
}
.rm-level-0 > .roam-block-container:before {
counter-increment: top-counter;
content: counter(top-counter);
visibility: hidden;
height: 0;
}
@JimmyLv
JimmyLv / font.css
Last active December 27, 2022 03:47
临时解决 Readwise Reader 字体显示为繁体的问题,借助 Chrome 插件 Stylus 可加载自定义 CSS:https://userstyles.world/style/7852/read-readwise-io
body {
font-feature-settings: inherit;
}
.page-detail .detail-main-content .left-area.normal {
flex-direction: row-reverse;
}
.page-detail .detail-main-content .left-area.normal .player-box.loaded-data {
min-width: 60%;
}
@JimmyLv
JimmyLv / bilibili-danmu.js
Created October 28, 2022 01:12
提取视频弹幕
document.querySelectorAll('.danmaku-info-row').forEach(e => console.log(e.innerText))
@JimmyLv
JimmyLv / roam-css-vertical-sidebar-styling.css
Last active October 7, 2022 06:41
[[roam/css]] Vertical Sidebar Styling 侧边栏竖版样式横向滚动,demo: https://share.cleanshot.com/BxPj7F
html[lang="en"]:not(.landscape):not(.portrait) #roam-right-sidebar-content {
overflow: visible !important;
}
html[lang="en"]:not(.landscape):not(.portrait) .sidebar-content {
display: flex;
overflow: auto;
}
html[lang="en"]:not(.landscape):not(.portrait) .sidebar-content > div {
@JimmyLv
JimmyLv / bilibili_note.js
Last active September 26, 2022 04:51
将时间戳转换为可点击的按钮 作者:吕立青_JimmyLv https://www.bilibili.com/read/cv18780064?spm_id_from=333.999.0.0 出处:bilibili
/*
------------------------------
trans timestamp in bilibili-note
thanks to @Note必利阀 [让b站视频笔记回归b站,本地obsidian太孤单了_哔哩哔哩_bilibili](https://www.bilibili.com/video/BV17B4y1y7Ut)
------------------------------
main
- trans text timestamp into original time click button
- usage:
- open bilibili note editor
- set at least one time button in editor
@JimmyLv
JimmyLv / feishu-highlight.ts
Created September 25, 2022 14:41
自动提取飞书妙记的文本高亮,并复制到剪切板
copy(
[...document.querySelectorAll(".p-right-area")]
.map((e) => {
const highlights = e.querySelectorAll(".highlight-background");
if (highlights.length === 0) {
return;
}
const timestamp = e.querySelector(".p-time").getAttribute("time-content");
const highlight = [...highlights].map((e) => e.textContent).join("");
return `${timestamp} ${highlight}`;
@JimmyLv
JimmyLv / get-address.applescript
Created July 26, 2022 16:56
Roam Research PWA & Hook
return "hook://file/6ZVuhkgqj?p=QXBwbGljYXRpb25zL0Nocm9tZSBBcHBzLmxvY2FsaXplZA==&n=Roam%20Research%2Eapp"
@JimmyLv
JimmyLv / msg_card.json
Created June 16, 2022 10:29
TG 转发至 Lark 飞书消息卡片, https://daily.jimmylv.info
{
"msg_type": "interactive",
"card": {
"config": {
"wide_screen_mode": true,
"enable_forward": true
},
"elements": [{
"tag": "div",
"text": {