Skip to content

Instantly share code, notes, and snippets.

View QWxleA's full-sized avatar

Alex QWxleA

View GitHub Profile
@QWxleA
QWxleA / obsidian-web-clipper.js
Created July 27, 2023 17:33 — forked from kepano/obsidian-web-clipper.js
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
@QWxleA
QWxleA / Readme.md
Last active April 27, 2024 06:24
Obsidian zotero template for use with "obsidian-zotero-integration" plugin

QWxlea's over-engineered zotero template

Faq

What are these %% begin id-pn2xitti%% and %% end id-pn2xitti %% and ^pn2xitti? These are the persistance-markers of the indivual highlights, and the reference-id to that highlight.

The markers are meant for the importer. It will skip all text within those markers, so they stay when updating a zotero-import. Removing a marked block does not work well, it will not be reimported. Don't know how to fix that. If you want to reimport a highlight-block, best is to change the highlight in zotero (for example change the color). This will update the id, and on the next import the new highlight will be imported.

The reference-id is used like this: [[@name-of-the-note#^pn2xitti]]

@QWxleA
QWxleA / img.pdf.sh
Created May 25, 2023 02:26
Converts input images to one-page PDF files each, without changing image data.
#!/bin/bash
# Converts input images to one-page PDF files each, without changing image data.
# The image is centered on a A4 page with a 5% border.
# Adapted from https://unix.stackexchange.com/a/220114
#
# Usage: [command] image1.jpg image2.png ...
# Output: PDF files named after the images e.g. image1.pdf
# Page dimensions (A4)
pageWidth=8.27
@QWxleA
QWxleA / pixi.cljs
Created May 30, 2022 20:56
Logseq graph chocolate milk edition: /src/main/frontend/extensions/graph/pixi.cljs
(defn layout!
[nodes links]
(let [nodes-count (count nodes) ;; no of pages
simulation (forceSimulation nodes)
qwxlea_distanceMax_large 4000 ;; Default: 4000
qwxlea_distanceMax_small 2200 ;; Default: 600 - larger better with long filenames
qwxlea_link_distance 280 ;; Default: 180 - legth of sticks(?)
qwxlea_charge_strength -2600 ;; Default: -600 - lower = further apart
qwxlea_forceXY 0.5 ;; Default: 0.02 - A value outside the range [0,1] is not recommended
;; higher turns graph in a ball
@QWxleA
QWxleA / custom-zk.css
Created April 24, 2022 06:19
Logseq Zettelkasten 💚🐔CSS
/* FLEETING NOTES */
span.page-reference[data-ref="fleeting note"]
{ background: var(--ls-primary-background-color);
background-size: 100%;
color: var(--ls-primary-text-color);
padding: 2px 5px 2px 5px;
font-size: 13px;
line-height: 1em;
font-weight: 500;
{
"disabled": false,
"toolbar": true,
"wrap-link": {
"label": "Wrap Link",
"binding": "",
"template": "[[$^]]",
"icon": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"> <g clip-path=\"url(#clip0_101_2)\"> <path d=\"M0.114075 14.9953V5.10858H3.19611V6.35077H1.72345V13.7492H3.19611V14.9953H0.114075ZM4.61505 14.9953V5.10858H7.69708V6.35077H6.22443V13.7492H7.69708V14.9953H4.61505ZM10.7957 3.47186V16.6281H9.21759V3.47186H10.7957ZM15.4022 5.10858V14.9953H12.3201V13.7492H13.7928V6.35077H12.3201V5.10858H15.4022ZM19.9031 5.10858V14.9953H16.8211V13.7492H18.2938V6.35077H16.8211V5.10858H19.9031Z\" fill=\"white\"/> </g> <defs> <clipPath id=\"clip0_101_2\"> <rect width=\"20\" height=\"20\" fill=\"white\"/> </clipPath> </defs> </svg>"
},
"wrap-highlight": {
@QWxleA
QWxleA / progress.css
Created March 18, 2022 13:26
Add simple progress bar to Logseq
/* In your config.edn: */
:macros {"progress" "[:span [:progress {:value $1 :max $2 :style {:width 200 :margin-right 4}}] [:small \"$1/$2\"]]"}
/* In your custom.css: *
/* Progress bar */
progress {
vertical-align: middle;
border-radius: 8px;
height: 0.7em;
@QWxleA
QWxleA / config.edn
Created February 8, 2022 15:44
Almost default Logseq config
{ ;; Currently, we support either "Markdown" or "Org".
;; This can overwrite your global preference so that
;; maybe your personal preferred format is Org but you'd
;; need to use Markdown for some projects.
;; :preferred-format ""
;; Preferred workflow style.
;; Value is either ":now" for NOW/LATER style,
;; or ":todo" for TODO/DOING style.
:preferred-workflow :now
@QWxleA
QWxleA / dl-logseq-nightly.sh
Last active June 7, 2022 16:01
Download nightly logseq release
#!/usr/bin/env bash
#
# downloads nightly logseq release
# returns error 3 if up-to-date
set -e
APPLOC="$HOME/Applications"
LOGBIN="$APPLOC/logseq-linux-x64-bin"
@QWxleA
QWxleA / config.edn
Created September 21, 2021 16:15
logseq configuration sept 2021
{;; Currently, we support either "Markdown" or "Org".
;; This can overwrite your global preference so that
;; maybe your personal preferred format is Org but you'd
;; need to use Markdown for some projects.
;; :preferred-format ""
;; Preferred workflow style.
;; Value is either ":now" for NOW/LATER style,
;; or ":todo" for TODO/DOING style.
:preferred-workflow :now