Home > Reflections | โฎ๏ธ โญ๏ธ
2025-06-07 | ๐ Farm | ๐พ Software | ๐ค Trauma | ๐ค๐ฆ AutoTweet โจ๏ธ
๐ Books
- ๐๐งโ๐พ๐ฑ Farming for Us All: Practical Agriculture and the Cultivation of Sustainability
- ๐ปโ๏ธ Software Engineering at Google: Lessons Learned from Programming Over Time
- ๐ฅ๏ธ๐ System Design Interview - An Insiderโs Guide
๐ฐ News
- ๐ช๏ธ๐บ๐ธ๐๐ Trumpโs instability and the potential of a post-American world
- ๐คโก๏ธ๐๏ธโ Your reality narrows after trauma โ hereโs how to expand it | Bessel van der Kolk
๐ค๐ฆ Semiautomatic Tweets โจ๏ธ
โจ Obsidian Templater code for opening a ๐ป browser window with an ๐ค AI-generated ๐ฆ tweet, ready to ๐ post.
โ What this code does:
- ๐ Read the content of the current note ๐
- ๐ฃ๏ธ Ask Gemini ๐ค to identify a list of ๐ท๏ธ topics from the note ๐
- โ๏ธ Format a tweet ๐ฆ with:
- ๐ the title of the current note ๐
- ๐ท๏ธ The formatted topics identified by Gemini ๐ค
- ๐ The URL to the web page this note is published to ๐
- ๐ป Open a browser window ๐ to the ๐ฆ twitter post form, prefilled with the generated tweet ๐คโ๏ธ ๐.
<%*
const GEMINI_API_KEY = "๐คซ Secret ๐๏ธ key";
const tweetPrompt = (body) => `Identify the main topics in the following.
Return a pipe separated list of emoji-topic pairs.
Prefer specific topics (e.g. don't include "Books" - that's too generic).
Don't use terms that are already present in the title.
2 Examples:
๐ Ancient Wisdom | โ๏ธ Military Strategy | ๐ก Timeless Principles | ๐ง Strategic Thinking | ๐ฏ Path to Victory
๐๏ธ Principles | ๐ช Leadership | ๐ค Decisions
---
${body}`
const file = tp.file.find_tfile(tp.file.path(true));
async function generateTextFromGemini(prompt, apiKey, model = "gemini-2.0-flash", search = false) {
const apiUrl = `https://generativelanguage.googleapis.com/v1beta/models/${model}:generateContent?key=${apiKey}`;
const body = {
"contents": [
{
"parts": [
{"text": prompt }
]
}
],
"tools": [
{
"google_search": {}
}
]
};
if (!search) delete body.tools
const response = await fetch(apiUrl, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(body),
});
if (!response.ok) {
throw new Error(`HTTP error! status: (${response.status}) ${await response.text()}`);
}
const data = await response.json();
const { parts } = data.candidates[0].content;
if (!parts) {
throw new Error(`No parts from Gemini! url='${apiUrl}'! unexpected response: data=(${JSON.stringify(data)})`)
}
return (parts[1] || parts[0]).text;
}
const model = 'gemini-2.5-flash-preview-04-17'
try {
const originalContent = await app.vault.read(file);
const tweetBody = await generateTextFromGemini(tweetPrompt(originalContent), GEMINI_API_KEY)
.then(t => t.trim());
const tweet = `${tp.frontmatter.title}
${tweetBody}
${tp.frontmatter.URL}`
const URL = `https://twitter.com/intent/tweet?text=${encodeURIComponent(tweet.trim())}`
window.open(URL);
} catch (error) {
tR += `Error: ${error.message}`;
}
%>
๐๐ Bug Report
- ๐ observation
- Thereโs a broken link on this page 2025-03-26 | ๐ชต Record ๐ฆ Reason ๐ก๏ธ Represent ๐
- The excalidraw video (โ๏ธ๐๏ธโฑ๏ธโจ The Excalidraw Obsidian Showcase 57 key features in just 17 minutes) is missing the video segment of the URL path
- ๐ฉบ Diagnostics
- The Enveloppe Obsidian plugin converts links before committing to GitHub
- even though the link is correct and works in my obsidian note, when itโs committed, itโs missing the video path
- Enveloppe is configured to convert links to relative paths, which typically works
- so far, I canโt tell whatโs different about this path thatโs causing it to be converted incorrectly
๐ฆ Tweet
2025-06-07 | ๐ Farm | ๐พ Software | ๐ค Trauma | ๐ค๐ฆ AutoTweet โจ๏ธ
โ Bryan Grounds (@bagrounds) June 8, 2025
๐ Books | ๐ฐ News | ๐ค Automation | ๐ Debugging | ๐ Publishinghttps://t.co/Ch5ySEkaKj