by Glenn Matlin / glennmatlin on all socials
- Download and copy all files in this gist to
~/.claude/ - Move the
.pyfiles to~/.claude/hooks - Restart Claude Code.
| .roam-body .roam-app .roam-main .roam-article { | |
| padding-top: 0; | |
| } | |
| .roam-article [style="width: 100%;"], .rm-sidebar-outline [style="width: 100%;"], .roam-log-page .rm-title-display { | |
| background-image: url(https://unsplash.it/1600/900?random); | |
| background-size: cover; | |
| height: 30vh; | |
| margin-bottom: 10px; | |
| position: relative; |
| [{"create-time":1629041510869,"title":"comment queries on daily pages",":create/user":{":user/uid":"6bJAKBYrpIcPZBpFEpexUwW3x5r1"},"children":[{"string":"isa::[[iroam/notebook]]","create-time":1629041512459,":block/refs":[{":block/uid":"pt_Ivza0F"},{":block/uid":"FxnP85ywT"}],"refs":[{"uid":"pt_Ivza0F"},{"uid":"FxnP85ywT"}],":create/user":{":user/uid":"6bJAKBYrpIcPZBpFEpexUwW3x5r1"},"uid":"hw_U21Vfv","edit-time":1629041523012,":edit/user":{":user/uid":"6bJAKBYrpIcPZBpFEpexUwW3x5r1"}},{"string":"```javascript\nfunction addDays(original, days) {\n let date = new Date(original.valueOf());\n date.setDate(date.getDate() + days);\n return date;\n}\n\nfunction getDatesBetween(startDate, stopDate) {\n var dateArray = new Array();\n var currentDate = startDate;\n while (currentDate <= stopDate) {\n dateArray.push(new Date (currentDate));\n currentDate = addDays(currentDate, 1);\n }\n return dateArray;\n}\n\nfunction getPagesToProcess() {\n const now = new Date()\n const startDat |
| // init | |
| let xhr = new XMLHttpRequest() | |
| let domain = 'https://read.amazon.com/' | |
| let items = [] | |
| let csvData = "" | |
| // function | |
| function getItemsList(paginationToken = null) { | |
| let url = domain + 'kindle-library/search?query=&libraryType=BOOKS' + ( paginationToken ? '&paginationToken=' + paginationToken : '' ) + '&sortType=recency&querySize=50' | |
| xhr.open('GET', url, false) |
| // MIT Licensed | |
| // Author: jwilson8767 | |
| /** | |
| * Waits for an element satisfying selector to exist, then resolves promise with the element. | |
| * Useful for resolving race conditions. | |
| * | |
| * @param selector | |
| * @returns {Promise} | |
| */ |
| function sleep(ms) { | |
| return new Promise(resolve => setTimeout(resolve, ms)); | |
| } | |
| function getPage(page) { | |
| // returns the uid of a specific page in your graph. | |
| // _page_: the title of the page. | |
| let results = window.roamAlphaAPI.q(` | |
| [:find ?uid | |
| :in $ ?title |
| /* | |
| * credit to Dhrumil Shah (@wandcrafting) and Robert Haisfield (@RobertHaisfield) | |
| * for the original concept which was part of their RoamGames submission | |
| * and can be found at: https://www.figma.com/file/5shwLdUCHxSaPNEO7pazbe/ | |
| * | |
| */ | |
| /* ======= OPTIONS ======== */ | |
| /* note: if you change these, reload the page to see the effect */ |
| @import url("https://rawcdn.githack.com/jchen1/roam-util/d81f004d4bbf7ec51b562b2170752c82d5adb1f0/roam.css"); | |
| @import url('https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,400;0,700;1,400;1,700&family=Playfair+Display:ital,wght@0,400;0,700;1,400;1,700&family=Source+Code+Pro&display=swap'); | |
| :root { | |
| --header-font: "Playfair Display", serif; | |
| --body-font: "Merriweather", serif; | |
| --monospace-font: "Source Code Pro", monospace; | |
| --header-color: #f0e8db; | |
| --header-text-color: #111; |
Setup:
bookmarklet below (open this "raw" link so it's not truncated). Yes it's huge, that's fine. You can name the bookmark "Roam Link" or whatever you like.
roam/css, and create a CSS code block (``` for code block, then change the language selector dropdown to CSS) and paste the CSS below.Usage: