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) -
ESC = Normal (Bewegen), i = Insert (Schreiben), v = Visual (Markieren).
-${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