<%* // The KOReader defined highlight styles vs callout mapping. Leave the keys as is, but you can edit the values to create your own convention. const NOTE_STYLES = { lighten: { type: "quote", title: "Quotable/Concept/General Idea", }, invert: { type: "important", title: "Striking/Intense",
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Boox Annotations | |
// @namespace http://tampermonkey.net/ | |
// @version 2025-02-26 | |
// @description try to take over the world! | |
// @author You | |
// @include https://push.boox.com/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=mozilla.org | |
// @grant GM.registerMenuCommand |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local UIManager = require("ui/uimanager") | |
local ReaderHighlight = require("apps/reader/modules/readerhighlight") | |
local _ = require("gettext") | |
local util = require("util") | |
local ButtonDialog = require("ui/widget/buttondialog") | |
local BD = require("ui/bidi") | |
local C_ = _.pgettext | |
ReaderHighlight.onShowHighlightDialog = function(self, index) | |
local item = self.ui.annotation.annotations[index] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%* | |
// Note style prefixes we will map to callouts. | |
// It will suffice to put just this character to change the callout style. | |
// If additional notes are required, we will use a space after the prefix, | |
// and then continue to our usual note. | |
// Customize this as you see fit. With types from: https://help.obsidian.md/Editing+and+formatting/Callouts#Supported+types | |
const NOTE_STYLES = { | |
"!": { | |
type: "important", | |
title: "Striking/Intense", |
<%* function getTitleAndAuthor(l) { l = l.replace("Reading Notes | <<", "").split(">>"); return { title: l[0], authors: l[1] } }
let file = app.workspace.getActiveFile()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Formatters { | |
format_book_collections(collections, dv) { | |
if (collections) { | |
const keys = Object.keys(collections); | |
const links = dv | |
.pages('"Personal/Reading/Collections"') | |
.where( | |
(p) => | |
p.handle != undefined && | |
keys.indexOf(p.handle) > -1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::collections::HashMap; | |
pub fn read_lines(filename: String) -> Vec<String> { | |
let content: Vec<String> = fs::read_to_string(filename) | |
.expect("Invalid File") | |
.split('\n') | |
.map(|s| s.to_string()) | |
.collect(); | |
return content; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
largest_by_far = sys.float_info.min | |
smallest_by_far = sys.float_info.max | |
while True: | |
value = input("Enter Numbers: ") | |
if value == "done": | |
break | |
try: | |
fvalue = float(value) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
MY_DICT = {"a": "a definition"} # assuming this is your dict | |
data = list(MY_DICT.items()) | |
with open('glossary.txt', 'w') as gfile: | |
writer = csv.writer(gfile, delimiter="\t") | |
writer.writerows(data) |
NewerOlder