From 4211901764d4e6cca2e76067848224c74bea5b80 Mon Sep 17 00:00:00 2001 From: michi Date: Thu, 5 Feb 2026 13:44:35 +0000 Subject: [PATCH] fix latex --- IT/Cheatsheet.md | 15 ++-- Library/Malys/HelpShortcuts.md | 24 +++++++ Library/mermaid.plug.js | 12 ++++ Library/silverbullet-mermaid.md | 43 +++++++++++ Library/zefhemel/Git.md | 124 ++++++++++++++++++++++++++++++++ Wissen.md | 1 + Wissen/Physik.md | 23 +++--- 7 files changed, 221 insertions(+), 21 deletions(-) create mode 100644 Library/Malys/HelpShortcuts.md create mode 100644 Library/mermaid.plug.js create mode 100644 Library/silverbullet-mermaid.md create mode 100644 Library/zefhemel/Git.md create mode 100644 Wissen.md diff --git a/IT/Cheatsheet.md b/IT/Cheatsheet.md index 46f57d9..ae123cc 100644 --- a/IT/Cheatsheet.md +++ b/IT/Cheatsheet.md @@ -4,9 +4,9 @@ Eine zentrale Referenz für Befehle, Shortcuts und Workflows. --- -## 🐙 Git (Version Control) +# 🐙 Git (Version Control) - # + #### ♻️ **Merkregel:** Git speichert Snapshots, nicht nur Deltas. Working Dir (Lokal) -> Staging Area (Vorbereitung) -> Repository(Commit). @@ -31,13 +31,13 @@ Working Dir (Lokal) -> Staging Area (Vorbereitung) -> Repository(Commit). | `git stash pop` | Holt Änderungen vom Stack zurück. | | `git log --oneline --graph` | Zeigt den Commit-Baum visuell an. | +#### ‼️ git reset --hard HEAD~1 Löscht den letzten Commit und alle darin enthaltenen Änderungen unwiderruflich. Reset auf den Zustand davor. - --- -## 🐧 Linux / Bash (Shell) +# 🐧 Linux / Bash (Shell) ### 📂 Datei- & Ordner-Operationen | Befehl | Beschreibung | @@ -69,11 +69,10 @@ Löscht den letzten Commit und alle darin enthaltenen Änderungen unwiderruflich --- -## ⛵ Neovim (NVIM) +# ⛵ Neovim (NVIM) -
-Modi: ESC = Normal (Bewegen), i = Insert (Schreiben), v = Visual (Markieren). -
+#### ⚠️ +**Modi:** ESC = Normal (Bewegen), i = Insert (Schreiben), v = Visual (Markieren). ### 🏃 Navigation (Muscle Memory) | Taste | Bewegung | diff --git a/Library/Malys/HelpShortcuts.md b/Library/Malys/HelpShortcuts.md new file mode 100644 index 0000000..7425cff --- /dev/null +++ b/Library/Malys/HelpShortcuts.md @@ -0,0 +1,24 @@ +--- +author: malys +description: Display most commun shortcuts. +name: "Library/Malys/HelpShortcuts" +tags: meta/library +share.uri: "https://github.com/malys/silverbullet-libraries/blob/main/src/HelpShortcuts.md" +share.hash: c67cc072 +share.mode: pull +--- +# Help: Shortcuts +Display helper on demand. + +```space-lua +command.define { + name = "Help: shortcuts", + key = "Ctrl-h", + run = function() + local messages={ "shift-alt-e header picker", "ctrl-alt-t tag picker","alt-c: copy nearest","shift-ctrl-c: cursor position","alt-ctrl-n: new child","alt-ctrl-s: new sibling","ctrl-Alt-1: code block","!!last monday: chronos"} + for i in pairs(messages) do + editor.flashNotification(messages[i], "info") + end + end +} +``` \ No newline at end of file diff --git a/Library/mermaid.plug.js b/Library/mermaid.plug.js new file mode 100644 index 0000000..3497e86 --- /dev/null +++ b/Library/mermaid.plug.js @@ -0,0 +1,12 @@ +var h=Object.defineProperty;var v=(t,e)=>{for(var i in e)h(t,i,{get:e[i],enumerable:!0})};function f(t){let e=atob(t),i=e.length,o=new Uint8Array(i);for(let n=0;n{throw new Error("Not initialized yet")},p=typeof window>"u"&&typeof globalThis.WebSocketPair>"u";typeof Deno>"u"&&(self.Deno={args:[],build:{arch:"x86_64"},env:{get(){}}});var l=new Map,m=0;p&&(globalThis.syscall=async(t,...e)=>await new Promise((i,o)=>{m++,l.set(m,{resolve:i,reject:o}),u({type:"sys",id:m,name:t,args:e})}));function g(t,e,i){p&&(u=i,self.addEventListener("message",o=>{(async()=>{let n=o.data;switch(n.type){case"inv":{let s=t[n.name];if(!s)throw new Error(`Function not loaded: ${n.name}`);try{let a=await Promise.resolve(s(...n.args||[]));u({type:"invr",id:n.id,result:a})}catch(a){console.error("An exception was thrown as a result of invoking function",n.name,"error:",a.message),u({type:"invr",id:n.id,error:a.message})}}break;case"sysr":{let s=n.id,a=l.get(s);if(!a)throw Error("Invalid request id");l.delete(s),n.error?a.reject(new Error(n.error)):a.resolve(n.result)}break}})().catch(console.error)}),u({type:"manifest",manifest:e}))}async function b(t,e){if(typeof t!="string"){let i=new Uint8Array(await t.arrayBuffer()),o=i.length>0?d(i):void 0;e={method:t.method,headers:Object.fromEntries(t.headers.entries()),base64Body:o},t=t.url}return syscall("sandboxFetch.fetch",t,e)}globalThis.nativeFetch=globalThis.fetch;function w(){globalThis.fetch=async function(t,e){let i=e&&e.body?d(new Uint8Array(await new Response(e.body).arrayBuffer())):void 0,o=await b(t,e&&{method:e.method,headers:e.headers,base64Body:i});return new Response(o.base64Body?f(o.base64Body):null,{status:o.status,headers:o.headers})}}p&&w();typeof self>"u"&&(self={syscall:()=>{throw new Error("Not implemented here")}});function r(t,...e){return globalThis.syscall(t,...e)}var c={};v(c,{getConfig:()=>L,getMode:()=>E,getVersion:()=>U,invokeCommand:()=>A,invokeFunction:()=>F,listCommands:()=>T,listSyscalls:()=>k,reloadPlugs:()=>D,wipeClient:()=>R});function F(t,...e){return r("system.invokeFunction",t,...e)}function A(t,e){return r("system.invokeCommand",t,e)}function T(){return r("system.listCommands")}function k(){return r("system.listSyscalls")}function D(){return r("system.reloadPlugs")}function E(){return r("system.getMode")}function U(){return r("system.getVersion")}function L(t,e=void 0){return r("system.getConfig",t,e)}function R(t=!1){return r("system.wipeClient",t)}async function y(t){let e=await c.getConfig("mermaid",{version:"11.10.1"}),i=e?.version,o=e?.integrity?`"${e.integrity}"`:'"sha256-BmQmdWDS8X2OTbrwELWK366LV6escyWhHHe0XCTU/Hk="';e?.integrity_disabled&&(o=void 0);let n="";if(e?.icon_packs)for(let s of e?.icon_packs)n+=`{ + name: "${s.name}", + loader: () => fetch("${s.url}").then(r => r.json()), + },`;return{html:`
${t.replaceAll("<","<")}
`,script:` + loadJsByUrl("https://cdn.jsdelivr.net/npm/mermaid@${i}/dist/mermaid.min.js", ${o}).then(() => { + mermaid.init().then(updateHeight); + mermaid.registerIconPacks([${n}]); + }); + document.addEventListener("click", () => { + api({type: "blur"}); + }); + `}}var x={mermaidWidget:y},P={name:"mermaid",version:.1,imports:["https://get.silverbullet.md/global.plug.json"],functions:{mermaidWidget:{path:"./mermaid.ts:widget",codeWidget:"mermaid"}},assets:{}},Se={manifest:P,functionMapping:x};g(x,P,self.postMessage);export{Se as plug}; diff --git a/Library/silverbullet-mermaid.md b/Library/silverbullet-mermaid.md new file mode 100644 index 0000000..e89c39c --- /dev/null +++ b/Library/silverbullet-mermaid.md @@ -0,0 +1,43 @@ +--- +name: "Library/silverbullet-mermaid" +tags: meta/library +files: +- mermaid.plug.js +share.uri: "https://github.com/silverbulletmd/silverbullet-mermaid/blob/main/PLUG.md" +share.hash: 357c5dc6 +share.mode: pull +--- +This plug adds basic [Mermaid](https://mermaid.js.org/) support to Silver Bullet. + +For example: + +```mermaid +flowchart LR + +A[Hard] -->|Text| B(Round) +B --> C{Decision} +C -->|One| D[Result 1] +C -->|Two| E[Result 2] +``` + +**Note:** The Mermaid library itself is not bundled with this plug, it pulls the JavaScript from the JSDelivr CDN. This means _this plug will not work without an Internet connection_. The reason for this is primarily plug size (bundling the library would amount to 1.1MB). This way Mermaid is only loaded on pages with actual Mermaid diagrams rather than on every SB load. + +## Configuration +You can use the `mermaid` config to tweak a few things: + + ```space-lua + config.set("mermaid", { + version = "11.4.0", + integrity = "new integrity hash", + -- or disable integrity checking + integrity_disabled = true + -- optional: register icon packs + icon_packs = { + { + name = "logos", + url = "https://unpkg.com/@iconify-json/logos@1/icons.json", + }, + }, + }) + ``` + diff --git a/Library/zefhemel/Git.md b/Library/zefhemel/Git.md new file mode 100644 index 0000000..5394adc --- /dev/null +++ b/Library/zefhemel/Git.md @@ -0,0 +1,124 @@ +--- +name: Library/zefhemel/Git +tags: meta/library +share.uri: "https://github.com/zefhemel/silverbullet-libraries/blob/main/Git.md" +share.hash: 8b51f35b +share.mode: pull +--- +This library adds a basic git synchronization functionality to SilverBullet. It should be considered a successor to [silverbullet-git](https://github.com/silverbulletmd/silverbullet-git) implemented in Space Lua. + +The following commands are currently implemented: + +${widgets.commandButton("Git: Sync")} + +* Adds all files in your folder to git +* Commits them with the default "Snapshot" commit message +* `git pull`s changes from the remote server +* `git push`es changes to the remote server + +${widgets.commandButton("Git: Commit")} + +* Asks you for a commit message +* Commits + +# Configuration +There is currently only a single configuration option: `git.autoSync`. When set, the `Git: Sync` command will be run every _x_ minutes. + +Example configuration: +```lua +config.set("git.autoSync", 5) +``` + +# Implementation +The full implementation of this integration follows. + +## Configuration +```space-lua +-- priority: 100 +config.define("git", { + type = "object", + properties = { + autoSync = schema.number() + } +}) +``` + +## Commands +```space-lua +git = {} + +function checkedShellRun(cmd, args) + local r = shell.run(cmd, args) + if r.code != 0 then + error("Error: " .. r.stdout .. r.stderr, "error") + end +end + +function git.localChanges() + local r = shell.run("git", {"diff", "--exit-code"}) + return r.code != 0 +end + +function git.commit(message) + message = message or "Snapshot" + if git.localChanges() then + print "Comitting changes..." + local ok, message = pcall(function() + checkedShellRun("git", {"add", "./*"}) + checkedShellRun("git", {"commit", "-a", "-m", message}) + end) + if not ok then + print("Git commit failed: " .. message) + end + else + print "No local changes to commit" + end +end + +function git.sync() + git.commit() + print "Pulling..." + checkedShellRun("git", {"pull"}) + print "Pushing..." + checkedShellRun("git", {"push"}) +end + +command.define { + name = "Git: Commit", + run = function() + local message = editor.prompt "Commit message:" + git.commit(message) + end +} + +command.define { + name = "Git: Sync", + run = function() + git.sync() + editor.flashNotification "Done!" + end +} + +``` + +```space-lua +-- priority: -1 +local autoSync = config.get("git.autoSync") +if autoSync then + print("Enabling git auto sync every " .. autoSync .. " minutes") + + local lastSync = 0 + + event.listen { + name = "cron:secondPassed", + run = function() + local now = os.time() + if (now - lastSync)/60 >= autoSync then + lastSync = now + git.sync() + end + end + } +end + +``` diff --git a/Wissen.md b/Wissen.md new file mode 100644 index 0000000..3b01f73 --- /dev/null +++ b/Wissen.md @@ -0,0 +1 @@ +[[Wissen/Physik]] \ No newline at end of file diff --git a/Wissen/Physik.md b/Wissen/Physik.md index 10bda91..e0d9570 100644 --- a/Wissen/Physik.md +++ b/Wissen/Physik.md @@ -2,26 +2,23 @@ ## 🌌 Fundamentalkonstanten (CODATA 2018) -| Größe | Symbol | Wert (SI) | Unsicherheit | -| :--- | :--- | :--- | :--- | -| **Lichtgeschwindigkeit** | $c$ | $299\,792\,458 \, \mathrm{m/s}$ | (exakt) | -| **Planck-Konstante** | $h$ | $6.626\,070\,15 \times 10^{-34} \, \mathrm{Js}$ | (exakt) | -| **Elementarladung** | $e$ | $1.602\,176\,634 \times 10^{-19} \, \mathrm{C}$ | (exakt) | -| **Boltzmann-Konstante** | $k_B$ | $1.380\,649 \times 10^{-23} \, \mathrm{J/K}$ | (exakt) | -| **Gravitationskonstante** | $G$ | $6.674\,30(15) \times 10^{-11} \, \mathrm{m^3 kg^{-1} s^{-2}}$ | $2.2 \times 10^{-5}$ | +**Lichtgeschwindigkeit**: ${latex.inline[[c = 299\,792\,458 \, \mathrm{m/s}]]} +**Planck-Konstante**: ${latex.inline[[h = 6.626\,070\,15 \times 10^{-34} \, \mathrm{Js}]]} +**Elementarladung**: ${latex.inline[[e = 1.602\,176\,634 \times 10^{-19} \, \mathrm{C}]]} +**Boltzmann-Konstante**: ${latex.inline[[k_B = 1.380\,649 \times 10^{-23} \, \mathrm{J/K}]]} +**Gravitationskonstante**: ${latex.inline[[G=6.674\,30(15) \times 10^{-11} \, \mathrm{m^3 kg^{-1} s^{-2}}]]} ## 📐 Häufig genutzte Umrechnungen -* **Energie:** $1 \, \mathrm{eV} \approx 1.602 \times 10^{-19} \, \mathrm{J}$ -* **Druck:** $1 \, \mathrm{bar} = 10^5 \, \mathrm{Pa} \approx 0.9869 \, \mathrm{atm}$ -* **Temperatur:** $T_{\mathrm{Kelvin}} = T_{\mathrm{Celsius}} + 273.15$ +* **Energie:** ${latex.inline[[1 \, \mathrm{eV} \approx 1.602 \times 10^{-19} \, \mathrm{J}]]} +* **Druck:** ${latex.inline[[1 \, \mathrm{bar} = 10^5 \, \mathrm{Pa} \approx 0.9869 \, \mathrm{atm}]]} +* **Temperatur:** ${latex.inline[[T_{\mathrm{Kelvin}} = T_{\mathrm{Celsius}} + 273.15 K]]} ## 📝 LaTeX Schnipsel (Copy & Paste) Für schnelles Einfügen in Papers oder dieses Wiki. * **Maxwell-Gleichungen (Vakuum):** - $$\nabla \cdot \mathbf{E} = 0, \quad \nabla \cdot \mathbf{B} = 0$$ - $$\nabla \times \mathbf{E} = -\frac{\partial \mathbf{B}}{\partial t}, \quad \nabla \times \mathbf{B} = \mu_0 \epsilon_0 \frac{\partial \mathbf{E}}{\partial t}$$ + ${latex.block[[\nabla \cdot \mathbf{E} = 0, \quad \nabla \cdot \mathbf{B} = 0 \newline \nabla \times \mathbf{E} = -\frac{\partial \mathbf{B}}{\partial t}, \quad \nabla \times \mathbf{B} = \mu_0 \epsilon_0 \frac{\partial \mathbf{E}}{\partial t}]]} * **Schrödinger-Gleichung:** - $$i\hbar \frac{\partial}{\partial t} \Psi = \hat{H} \Psi$$ \ No newline at end of file + ${latex.block[[i\hbar \frac{\partial}{\partial t} \Psi = \hat{H} \Psi]]} \ No newline at end of file