diff --git a/content/notes/.obsidian/community-plugins.json b/content/notes/.obsidian/community-plugins.json index bd7ffe0..c6f6adc 100644 --- a/content/notes/.obsidian/community-plugins.json +++ b/content/notes/.obsidian/community-plugins.json @@ -3,5 +3,5 @@ "obsidian-linter", "table-editor-obsidian", "obsidian-languagetool-plugin", - "homepage" + "obsidian-link-converter" ] \ No newline at end of file diff --git a/content/notes/.obsidian/plugins/homepage/data.json b/content/notes/.obsidian/plugins/homepage/data.json deleted file mode 100644 index bfac8ca..0000000 --- a/content/notes/.obsidian/plugins/homepage/data.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "version": 4, - "homepages": { - "Main Homepage": { - "value": "index/index", - "kind": "File", - "openOnStartup": true, - "openMode": "Replace all open notes", - "manualOpenMode": "Keep open notes", - "view": "Default view", - "revertView": true, - "openWhenEmpty": true, - "refreshDataview": false, - "autoCreate": false, - "autoScroll": false, - "pin": false, - "commands": [], - "alwaysApply": false, - "hideReleaseNotes": false - } - }, - "separateMobile": false -} \ No newline at end of file diff --git a/content/notes/.obsidian/plugins/homepage/main.js b/content/notes/.obsidian/plugins/homepage/main.js deleted file mode 100644 index e612e3e..0000000 --- a/content/notes/.obsidian/plugins/homepage/main.js +++ /dev/null @@ -1,4 +0,0 @@ -"use strict";var Be=Object.create;var B=Object.defineProperty;var Ue=Object.getOwnPropertyDescriptor;var Ke=Object.getOwnPropertyNames;var je=Object.getPrototypeOf,ze=Object.prototype.hasOwnProperty;var qe=(a,t)=>()=>(t||a((t={exports:{}}).exports,t),t.exports),Ge=(a,t)=>{for(var e in t)B(a,e,{get:t[e],enumerable:!0})},we=(a,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ke(t))!ze.call(a,i)&&i!==e&&B(a,i,{get:()=>t[i],enumerable:!(n=Ue(t,i))||n.enumerable});return a};var $e=(a,t,e)=>(e=a!=null?Be(je(a)):{},we(t||!a||!a.__esModule?B(e,"default",{value:a,enumerable:!0}):e,a)),Qe=a=>we(B({},"__esModule",{value:!0}),a);var Re=qe(r=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var g=require("obsidian"),ie="YYYY-MM-DD",oe="gggg-[W]ww",Pe="YYYY-MM",Te="YYYY-[Q]Q",De="YYYY";function x(a){let t=window.app.plugins.getPlugin("periodic-notes");return t&&t.settings?.[a]?.enabled}function L(){try{let{internalPlugins:a,plugins:t}=window.app;if(x("daily")){let{format:o,folder:s,template:d}=t.getPlugin("periodic-notes")?.settings?.daily||{};return{format:o||ie,folder:s?.trim()||"",template:d?.trim()||""}}let{folder:e,format:n,template:i}=a.getPluginById("daily-notes")?.instance?.options||{};return{format:n||ie,folder:e?.trim()||"",template:i?.trim()||""}}catch(a){console.info("No custom daily note settings found!",a)}}function O(){try{let a=window.app.plugins,t=a.getPlugin("calendar")?.options,e=a.getPlugin("periodic-notes")?.settings?.weekly;if(x("weekly"))return{format:e.format||oe,folder:e.folder?.trim()||"",template:e.template?.trim()||""};let n=t||{};return{format:n.weeklyNoteFormat||oe,folder:n.weeklyNoteFolder?.trim()||"",template:n.weeklyNoteTemplate?.trim()||""}}catch(a){console.info("No custom weekly note settings found!",a)}}function C(){let a=window.app.plugins;try{let t=x("monthly")&&a.getPlugin("periodic-notes")?.settings?.monthly||{};return{format:t.format||Pe,folder:t.folder?.trim()||"",template:t.template?.trim()||""}}catch(t){console.info("No custom monthly note settings found!",t)}}function H(){let a=window.app.plugins;try{let t=x("quarterly")&&a.getPlugin("periodic-notes")?.settings?.quarterly||{};return{format:t.format||Te,folder:t.folder?.trim()||"",template:t.template?.trim()||""}}catch(t){console.info("No custom quarterly note settings found!",t)}}function R(){let a=window.app.plugins;try{let t=x("yearly")&&a.getPlugin("periodic-notes")?.settings?.yearly||{};return{format:t.format||De,folder:t.folder?.trim()||"",template:t.template?.trim()||""}}catch(t){console.info("No custom yearly note settings found!",t)}}function Fe(...a){let t=[];for(let n=0,i=a.length;n{let ee=n(),te=a.clone().set({hour:ee.get("hour"),minute:ee.get("minute"),second:ee.get("second")});return F&&te.add(parseInt(v,10),w),f?te.format(f.substring(1).trim()):te.format(o)}).replace(/{{\s*yesterday\s*}}/gi,a.clone().subtract(1,"day").format(o)).replace(/{{\s*tomorrow\s*}}/gi,a.clone().add(1,"d").format(o)));return t.foldManager.save(p,m),p}catch(p){console.error(`Failed to create file: '${l}'`,p),new g.Notice("Unable to create new file.")}}function nt(a,t){return t[k(a,"day")]??null}function at(){let{vault:a}=window.app,{folder:t}=L(),e=a.getAbstractFileByPath(g.normalizePath(t));if(!e)throw new se("Failed to find daily notes folder");let n={};return g.Vault.recurseChildren(e,i=>{if(i instanceof g.TFile){let o=A(i,"day");if(o){let s=k(o,"day");n[s]=i}}}),n}var re=class extends Error{};function it(){let{moment:a}=window,t=a.localeData()._week.dow,e=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];for(;t;)e.push(e.shift()),t--;return e}function ot(a){return it().indexOf(a.toLowerCase())}async function Me(a){let{vault:t}=window.app,{template:e,format:n,folder:i}=O(),[o,s]=await S(e),d=a.format(n),m=await I(i,d);try{let c=await t.create(m,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(l,p,P,T,F,v)=>{let w=window.moment(),f=a.clone().set({hour:w.get("hour"),minute:w.get("minute"),second:w.get("second")});return P&&f.add(parseInt(T,10),F),v?f.format(v.substring(1).trim()):f.format(n)}).replace(/{{\s*title\s*}}/gi,d).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*(sunday|monday|tuesday|wednesday|thursday|friday|saturday)\s*:(.*?)}}/gi,(l,p,P)=>{let T=ot(p);return a.weekday(T).format(P.trim())}));return window.app.foldManager.save(c,s),c}catch(c){console.error(`Failed to create file: '${m}'`,c),new g.Notice("Unable to create new file.")}}function st(a,t){return t[k(a,"week")]??null}function rt(){let a={};if(!Le())return a;let{vault:t}=window.app,{folder:e}=O(),n=t.getAbstractFileByPath(g.normalizePath(e));if(!n)throw new re("Failed to find weekly notes folder");return g.Vault.recurseChildren(n,i=>{if(i instanceof g.TFile){let o=A(i,"week");if(o){let s=k(o,"week");a[s]=i}}}),a}var le=class extends Error{};async function xe(a){let{vault:t}=window.app,{template:e,format:n,folder:i}=C(),[o,s]=await S(e),d=a.format(n),m=await I(i,d);try{let c=await t.create(m,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(l,p,P,T,F,v)=>{let w=window.moment(),f=a.clone().set({hour:w.get("hour"),minute:w.get("minute"),second:w.get("second")});return P&&f.add(parseInt(T,10),F),v?f.format(v.substring(1).trim()):f.format(n)}).replace(/{{\s*date\s*}}/gi,d).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,d));return window.app.foldManager.save(c,s),c}catch(c){console.error(`Failed to create file: '${m}'`,c),new g.Notice("Unable to create new file.")}}function lt(a,t){return t[k(a,"month")]??null}function dt(){let a={};if(!Oe())return a;let{vault:t}=window.app,{folder:e}=C(),n=t.getAbstractFileByPath(g.normalizePath(e));if(!n)throw new le("Failed to find monthly notes folder");return g.Vault.recurseChildren(n,i=>{if(i instanceof g.TFile){let o=A(i,"month");if(o){let s=k(o,"month");a[s]=i}}}),a}var de=class extends Error{};async function ct(a){let{vault:t}=window.app,{template:e,format:n,folder:i}=H(),[o,s]=await S(e),d=a.format(n),m=await I(i,d);try{let c=await t.create(m,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(l,p,P,T,F,v)=>{let w=window.moment(),f=a.clone().set({hour:w.get("hour"),minute:w.get("minute"),second:w.get("second")});return P&&f.add(parseInt(T,10),F),v?f.format(v.substring(1).trim()):f.format(n)}).replace(/{{\s*date\s*}}/gi,d).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,d));return window.app.foldManager.save(c,s),c}catch(c){console.error(`Failed to create file: '${m}'`,c),new g.Notice("Unable to create new file.")}}function pt(a,t){return t[k(a,"quarter")]??null}function ut(){let a={};if(!Ce())return a;let{vault:t}=window.app,{folder:e}=H(),n=t.getAbstractFileByPath(g.normalizePath(e));if(!n)throw new de("Failed to find quarterly notes folder");return g.Vault.recurseChildren(n,i=>{if(i instanceof g.TFile){let o=A(i,"quarter");if(o){let s=k(o,"quarter");a[s]=i}}}),a}var ce=class extends Error{};async function gt(a){let{vault:t}=window.app,{template:e,format:n,folder:i}=R(),[o,s]=await S(e),d=a.format(n),m=await I(i,d);try{let c=await t.create(m,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(l,p,P,T,F,v)=>{let w=window.moment(),f=a.clone().set({hour:w.get("hour"),minute:w.get("minute"),second:w.get("second")});return P&&f.add(parseInt(T,10),F),v?f.format(v.substring(1).trim()):f.format(n)}).replace(/{{\s*date\s*}}/gi,d).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,d));return window.app.foldManager.save(c,s),c}catch(c){console.error(`Failed to create file: '${m}'`,c),new g.Notice("Unable to create new file.")}}function mt(a,t){return t[k(a,"year")]??null}function ht(){let a={};if(!He())return a;let{vault:t}=window.app,{folder:e}=R(),n=t.getAbstractFileByPath(g.normalizePath(e));if(!n)throw new ce("Failed to find yearly notes folder");return g.Vault.recurseChildren(n,i=>{if(i instanceof g.TFile){let o=A(i,"year");if(o){let s=k(o,"year");a[s]=i}}}),a}function ft(){let{app:a}=window,t=a.internalPlugins.plugins["daily-notes"];if(t&&t.enabled)return!0;let e=a.plugins.getPlugin("periodic-notes");return e&&e.settings?.daily?.enabled}function Le(){let{app:a}=window;if(a.plugins.getPlugin("calendar"))return!0;let t=a.plugins.getPlugin("periodic-notes");return t&&t.settings?.weekly?.enabled}function Oe(){let{app:a}=window,t=a.plugins.getPlugin("periodic-notes");return t&&t.settings?.monthly?.enabled}function Ce(){let{app:a}=window,t=a.plugins.getPlugin("periodic-notes");return t&&t.settings?.quarterly?.enabled}function He(){let{app:a}=window,t=a.plugins.getPlugin("periodic-notes");return t&&t.settings?.yearly?.enabled}function wt(a){let t={day:L,week:O,month:C,quarter:H,year:R}[a];return t()}function yt(a,t){return{day:Ae,month:xe,week:Me}[a](t)}r.DEFAULT_DAILY_NOTE_FORMAT=ie;r.DEFAULT_MONTHLY_NOTE_FORMAT=Pe;r.DEFAULT_QUARTERLY_NOTE_FORMAT=Te;r.DEFAULT_WEEKLY_NOTE_FORMAT=oe;r.DEFAULT_YEARLY_NOTE_FORMAT=De;r.appHasDailyNotesPluginLoaded=ft;r.appHasMonthlyNotesPluginLoaded=Oe;r.appHasQuarterlyNotesPluginLoaded=Ce;r.appHasWeeklyNotesPluginLoaded=Le;r.appHasYearlyNotesPluginLoaded=He;r.createDailyNote=Ae;r.createMonthlyNote=xe;r.createPeriodicNote=yt;r.createQuarterlyNote=ct;r.createWeeklyNote=Me;r.createYearlyNote=gt;r.getAllDailyNotes=at;r.getAllMonthlyNotes=dt;r.getAllQuarterlyNotes=ut;r.getAllWeeklyNotes=rt;r.getAllYearlyNotes=ht;r.getDailyNote=nt;r.getDailyNoteSettings=L;r.getDateFromFile=A;r.getDateFromPath=tt;r.getDateUID=k;r.getMonthlyNote=lt;r.getMonthlyNoteSettings=C;r.getPeriodicNoteSettings=wt;r.getQuarterlyNote=pt;r.getQuarterlyNoteSettings=H;r.getTemplateInfo=S;r.getWeeklyNote=st;r.getWeeklyNoteSettings=O;r.getYearlyNote=mt;r.getYearlyNoteSettings=R});var kt={};Ge(kt,{default:()=>X});module.exports=Qe(kt);var N=require("obsidian");var b=require("obsidian");var Ie=require("obsidian");var E=require("obsidian");function D(a){return a?a.extension=="md"?a.path.slice(0,-3):a.path:""}function ye(a){return a.split("/").slice(-1)[0].contains(".")?a:`${a}.md`}function ne(a,t=void 0){let e=a.vault.getFiles();if(t){let n=a.vault.getFolderByPath(t);if(!n)return;e=ve(n)}if(e.filter(n=>["md","canvas"].contains(n.extension)),e.length){let n=Math.floor(Math.random()*e.length);return D(e[n])}}function ve(a){let t=[];for(let e of a.children)e instanceof E.TFolder?t.push(...ve(e)):t.push(e);return t}function be(a){return a.workspace.getActiveViewOfType(E.View)?.getViewType()=="empty"}function ae(a,t){return a.localeCompare(t,void 0,{sensitivity:"accent"})===0}function U(a){return new Promise(t=>setTimeout(t,a))}async function Ne(a){let t=a.workspace.getLayout();t.main={id:"5324373015726ba8",type:"split",children:[{id:"4509724f8bf84da7",type:"tabs",children:[{id:"e7a7b303c61786dc",type:"leaf",state:{type:"empty",state:{},icon:"lucide-file",title:"New tab"}}]}],direction:"vertical"},t.active="e7a7b303c61786dc",await a.workspace.changeLayout(t),E.Platform.isMobile&&(a.workspace.rightSplit?.updateInfo(),Je(a))}function Je(a){let t=a.internalPlugins.plugins.sync?.instance;t&&a.workspace.onLayoutReady(()=>{t.statusIconEl=a.workspace.rightSplit.addHeaderButton("sync-small",t.openStatusIconMenu.bind(t)),t.statusIconEl.addEventListener("contextmenu",t.openStatusIconMenu.bind(t)),t.statusIconEl.addClass("sync-status-icon")})}function ke(a){let t=a.internalPlugins.plugins.sync,e=[new Promise(n=>{let i=async()=>{n(),a.workspace.off("layout-change",i)};a.workspace.on("layout-change",i)})];return t.enabled&&t.instance.syncing&&e.push(new Promise(n=>{let i=async()=>{n(),t.instance.off("status-change",i)};t.instance.on("status-change",i)})),Promise.race([Promise.all(e),new Promise(n=>setTimeout(n,1500))])}var u=$e(Re()),pe={["Daily Note"]:{noun:"day",adjective:"daily",create:u.createDailyNote,get:u.getDailyNote,getAll:u.getAllDailyNotes},["Weekly Note"]:{noun:"week",adjective:"weekly",create:u.createWeeklyNote,get:u.getWeeklyNote,getAll:u.getAllWeeklyNotes},["Monthly Note"]:{noun:"month",adjective:"monthly",create:u.createMonthlyNote,get:u.getMonthlyNote,getAll:u.getAllMonthlyNotes},["Yearly Note"]:{noun:"year",adjective:"yearly",create:u.createYearlyNote,get:u.getYearlyNote,getAll:u.getAllYearlyNotes}},K=["Daily Note","Weekly Note","Monthly Note","Yearly Note"],_e="Date-dependent file",ue="Date-dependent notes in Homepage have been removed. Set your Homepage as a Periodic or Daily Note instead.";async function We(a,t){let e=t.communityPlugins["periodic-notes"],n=pe[a],i=(0,Ie.moment)().startOf(n.noun),o;if(Ye(e)){let s=n.getAll();Object.keys(s).length?o=n.get(i,s)||await n.create(i):o=await n.create(i),o||(o=n.get(i,s))}else e.cache.initialize(),o=e.getPeriodicNote(n.noun,i)||await e.createPeriodicNote(n.noun,i);return D(o)}function Ve(a,t){if(a=="Daily Note"&&t.internalPlugins["daily-notes"]?.enabled)return!0;let e=t.communityPlugins["periodic-notes"];if(!e)return!1;if(Ye(e)){let n=pe[a].adjective;return e.settings[n]?.enabled}else{let n=pe[a].noun;return e?.calendarSetManager?.getActiveSet()[n]?.enabled}}function j(a){let t=a.internalPlugins["daily-notes"];return t?.enabled&&t?.instance.options.autorun}function Ye(a){return(a?.manifest.version||"0").startsWith("0")}var y=require("obsidian");var h=require("obsidian");var z=class extends h.AbstractInputSuggest{getSuggestions(e){let n=this.app.vault.getAllLoadedFiles(),i=[],o=e.toLowerCase();return n.forEach(s=>{s instanceof h.TFile&&["md","canvas"].contains(s.extension)&&s.path.toLowerCase().contains(o)&&i.push(s)}),i}renderSuggestion(e,n){e.extension=="md"?n.setText(D(e)):(n.setText(e.path.slice(0,-7)),n.insertAdjacentHTML("beforeend",''))}selectSuggestion(e){this.textInputEl.value=D(e),this.textInputEl.trigger("input"),this.close()}},q=class extends h.AbstractInputSuggest{getSuggestions(e){let n=e.toLowerCase();return this.app.vault.getAllFolders().filter(i=>i.path.toLowerCase().contains(n))}renderSuggestion(e,n){n.setText(e.path)}selectSuggestion(e){this.textInputEl.value=e.path,this.textInputEl.trigger("input"),this.close()}},G=class extends h.AbstractInputSuggest{getSuggestions(e){let n=Object.keys(this.app.internalPlugins.plugins.workspaces?.instance.workspaces),i=e.toLowerCase();return n.filter(o=>o.toLowerCase().contains(i))}renderSuggestion(e,n){n.setText(e)}selectSuggestion(e){this.textInputEl.value=e,this.textInputEl.trigger("input"),this.close()}},$=class{constructor(t){this.app=t.plugin.app,this.homepage=t.plugin.homepage,this.tab=t,this.container=t.containerEl.createDiv({cls:"nv-command-box"}),this.dropzone=document.createElement("div"),this.dropzone.className="nv-command-pill nv-dropzone",this.dropzone.addEventListener("dragenter",e=>e.preventDefault()),this.dropzone.addEventListener("dragover",e=>e.preventDefault()),this.dropzone.addEventListener("drop",()=>this.terminateDrag()),this.update()}update(){this.container.innerHTML="",this.activeDrag=null,this.activeCommand=null;for(let t of this.homepage.data.commands){let e=this.app.commands.findCommand(t.id),n=this.container.createDiv({cls:"nv-command-pill",attr:{draggable:!0}});n.addEventListener("dragstart",o=>{o.dataTransfer.effectAllowed="move",this.activeCommand=this.homepage.data.commands.splice(this.indexOf(n),1)[0],this.activeDrag=n,this.dropzone.style.width=`${n.clientWidth}px`,this.dropzone.style.height=`${n.clientHeight}px`}),n.addEventListener("dragover",o=>this.moveDropzone(n,o)),n.addEventListener("drop",o=>o.preventDefault()),n.addEventListener("dragend",()=>this.terminateDrag()),n.createSpan({cls:"nv-command-text",text:e?.name??t.id});let i=new h.ButtonComponent(n).setIcon("route").setClass("clickable-icon").setClass("nv-command-period").onClick(o=>this.showMenu(t,o,i));t.period!="Both"&&(i.setClass("nv-command-selected"),i.setIcon(""),i.buttonEl.createSpan({text:t.period})),new h.ButtonComponent(n).setIcon("trash-2").setClass("clickable-icon").setClass("nv-command-delete").onClick(()=>this.delete(t)),e||(n.classList.add("nv-command-invalid"),n.prepend((0,h.getIcon)("ban")),(0,h.setTooltip)(n,"This command can't be found, so it won't be executed. It may belong to a disabled plugin.",{delay:.001}))}new h.ButtonComponent(this.container).setClass("nv-command-add-button").setButtonText("Add...").onClick(()=>{new ge(this.tab).open()})}delete(t){this.homepage.data.commands.remove(t),this.homepage.save(),this.update()}showMenu(t,e,n){let i=new h.Menu;for(let s of Object.values(Q))i.addItem(d=>{d.setTitle(s),d.setChecked(t.period==s),d.onClick(()=>{t.period=s,this.homepage.save(),this.update()})});let o=n.buttonEl.getBoundingClientRect();i.showAtPosition({x:o.x-22,y:o.y+o.height+8})}indexOf(t){return Array.from(this.container.children).indexOf(t)}moveDropzone(t,e){if(!this.activeDrag)return;this.activeDrag.hidden=!0;let n=t.getBoundingClientRect();e.xawait this.copyDebugInfo()})}sanitiseNote(e){return e===null||e.match(/^\s*$/)!==null?null:(0,y.normalizePath)(e)}display(){let e=this.plugin.homepage.data.kind=="Workspace",n=this.plugin.homepage.data.kind,i=j(this.plugin),o=!1,s=z;n=="Random in folder"?s=q:e&&(s=G),this.containerEl.empty(),this.elements={};let d=new y.Setting(this.containerEl).setName("Homepage").addDropdown(async l=>{for(let p of Object.values(_)){if(!this.plugin.hasRequiredPlugin(p))if(p==this.plugin.homepage.data.kind)o=!0;else{l.selectEl.createEl("option",{text:p,attr:{disabled:!0}});continue}l.addOption(p,p)}l.setValue(this.plugin.homepage.data.kind),l.onChange(async p=>{this.plugin.homepage.data.kind=p,p=="Random file"&&(this.plugin.homepage.data.value=""),await this.plugin.homepage.save(),this.display()})});d.settingEl.id="nv-main-setting";let m=d.settingEl.createEl("article",{text:vt[n],attr:{id:"nv-desc"}});o&&m.createDiv({text:"The plugin required for this homepage type isn't available.",cls:"mod-warning"}),fe.includes(n)?d.addText(l=>{l.setDisabled(!0)}):d.addText(l=>{new s(this.app,l.inputEl),l.setPlaceholder(M.value),l.setValue(M.value==this.plugin.homepage.data.value?"":this.plugin.homepage.data.value),l.onChange(async p=>{this.plugin.homepage.data.value=this.sanitiseNote(p)||M.value,await this.plugin.homepage.save()})}),this.addToggle("Open on startup","When launching Obsidian, open the homepage.","openOnStartup",l=>this.display()),i&&(this.elements.openOnStartup.descEl.createDiv({text:`This setting has been disabled, as it isn't compatible with Daily Notes' "Open daily note on startup" functionality. To use it, disable the Daily Notes setting.`,attr:{class:"mod-warning"}}),this.disableSetting("openOnStartup")),this.addToggle("Open when empty","When there are no tabs open, open the homepage.","openWhenEmpty"),this.addToggle("Use when opening normally","Use homepage settings when opening it normally, such as from a link or the file browser.","alwaysApply");let c=new y.Setting(this.containerEl).setName("Separate mobile homepage").setDesc("For mobile devices, store the homepage and its settings separately.").addToggle(l=>l.setValue(this.plugin.settings.separateMobile).onChange(async p=>{this.plugin.settings.separateMobile=p,this.plugin.homepage=this.plugin.getHomepage(),await this.plugin.saveSettings(),this.display()}));if(this.plugin.settings.separateMobile){let l=y.Platform.isMobile?"desktop":"mobile",p=document.createElement("div");c.setClass("nv-mobile-setting"),p.className="mod-warning nv-mobile-info",p.innerHTML=`Mobile settings are stored separately. Therefore, changes to other settings will not affect - ${l} devices. To edit ${l} settings, use a ${l} device.`,c.settingEl.append(p)}this.addHeading("Commands","commandsHeading"),this.containerEl.createDiv({cls:"nv-command-desc setting-item-description",text:"Select commands that will be executed when opening the homepage."}),this.commandBox=new $(this),this.addHeading("Vault environment","vaultHeading"),this.addDropdown("Opening method","Determine how extant tabs and views are affected on startup.","openMode",Z),this.addDropdown("Manual opening method","Determine how extant tabs and views are affected when opening with commands or the ribbon button.","manualOpenMode",Z),this.addToggle("Pin","Pin the homepage when opening.","pin"),this.addToggle("Hide release notes","Never display release notes when Obsidian updates.","hideReleaseNotes"),this.addToggle("Auto-create","When the homepage doesn't exist, create a note with its name.","autoCreate"),this.elements.autoCreate.descEl.createDiv({text:"If this vault is synced using unofficial services, this may lead to content being overwritten.",cls:"mod-warning"}),this.addHeading("Opened view","paneHeading"),this.addDropdown("Homepage view","Choose what view to open the homepage in.","view",he),this.addToggle("Revert view on close","When navigating away from the homepage, restore the default view.","revertView"),this.addToggle("Auto-scroll","When opening the homepage, scroll to the bottom and focus on the last line.","autoScroll"),"dataview"in this.plugin.communityPlugins&&(this.addToggle("Refresh Dataview","Always attempt to reload Dataview views when opening the homepage.","refreshDataview"),this.elements.refreshDataview.descEl.createDiv({text:"Requires Dataview auto-refresh to be enabled.",attr:{class:"mod-warning"}})),y.Platform.isMobile||new y.ButtonComponent(this.containerEl).setButtonText("Copy debug info").setClass("nv-debug-button").onClick(async()=>await this.copyDebugInfo()),(e||n==="Nothing")&&this.disableSettings("openWhenEmpty","alwaysApply","vaultHeading","openMode","manualOpenMode","autoCreate","pin"),(e||["Nothing","Graph view"].includes(n))&&this.disableSettings("paneHeading","view","revertView","autoScroll","refreshDataview"),(!this.plugin.homepage.data.openOnStartup||i)&&this.disableSetting("openMode"),K.includes(this.plugin.homepage.data.kind)&&this.disableSetting("autoCreate")}disableSetting(e){this.elements[e]?.settingEl.setAttribute("nv-greyed","")}disableSettings(...e){e.forEach(n=>this.disableSetting(n))}addHeading(e,n){let i=new y.Setting(this.containerEl).setHeading().setName(e);this.elements[n]=i}addDropdown(e,n,i,o,s){let d=new y.Setting(this.containerEl).setName(e).setDesc(n).addDropdown(async m=>{for(let c of Object.values(o))m.addOption(c,c);m.setValue(this.plugin.homepage.data[i]),m.onChange(async c=>{this.plugin.homepage.data[i]=c,await this.plugin.homepage.save(),s&&s(c)})});return this.elements[i]=d,d}addToggle(e,n,i,o){let s=new y.Setting(this.containerEl).setName(e).setDesc(n).addToggle(d=>d.setValue(this.plugin.homepage.data[i]).onChange(async m=>{this.plugin.homepage.data[i]=m,await this.plugin.homepage.save(),o&&o(m)}));return this.elements[i]=s,s}async copyDebugInfo(){let e=this.app.vault.config,n={...this.settings,_defaultViewMode:e.defaultViewMode||"default",_livePreview:e.livePreview!==void 0?e.livePreview:"default",_focusNewTab:e.focusNewTab!==void 0?e.focusNewTab:"default",_plugins:Object.keys(this.plugin.communityPlugins),_internalPlugins:Object.values(this.plugin.internalPlugins).flatMap(i=>i.enabled?[i.instance.id]:[]),_obsidianVersion:window.electron?.ipcRenderer.sendSync("version")||"unknown"};await navigator.clipboard.writeText(JSON.stringify(n)),new y.Notice("Copied homepage debug information to clipboard")}};var bt=["markdown","canvas","kanban"],V="Main Homepage",Y="Mobile Homepage",Z=(n=>(n.ReplaceAll="Replace all open notes",n.ReplaceLast="Replace last note",n.Retain="Keep open notes",n))(Z||{}),he=(i=>(i.Default="Default view",i.Reading="Reading view",i.Source="Editing view (Source)",i.LivePreview="Editing view (Live Preview)",i))(he||{}),_=(l=>(l.File="File",l.Workspace="Workspace",l.Random="Random file",l.RandomFolder="Random in folder",l.Graph="Graph view",l.None="Nothing",l.DailyNote="Daily Note",l.WeeklyNote="Weekly Note",l.MonthlyNote="Monthly Note",l.YearlyNote="Yearly Note",l))(_||{}),Q=(n=>(n.Both="Both",n.Startup="Startup only",n.Manual="Manual only",n))(Q||{}),fe=["Random file","Graph view","Nothing",...K],W=class{constructor(t,e){this.lastView=void 0;this.openedViews=new WeakMap;this.name=t,this.plugin=e,this.app=e.app;let n=this.plugin.settings.homepages[t];n?this.data=Object.assign({},M,n):(this.plugin.settings.homepages[t]={...M},this.data=this.plugin.settings.homepages[t])}async open(t=!1){if(!this.plugin.hasRequiredPlugin(this.data.kind)){new b.Notice("Homepage cannot be opened due to plugin unavailablity.");return}if(this.data.kind==="Workspace")await this.launchWorkspace();else if(this.data.kind!=="Nothing"){let n=this.plugin.loaded?this.data.manualOpenMode:this.data.openMode;t&&(n="Keep open notes"),await this.launchLeaf(n)}if(this.data.commands.length<1)return;let e=this.plugin.loaded?"Startup only":"Manual only";await ke(this.app);for(let{id:n,period:i}of this.data.commands)i!==e&&this.app.commands.executeCommandById(n)}async launchWorkspace(){let t=this.plugin.internalPlugins.workspaces?.instance;if(!(this.data.value in t.workspaces)){new b.Notice(`Cannot find the workspace "${this.data.value}" to use as the homepage.`);return}t.loadWorkspace(this.data.value),await U(100)}async launchLeaf(t){let e;if(this.computedValue=await this.computeValue(),this.plugin.executing=!0,!(j(this.plugin)&&!this.plugin.loaded)){if(t!=="Replace all open notes"){let n=this.getOpened();if(n.length>0){this.app.workspace.setActiveLeaf(n[0]),await this.configure(n[0]);return}else t=="Keep open notes"&&be(this.app)&&(t="Replace last note")}t!=="Keep open notes"&&this.app.workspace.getActiveViewOfType(b.View)?.leaf.setPinned(!1),t==="Replace all open notes"&&(this.app.workspace?.floatingSplit?.children&&(await U(0),this.app.workspace.floatingSplit.children.forEach(n=>n.win.close())),await Ne(this.app),await U(0)),this.data.kind==="Graph view"?e=await this.launchGraph(t):e=await this.launchNote(t),e&&await this.configure(e)}}async launchGraph(t){if(t==="Keep open notes"){let e=this.app.workspace.getLeaf("tab");this.app.workspace.setActiveLeaf(e)}return this.app.commands.executeCommandById("graph:open"),this.app.workspace.getActiveViewOfType(b.View)?.leaf}async launchNote(t){let e=this.app.metadataCache.getFirstLinkpathDest(this.computedValue,"/");if(!e){if(!this.data.autoCreate){new b.Notice(`Homepage "${this.computedValue}" does not exist.`);return}e=await this.app.vault.create(ye(this.computedValue),"")}let n=await this.app.vault.cachedRead(e),i=this.app.workspace.getLeaf(t=="Keep open notes");return await i.openFile(e),this.app.workspace.setActiveLeaf(i),n!==await this.app.vault.read(e)&&await this.app.vault.modify(e,n),i}async configure(t){this.plugin.executing=!1;let e=t.view;if(!(e instanceof b.MarkdownView)){this.data.pin&&e.leaf.setPinned(!0),this.configurePlugins();return}let n=e.getState();if(this.data.revertView&&(this.lastView=new WeakRef(e)),this.data.autoScroll){let i=e.editor.lineCount();n.mode=="preview"?e.previewMode.applyScroll(i-4):(e.editor.setCursor(i),e.editor.focus())}if(this.data.pin&&e.leaf.setPinned(!0),this.data.view!=="Default view"){switch(this.data.view){case"Editing view (Live Preview)":case"Editing view (Source)":n.mode="source",n.source=this.data.view!="Editing view (Live Preview)";break;case"Reading view":n.mode="preview";break}await e.leaf.setViewState({type:"markdown",state:n})}this.configurePlugins()}configurePlugins(){this.plugin.loaded&&this.data.refreshDataview&&this.plugin.communityPlugins.dataview?.index.touch(),this.plugin.communityPlugins["obsidian-file-color"]?.generateColorStyles()}getOpened(){return this.data.kind=="Graph view"?this.app.workspace.getLeavesOfType("graph"):bt.flatMap(e=>this.app.workspace.getLeavesOfType(e)).filter(e=>{let n=e.view.getState().file;return ae(n.endsWith("md")?n.slice(0,-3):n,this.computedValue)})}async computeValue(){let t=this.data.value,e;switch(this.data.kind){case"Random file":e=ne(this.app),e&&(t=e);break;case"Random in folder":e=ne(this.app,t),e&&(t=e);break;case"Daily Note":case"Weekly Note":case"Monthly Note":case"Yearly Note":t=await We(this.data.kind,this.plugin);break}return t}async save(){this.plugin.settings.homepages[this.name]=this.data,await this.plugin.saveSettings()}async setToActiveFile(){this.data.value=D(this.app.workspace.getActiveFile()),await this.save(),new b.Notice(`The homepage has been changed to "${this.data.value}".`)}canSetToFile(){return this.app.workspace.getActiveFile()!==null&&!fe.includes(this.data.kind)}async revertView(){if(this.lastView==null||this.data.view=="Default view")return;let t=this.lastView.deref();if(!t||ae(D(t.file),this.computedValue))return;let e=t.getState(),n=this.app.vault.config,i=n.defaultViewMode||"source",o=n.livePreview!==void 0?!n.livePreview:!1;t.leaf.getViewState().type=="markdown"&&(i!=e.mode||o!=e.source)&&(e.mode=i,e.source=o,await t.leaf.setViewState({type:"markdown",state:e,active:!0})),this.lastView=void 0}async openWhenEmpty(){if(!this.plugin.loaded||this.plugin.executing)return;let t=this.app.workspace.getActiveViewOfType(b.View)?.leaf;t?.getViewState().type!=="empty"||t.parentSplit.children.length!=1||await this.open(!0)}async apply(){let t=this.app.workspace.getActiveViewOfType(b.FileView);if(!t)return;let e=D(t.file);this.openedViews.get(t)!==e&&(this.openedViews.set(t,e),e===await this.computeValue()&&this.plugin.loaded&&!this.plugin.executing&&await this.configure(t.leaf))}};var Nt='',X=class extends N.Plugin{constructor(){super(...arguments);this.newRelease=!1;this.loaded=!1;this.executing=!1;this.onLayoutChange=async()=>{this.homepage.data.revertView&&await this.homepage.revertView(),this.homepage.data.openWhenEmpty&&await this.homepage.openWhenEmpty(),this.homepage.data.alwaysApply&&await this.homepage.apply()};this.hideInterstitial=()=>{this.interstitial?.detach(),window.removeEventListener("error",this.hideInterstitial)}}async onload(){let e=this.app.workspace.layoutReady;e||this.showInterstitial(),this.patchReleaseNotes(),this.settings=await this.loadSettings(),this.internalPlugins=this.app.internalPlugins.plugins,this.communityPlugins=this.app.plugins.plugins,this.homepage=this.getHomepage(),this.app.workspace.onLayoutReady(async()=>{let n=this.homepage.data.openOnStartup&&!e&&!await this.hasUrlParams();this.patchNewTabPage(),n&&await this.homepage.open(),this.loaded=!0,this.unpatchReleaseNotes(),this.hideInterstitial()}),(0,N.addIcon)("homepage",Nt),this.addRibbonIcon("homepage","Open homepage",n=>this.homepage.open(n.button==1||n.button==2||N.Keymap.isModifier(n,"Mod"))).setAttribute("id","nv-homepage-icon"),this.registerEvent(this.app.workspace.on("layout-change",this.onLayoutChange)),this.addSettingTab(new J(this.app,this)),this.addCommand({id:"open-homepage",name:"Open homepage",callback:()=>this.homepage.open()}),this.addCommand({id:"set-to-active-file",name:"Set to active file",checkCallback:n=>{if(n)return this.homepage.canSetToFile();this.homepage.setToActiveFile()}})}async onunload(){this.app.workspace.off("layout-change",this.onLayoutChange),this.unpatchNewTabPage()}getHomepage(){return this.settings.separateMobile&&N.Platform.isMobile?(Y in this.settings.homepages||(this.settings.homepages[Y]={...this.settings.homepages?.[V]},this.settings.homepages[Y].commands=[...this.settings.homepages?.[V]?.commands]),new W(Y,this)):new W(V,this)}async loadSettings(){let e=await this.loadData();return e?.version!==4?e?this.upgradeSettings(e):Object.assign({},me):e}async saveSettings(){await this.saveData(this.settings)}showInterstitial(){this.interstitial=createDiv({cls:"nv-homepage-interstitial"}),document.body.append(this.interstitial),window.addEventListener("error",this.hideInterstitial)}async hasUrlParams(){let e,n;if(N.Platform.isMobile){let i=await window.Capacitor.Plugins.App.getLaunchUrl();if(!i)return!1;let o=new URL(i.url);n=Array.from(o.searchParams.keys()),e=o.hostname}else if(window.OBS_ACT)n=Object.keys(window.OBS_ACT),e=window.OBS_ACT.action;else return!1;return["open","advanced-uri"].includes(e)&&["file","filepath","workspace"].some(i=>n.includes(i))}hasRequiredPlugin(e){switch(e){case"Workspace":return this.internalPlugins.workspaces?.enabled;case"Graph view":return this.internalPlugins.graph?.enabled;case"Daily Note":case"Weekly Note":case"Monthly Note":case"Yearly Note":return Ve(e,this);default:return!0}}patchNewTabPage(){let e=this.communityPlugins["new-tab-default-page"];e&&(e.nvOrig_checkForNewTab=e.checkForNewTab,e.checkForNewTab=async n=>{if(!(this&&this.executing))return await e.nvOrig_checkForNewTab(n)})}unpatchNewTabPage(){let e=this.communityPlugins["new-tab-default-page"];e&&(e.checkForNewTab=e._checkForNewTab)}patchReleaseNotes(){this.app.nvOrig_showReleaseNotes=this.app.showReleaseNotes,this.app.showReleaseNotes=()=>this.newRelease=!0}unpatchReleaseNotes(){this.newRelease&&!this.homepage.data.hideReleaseNotes&&this.app.nvOrig_showReleaseNotes(),this.app.showReleaseNotes=this.app.nvOrig_showReleaseNotes}upgradeSettings(e){if(e.version==3){let i=e,o=!1;for(let s of Object.values(i.homepages))s.commands=s.commands.map(d=>({id:d,period:"Both"})),s.kind==_e&&(o=!0,s.kind="Daily Note");return o&&new N.Notice(ue),i.version=4,this.saveData(i),i}let n=Object.assign({},me);return e.workspaceEnabled?(e.value=e.workspace,e.kind="Workspace"):e.momentFormat?(e.kind="Daily Note",new N.Notice(ue)):(e.value=e.defaultNote,e.kind="File"),e.commands=[],delete e.workspace,delete e.momentFormat,delete e.defaultNote,delete e.useMoment,delete e.workspaceEnabled,n.homepages[V]=e,this.saveData(n),n}}; - -/* nosourcemap */ \ No newline at end of file diff --git a/content/notes/.obsidian/plugins/homepage/manifest.json b/content/notes/.obsidian/plugins/homepage/manifest.json deleted file mode 100644 index 1fd2495..0000000 --- a/content/notes/.obsidian/plugins/homepage/manifest.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "id": "homepage", - "name": "Homepage", - "version": "4.1", - "minAppVersion": "1.4.10", - "description": "Open a specified note, canvas, or workspace on startup, or set it for quick access later.", - "author": "novov", - "authorUrl": "https://novov.me", - "isDesktopOnly": false, - "fundingUrl": { - "Ko-fi": "https://ko-fi.com/novov" - } -} diff --git a/content/notes/.obsidian/plugins/homepage/styles.css b/content/notes/.obsidian/plugins/homepage/styles.css deleted file mode 100644 index 4f36ca3..0000000 --- a/content/notes/.obsidian/plugins/homepage/styles.css +++ /dev/null @@ -1,238 +0,0 @@ -.nv-homepage-interstitial { - position: absolute; - left: 0; - top: 0; - width: 100vw; - height: 100vh; - background: var(--background-primary); - z-index: 9999; - animation: 0.02s ease-in 0.5s forwards nv-interstitial-destroy; - pointer-events: none; -} - -@keyframes nv-interstitial-destroy { - from { opacity: 1; } - to { opacity: 0; } -} - -.setting-item[nv-greyed] { - opacity: .5; - pointer-events: none !important; -} - -#nv-main-setting { - flex-wrap: wrap; - margin-bottom: 30px; -} - -#nv-main-setting .setting-item-control { - padding-top: var(--size-4-2); - flex-basis: 100%; - align-items: stretch; -} - -#nv-main-setting .setting-item-control input, #nv-main-setting .setting-item-control select { - font-size: var(--font-ui-medium); - font-weight: 600; -} - -#nv-main-setting .setting-item-control select { - padding: var(--size-4-3) var(--size-4-4); - padding-right: var(--size-4-8); - height: auto; -} - -#nv-main-setting .setting-item-control input { - flex-grow: 1; - padding: var(--size-4-5) var(--size-4-4); -} - -#nv-main-setting .setting-item-control input[disabled] { - opacity: 0.3; -} - -#nv-main-setting #nv-desc, #nv-main-setting #nv-info { - flex-basis: 100%; -} - -#nv-main-setting #nv-desc { - font-weight: 500; - color: var(--text-normal); - font-size: var(--font-ui-small); - padding: 10px 0 0; -} - -#nv-main-setting #nv-desc.mod-warning { - color: var(--text-error); -} - -#nv-main-setting #nv-desc code { - font-family: var(--font-monospace); - font-size: var(--font-smaller); - border-radius: var(--radius-s); -} - -#nv-main-setting #nv-desc small { - display: block; - font-weight: 400; - color: var(--text-muted); - font-size: calc(var(--font-ui-smaller) * 0.9); - padding: 5px 0 0; -} - -.nv-mobile-setting { - flex-wrap: wrap; - row-gap: var(--size-2-2); -} - -.nv-mobile-setting .nv-mobile-info { - font-size: var(--font-ui-smaller); - width: 100%; - margin-right: var(--size-4-18); -} - -.nv-command-desc { - padding: 1.2em 0 0; - border-top: 1px solid var(--background-modifier-border); -} - -.nv-command-box { - margin: 1em 0 1.75em; - display: flex; - flex-wrap: wrap; - gap: 12px; - align-items: center; -} - -.nv-command-pill { - background-color: var(--background-secondary); - border: 1px solid var(--background-modifier-border-hover); - border-radius: var(--radius-s); - font-size: var(--font-ui-small); - padding: var(--size-2-1) var(--size-2-2) var(--size-2-1) var(--size-2-3) ; -} - -.nv-command-pill.nv-command-invalid { - color: var(--text-faint); -} - -.nv-command-pill button { - display: inline-block; - padding: 0; - margin: 0 0 0 3px; - vertical-align: bottom; -} - -.nv-command-pill button:first-of-type { - margin-left: var(--size-4-2); -} - -.nv-command-pill button.nv-command-selected { - margin-left: var(--size-2-2); - padding: 0 var(--size-2-1); -} - -.nv-command-pill button.nv-command-selected span { - color: var(--text-accent); - display: inline-block; - font-size: 0.9em; - vertical-align: top; - position: relative; - top: -1px; -} - -.nv-command-pill > .svg-icon, .nv-command-pill button .svg-icon { - height: 1em; - width: 1em; -} - -.nv-command-pill > .svg-icon { - vertical-align: text-bottom; - position: relative; - margin: 0 var(--size-2-1) 0 0; -} - -.nv-command-pill.nv-dragging { - background-color: transparent; -} - -.nv-command-add-button { - font-size: var(--font-ui-small); - padding: var(--size-2-2) var(--size-4-2); - height: auto; -} - -#nv-main-setting + .setting-item, .nv-command-desc + .setting-item { - padding-top: 20px; - border-top: none !important; -} - -.nv-debug-button { - margin: 3em 0 -0.2em; - font-size: var(--font-ui-smaller); - padding: 0; - height: auto; - float: right; - box-shadow: none !important; - background: none !important; - color: var(--text-accent); - font-weight: 600; - cursor: pointer; -} - -.nv-debug-button:hover, .nv-debug-button:active { - text-decoration: underline; -} - -.is-phone #nv-main-setting .setting-item-control { - flex-wrap: wrap; - justify-content: flex-start; -} - -.is-phone #nv-main-setting .setting-item-control select { - width: auto; - max-width: auto; -} - -.is-phone .nv-mobile-setting { - row-gap: var(--size-4-2); -} - -.is-phone .nv-mobile-setting .setting-item-info { - max-width: calc(100% - 100px); -} - -.is-phone .nv-mobile-setting { - row-gap: var(--size-4-2); -} - -.is-phone .nv-mobile-setting .setting-item-info { - max-width: calc(100% - 100px); -} - -.is-phone .nv-command-pill { - width: 100%; - border: none; - background: none; - padding: 0 0 var(--size-4-2); - display: flex; - gap: var(--size-4-4); - align-items: baseline; -} - -.is-phone .nv-command-pill .nv-command-text { - flex-grow: 1; - overflow: hidden; - text-overflow: ellipsis; -} - -.is-phone .nv-command-pill, .is-phone .nv-command-add-button { - font-size: var(--font-ui-medium); - justify-content: space-between; -} - -.is-phone .nv-command-pill button { - line-height: var(--font-ui-medium); - height: 100%; - margin: 0 !important; -} diff --git a/content/notes/.obsidian/plugins/obsidian-link-converter/data.json b/content/notes/.obsidian/plugins/obsidian-link-converter/data.json new file mode 100644 index 0000000..11f0767 --- /dev/null +++ b/content/notes/.obsidian/plugins/obsidian-link-converter/data.json @@ -0,0 +1,6 @@ +{ + "mySetting": "default", + "contextMenu": true, + "finalLinkFormat": "relative-path", + "keepMtime": false +} \ No newline at end of file diff --git a/content/notes/.obsidian/plugins/obsidian-link-converter/main.js b/content/notes/.obsidian/plugins/obsidian-link-converter/main.js new file mode 100644 index 0000000..2fa5917 --- /dev/null +++ b/content/notes/.obsidian/plugins/obsidian-link-converter/main.js @@ -0,0 +1,4 @@ +"use strict";var t=require("obsidian");function e(t,e,i,n){return new(i||(i=Promise))((function(o,a){function l(t){try{r(n.next(t))}catch(t){a(t)}}function s(t){try{r(n.throw(t))}catch(t){a(t)}}function r(t){var e;t.done?o(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(l,s)}r((n=n.apply(t,e||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const i={mySetting:"default",contextMenu:!0,finalLinkFormat:"not-change",keepMtime:!1};class n extends t.PluginSettingTab{constructor(t,e){super(t,e),this.plugin=e}display(){let{containerEl:e}=this;e.empty(),e.createEl("h2",{text:"Obsidian Link Converter"}),new t.Setting(e).setName("File Context Menu").setDesc("Turn this option off if you don't want single file commands to appear within the file context menu").addToggle((t=>{t.setValue(this.plugin.settings.contextMenu).onChange((t=>{this.plugin.settings.contextMenu=t,this.plugin.saveSettings(),t?this.plugin.app.workspace.on("file-menu",this.plugin.addFileMenuItems):this.plugin.app.workspace.off("file-menu",this.plugin.addFileMenuItems)}))})),new t.Setting(e).setName("Converted Link Format").setDesc("Select the preferred option for the final link format after the conversion. Plugin will use the preferrence where possible").addDropdown((t=>{t.addOption("not-change","Do not change").addOption("relative-path","Relative Path").addOption("absolute-path","Absolute Path").addOption("shortest-path","Shortest Path").setValue(this.plugin.settings.finalLinkFormat).onChange((t=>{this.plugin.settings.finalLinkFormat=t,this.plugin.saveSettings()}))})),new t.Setting(e).setName("Keep mTime (Last Modified Time)").setDesc("Turn on this option if you want plugin to keep the mtime of files same during the link conversion").addToggle((t=>t.setValue(this.plugin.settings.keepMtime).onChange((t=>{this.plugin.settings.keepMtime=t,this.plugin.saveSettings()}))));const i=e.createDiv("coffee");i.addClass("oz-coffee-div");i.createEl("a",{href:"https://ko-fi.com/L3L356V6Q"}).createEl("img",{attr:{src:"https://cdn.ko-fi.com/cdn/kofi2.png?v=3"}}).height=45}}const o=(t,i)=>e(void 0,void 0,void 0,(function*(){const e=[];let n=yield i.app.vault.read(t),o=n.match(/\[\[.*?\]\]/g);if(o){let i=/(?<=\[\[).*?(?=(\]|\|))/,n=/(?<=\|).*(?=]])/;for(let a of o){if(M(a)){let i=x(a),n=A(a);if(""!==i&&""!==n){let o={type:"wikiTransclusion",match:a,linkText:i,altOrBlockRef:n,sourceFilePath:t.path};e.push(o);continue}}let o=a.match(i);if(o){if(o[0].startsWith("http"))continue;let i=a.match(n),l={type:"wiki",match:a,linkText:o[0],altOrBlockRef:i?i[0]:"",sourceFilePath:t.path};e.push(l)}}}let a=n.match(/\[(^$|.*?)\]\((.*?)\)/g);if(a){let i=/(?<=\().*(?=\))/,n=/(?<=\[)(^$|.*?)(?=\])/;for(let o of a){if(y(o)){let i=x(o),n=A(o);if(""!==i&&""!==n){let a={type:"mdTransclusion",match:o,linkText:i,altOrBlockRef:n,sourceFilePath:t.path};e.push(a);continue}}let a=o.match(i);if(a){if(a[0].startsWith("http"))continue;let i=o.match(n),l={type:"markdown",match:o,linkText:a[0],altOrBlockRef:i?i[0]:"",sourceFilePath:t.path};e.push(l)}}}return e})),a=(i,n,o)=>e(void 0,void 0,void 0,(function*(){let e=yield n.app.vault.read(i),a="markdown"===o?yield c(e,i,n):yield h(e,i,n),l=n.settings.keepMtime?yield n.app.vault.adapter.stat(t.normalizePath(i.path)):{};yield n.app.vault.modify(i,a,l)})),l=(i,n)=>e(void 0,void 0,void 0,(function*(){let e=i.app.workspace.getActiveFile();"md"===e.extension?yield a(e,i,n):new t.Notice("Active File is not a Markdown File")})),s=(i,n,o)=>e(void 0,void 0,void 0,(function*(){let e=((e,i)=>{var n=[];return function e(i,o){var a=o.vault.getAbstractFileByPath(i);if(a instanceof t.TFolder&&a.children)for(let i of a.children)i instanceof t.TFile&&"md"===i.extension&&n.push(i),i instanceof t.TFolder&&e(i.path,o)}(e,i.app),n})(i.path,n),l=new t.Notice("Starting link conversion",0);try{let t=e.length,i=0;for(let s of e)i++,l.setMessage(`Converting the links in notes ${i}/${t}.`),d(n.app,s.path,"excalidraw-plugin")||d(n.app,s.path,"kanban-plugin")||(yield a(s,n,o))}catch(t){console.log(t)}finally{l.hide()}})),r=(i,n)=>e(void 0,void 0,void 0,(function*(){let e=n.app.workspace.getActiveViewOfType(t.MarkdownView);if(e){let o=e.editor,a=o.getSelection(),l=e.file;if(""!==a){let t;"markdown"===i?t=yield c(a,l,n):"wiki"===i&&(t=yield h(a,l,n)),o.replaceSelection(t)}else new t.Notice("You didn't select any text.")}else new t.Notice("There is no active leaf open.",3e3)})),C=(t,i)=>e(void 0,void 0,void 0,(function*(){s(t.app.vault.getRoot(),t,i)})),d=(t,e,i)=>{let n=t.metadataCache.getCache(e);return n.frontmatter&&n.frontmatter[i]},c=(t,i,n)=>e(void 0,void 0,void 0,(function*(){let e=t,a=yield o(i,n),l=a.filter((t=>"wiki"===t.type));for(let t of l){let o=p("markdown",t.linkText,t.altOrBlockRef,i,n);e=e.replace(t.match,o)}let s=a.filter((t=>"wikiTransclusion"===t.type));for(let t of s){let o=p("mdTransclusion",t.linkText,t.altOrBlockRef,i,n);e=e.replace(t.match,o)}return e})),h=(t,i,n)=>e(void 0,void 0,void 0,(function*(){let e=t,a=yield o(i,n),l=a.filter((t=>"markdown"===t.type));for(let t of l){let o=p("wiki",t.linkText,t.altOrBlockRef,i,n);e=e.replace(t.match,o)}let s=a.filter((t=>"mdTransclusion"===t.type));for(let t of s){let o=p("wikiTransclusion",t.linkText,t.altOrBlockRef,i,n);e=e.replace(t.match,o)}return e})),L=(t,e,i,n)=>{let o;if("absolute-path"===n)o=t.path;else if("relative-path"===n)o=function(t,e){function i(t){let e=0;for(;e=0&&""===t[i];i--);return e>i?[]:t.slice(e,i-e+1)}for(var n=i(t.split("/")),o=i(e.split("/")),a=Math.min(n.length,o.length),l=a,s=0;se.name===t.name)).length>1?t.path:t.name}return o.endsWith(".md")&&(o=o.replace(".md","")),o},p=(t,e,i,n,o)=>{let a,l=e,s=decodeURI(l),r=o.app.metadataCache.getFirstLinkpathDest(s,n.path);r&&"not-change"!==o.settings.finalLinkFormat&&(l=L(r,n,o,o.settings.finalLinkFormat));const C=r&&"md"===r.extension?`.${r.extension}`:"";if("wiki"===t)return a=""!==i&&i!==decodeURI(l)?r&&decodeURI(i)===r.basename?"":"|"+i:"",`[[${decodeURI(l)}${a}]]`;if("markdown"===t)return a=""!==i?i:r?r.basename:l,`[${a}](${u(l)}${C})`;if("wikiTransclusion"===t)return`[[${decodeURI(l)}#${decodeURI(i)}]]`;if("mdTransclusion"===t){let t=i;return i.startsWith("^")?(t=u(t.slice(1)),t=`^${t}`):t=u(t),`[](${u(l)}${C}#${t})`}return""};function u(t){return t.replace(/[\\\x00\x08\x0B\x0C\x0E-\x1F ]/g,(t=>encodeURIComponent(t)))}const f=/\[\[(.*?)#.*?\]\]/,k=/(?<=\[\[)(.*)(?=#)/,m=/(?<=#).*?(?=]])/,g=/\[.*?]\((.*?)#.*?\)/,v=/(?<=\]\()(.*)(?=#)/,w=/(?<=#).*?(?=\))/,M=t=>f.test(t),y=t=>g.test(t),x=t=>{let e=f.test(t),i=g.test(t);if(e||i){let i=t.match(e?k:v);if(i)return i[0]}return""},A=t=>{let e=f.test(t),i=g.test(t);if(e||i){let i=t.match(e?m:w);if(i)return i[0]}return""};class F extends t.Modal{constructor(t,e,i){super(t),this.message=e,this.callback=i}onOpen(){let{contentEl:t}=this,e=t.createEl("div");e.addClass("oz-modal-center"),e.innerHTML=`\n
\n

Link Converter Plugin

\n
\n

${this.message}

\n `,t.createEl("button",{text:"Continue"}).addEventListener("click",(()=>{this.callback(),this.close()}));const i=t.createEl("button",{text:"Cancel"});i.style.cssText="float: right;",i.addEventListener("click",(()=>this.close()))}}class T extends t.FuzzySuggestModal{constructor(t,e){super(t.app),this.plugin=t,this.finalFormat=e}getItemText(t){return t.path}getItems(){return function(e){let i=[],n=e.vault.getRoot();function o(e){for(let n of e.children)if(n instanceof t.TFolder){let t=n;i.push(t),t.children&&o(t)}}return i.push(n),o(n),i}(this.app)}onChooseItem(t,e){let i=`Are you sure you want to convert all \n ${"wiki"===this.finalFormat?"Markdown Links to Wikilinks":"Wikilinks to Markdown Links"} \n under ${t.name}?`;new F(this.app,i,(()=>s(t,this.plugin,this.finalFormat))).open()}}class z extends t.Plugin{constructor(){super(...arguments),this.addFileMenuItems=(i,n)=>{if(n instanceof t.TFile&&"md"===n.extension){if(i.addSeparator(),i.addItem((t=>{t.setTitle("Markdown Links to Wiki").setIcon("bracketIcon").onClick((()=>a(n,this,"wiki")))})),i.addItem((t=>{t.setTitle("WikiLinks to Markdown").setIcon("markdownIcon").onClick((()=>a(n,this,"markdown")))})),"not-change"!==this.settings.finalLinkFormat){let a=this.settings.finalLinkFormat;i.addItem((i=>{i.setTitle("All Links to "+("absolute-path"===a?"Absolute Path":"shortest-path"===a?"Shortest Path":"Relative Path")).setIcon("linkEditIcon").onClick((()=>((i,n,a)=>e(void 0,void 0,void 0,(function*(){let e=yield n.app.vault.read(i),l=yield o(i,n);for(let t of l){let o=decodeURI(t.linkText),l=n.app.metadataCache.getFirstLinkpathDest(o,t.sourceFilePath);l&&(o=L(l,i,n,a),e=e.replace(t.match,p(t.type,o,t.altOrBlockRef,i,n)))}let s=n.settings.keepMtime?yield n.app.vault.adapter.stat(t.normalizePath(i.path)):{};yield n.app.vault.modify(i,e,s)})))(n,this,a)))}))}i.addSeparator()}}}onload(){return e(this,void 0,void 0,(function*(){console.log("Link Converter Loading..."),t.addIcon("bracketIcon",''),t.addIcon("markdownIcon",''),t.addIcon("linkEditIcon",' '),yield this.loadSettings(),this.addSettingTab(new n(this.app,this)),this.addCommand({id:"convert-wikis-to-md-in-active-file",name:"Active File: Links to Markdown",callback:()=>{l(this,"markdown")}}),this.addCommand({id:"convert-md-to-wikis-in-active-file",name:"Active File: Links to Wiki",callback:()=>{l(this,"wiki")}}),this.addCommand({id:"convert-wikis-to-md-in-vault",name:"Vault: Links to Markdown",callback:()=>{new F(this.app,"Are you sure you want to convert all Wikilinks to Markdown Links?",(()=>C(this,"markdown"))).open()}}),this.addCommand({id:"convert-mdlinks-to-wiki-in-vault",name:"Vault: Links to Wiki",callback:()=>{new F(this.app,"Are you sure you want to convert all Markdown Links to Wikilinks?",(()=>C(this,"wiki"))).open()}}),this.addCommand({id:"convert-wikis-to-mdlink-under-folder",name:"Certain Folder: Links to Markdown",callback:()=>{new T(this,"markdown").open()}}),this.addCommand({id:"convert-mdlinks-to-wikis-under-folder",name:"Certain Folder: Links to Wiki",callback:()=>{new T(this,"wiki").open()}}),this.addCommand({id:"convert-wikis-to-mdlinks-within-selection",name:"Editor Selection: Links to Markdown",callback:()=>e(this,void 0,void 0,(function*(){return r("markdown",this)}))}),this.addCommand({id:"convert-mdlinks-to-wiki-within-selection",name:"Editor Selection: Links to Wiki",callback:()=>e(this,void 0,void 0,(function*(){return r("wiki",this)}))}),this.settings.contextMenu&&this.app.workspace.on("file-menu",this.addFileMenuItems)}))}onunload(){console.log("Link Converter Unloading..."),this.app.workspace.off("file-menu",this.addFileMenuItems)}loadSettings(){return e(this,void 0,void 0,(function*(){this.settings=Object.assign({},i,yield this.loadData())}))}saveSettings(){return e(this,void 0,void 0,(function*(){yield this.saveData(this.settings)}))}}module.exports=z; + + +/* nosourcemap */ \ No newline at end of file diff --git a/content/notes/.obsidian/plugins/obsidian-link-converter/manifest.json b/content/notes/.obsidian/plugins/obsidian-link-converter/manifest.json new file mode 100644 index 0000000..a2c8d73 --- /dev/null +++ b/content/notes/.obsidian/plugins/obsidian-link-converter/manifest.json @@ -0,0 +1,10 @@ +{ + "id": "obsidian-link-converter", + "name": "Link Converter", + "version": "0.1.6", + "minAppVersion": "0.9.12", + "description": "Scan all your links in the vault and convert them to your desired format.", + "author": "Ozan Tellioglu", + "authorUrl": "https://ozan.pl", + "isDesktopOnly": false +} diff --git a/content/notes/.obsidian/plugins/obsidian-link-converter/styles.css b/content/notes/.obsidian/plugins/obsidian-link-converter/styles.css new file mode 100644 index 0000000..bbd6b7f --- /dev/null +++ b/content/notes/.obsidian/plugins/obsidian-link-converter/styles.css @@ -0,0 +1,4 @@ +.oz-coffee-div { + text-align: center; + margin-top: 20px; +} diff --git a/content/notes/.obsidian/workspace.json b/content/notes/.obsidian/workspace.json index 9835a32..fb6f6a7 100644 --- a/content/notes/.obsidian/workspace.json +++ b/content/notes/.obsidian/workspace.json @@ -1,24 +1,24 @@ { "main": { - "id": "707cdff055641daf", + "id": "5324373015726ba8", "type": "split", "children": [ { - "id": "4ff646379bdc32f1", + "id": "4509724f8bf84da7", "type": "tabs", "children": [ { - "id": "41d42d82984d27da", + "id": "e7a7b303c61786dc", "type": "leaf", "state": { "type": "markdown", "state": { - "file": "drafts/lua.md", + "file": "ready/algorithms_and_data/index.md", "mode": "source", "source": false }, "icon": "lucide-file", - "title": "lua" + "title": "index" } } ] @@ -27,16 +27,15 @@ "direction": "vertical" }, "left": { - "id": "8554fcd8146aea7c", + "id": "eb9752450aad8905", "type": "split", "children": [ { - "id": "65145a8fc625fc73", + "id": "4162aa8f7241215d", "type": "tabs", - "dimension": 66.13756613756614, "children": [ { - "id": "3e60316ef665bcea", + "id": "b73f137a8a755c19", "type": "leaf", "state": { "type": "file-explorer", @@ -49,7 +48,7 @@ } }, { - "id": "66bab8cc98ffff03", + "id": "9326f66eb4ea3558", "type": "leaf", "state": { "type": "search", @@ -66,7 +65,7 @@ } }, { - "id": "9febdd5b0820c714", + "id": "22ea3aa7ebecbacb", "type": "leaf", "state": { "type": "bookmarks", @@ -76,44 +75,26 @@ } } ] - }, - { - "id": "e6a895c667054857", - "type": "tabs", - "dimension": 33.86243386243386, - "children": [ - { - "id": "f7c232306fce05bc", - "type": "leaf", - "state": { - "type": "graph", - "state": {}, - "icon": "lucide-git-fork", - "title": "Graph view" - } - } - ] } ], "direction": "horizontal", - "width": 284.5110321044922 + "width": 300 }, "right": { - "id": "65640e3e4a22a762", + "id": "f049c1d8215eafd9", "type": "split", "children": [ { - "id": "c2a2b4ff04865342", + "id": "0455a82f86b09797", "type": "tabs", "children": [ { - "id": "5a238d79ee59fbda", + "id": "3a41ad6c5fed23f5", "type": "leaf", "state": { "type": "backlink", "state": { - "file": "binary-operations/index.md", - "collapseAll": true, + "collapseAll": false, "extraContext": false, "sortOrder": "alphabetical", "showSearch": false, @@ -122,11 +103,11 @@ "unlinkedCollapsed": true }, "icon": "links-coming-in", - "title": "Backlinks for index" + "title": "Backlinks" } }, { - "id": "0bf5145fd219badf", + "id": "4a36bf58b19c0cce", "type": "leaf", "state": { "type": "outgoing-link", @@ -139,7 +120,7 @@ } }, { - "id": "f07e471ad3a546d5", + "id": "adbc09def111b239", "type": "leaf", "state": { "type": "tag", @@ -154,7 +135,7 @@ } }, { - "id": "6e617d9f3ccf8c06", + "id": "91a2b2f8427bd50b", "type": "leaf", "state": { "type": "outline", @@ -166,23 +147,13 @@ "icon": "lucide-list", "title": "Outline" } - }, - { - "id": "30cd499d012a4255", - "type": "leaf", - "state": { - "type": "advanced-tables-toolbar", - "state": {}, - "icon": "spreadsheet", - "title": "Advanced Tables" - } } - ], - "currentTab": 3 + ] } ], "direction": "horizontal", - "width": 218.5 + "width": 300, + "collapsed": true }, "left-ribbon": { "hiddenItems": { @@ -194,56 +165,33 @@ "command-palette:Open command palette": false, "obsidian-importer:Open Importer": false, "table-editor-obsidian:Advanced Tables Toolbar": false, - "obsidian-local-images-plus:Local Images Plus 0.16.3\r\nLocalize attachments (plugin folder)": false + "homepage:Open homepage": false } }, - "active": "f7c232306fce05bc", + "active": "e7a7b303c61786dc", "lastOpenFiles": [ - "drafts/lua.md", - "drafts/linux_architecture/index.md", - "index/index.md", - "Untitled", - "TODO.md", - "temp/pngwing.com.png", - "temp/nix.svg", - "temp/image93.png", - "temp/windows-11-icon-logo-png_seeklogo-406208.png", - "temp/js.png", - "ready/python.md", - "ready/http.md", - "ready/ssh.md", - "ready/pass.md", - "ready/wsl2.md", - "ready/https-ssl-certs.md", - "drafts/macOS.md", - "ready/html.md", - "ready/irc.md", + "ready/binary_operations/index.md", + "ready/cpu_architecture/index.md", + "ready/databases/index.md", + "ready/logic_gates/index.md", + "ready/memory/index.md", + "ready/tmux/index.md", + "ready/transistors/index.md", + "ready/c-language.md", + "ready/c-snippets.md", + "ready/compiling.md", + "ready/diodes.md", "ready/encryption.md", "ready/flask.md", - "ready/compiling.md", - "ready/git.md", - "ready/diodes.md", "ready/gdb.md", - "ready/c-snippets.md", - "ready/c-language.md", - "drafts/assembly.md", - "ready/algorithms-and-data/index.md", - "temp/freebsd.png", - "temp/py.webp", - "ready/binary-operations/index.md", - "ready/binary-operations/image75.png", - "ready/binary-operations/image74.png", - "ready/binary-operations/image68.png", - "drafts/linux/index.md", - "ready/tmux/index.md", - "drafts", - "ready/databases", - "ready/logic_gates", - "ready/memory", - "ready", - "ready/cpu_architecture", - "index", - "drafts/_Templates", - "ready/tmux" + "ready/git.md", + "ready/html.md", + "ready/http.md", + "ready/https-ssl-certs.md", + "ready/irc.md", + "ready/pass.md", + "ready/python.md", + "ready/ssh.md", + "ready/wsl2.md" ] } \ No newline at end of file diff --git a/content/notes/drafts/_Templates/base.md b/content/notes/drafts/_Templates/base.md index 1b92782..1f47418 100644 --- a/content/notes/drafts/_Templates/base.md +++ b/content/notes/drafts/_Templates/base.md @@ -1,7 +1,6 @@ --- title: "{{Title}}" description: -date: "{{date:YYYY-MM-DD}}T{{time:HH:mm:ss}}+00:00" draft: true tags: author: TrudeEH diff --git a/content/notes/drafts/linux/index.md b/content/notes/drafts/linux/index.md index 827c325..1d8229d 100644 --- a/content/notes/drafts/linux/index.md +++ b/content/notes/drafts/linux/index.md @@ -22,7 +22,7 @@ sudo journalctl -b -1 -r -p err The exact steps to fully encrypt a disk varies depending on the distribution, and can only be done at the install time. On Ubuntu, for example, you can enable it in the "Advanced Features" toggle, at the disk selection stage. -![[image93.png]] +![image93.png](image93.png) ### Encrypt Home Directory diff --git a/content/notes/drafts/linux_architecture/index.md b/content/notes/drafts/linux_architecture/index.md index cbddac9..263b860 100644 --- a/content/notes/drafts/linux_architecture/index.md +++ b/content/notes/drafts/linux_architecture/index.md @@ -38,7 +38,7 @@ This snippet implements a syscall that prints text to `stdout`, usually a termin ### Processes A program is an executable containing machine code. When a computer executes a program, it is first loaded into memory. -![[image5.png]] +![image5](image5.png) A program loaded in memory is a process. > Note: For interpreted languages, the interpreter creates a process that executes the code directly. @@ -90,7 +90,7 @@ Uses linked lists to store and lookup data, to keep the implementation of the fi #### Partition Layout -![[EXT2.png]] +![EXT2](EXT2.png) ### EXT3 @@ -100,7 +100,7 @@ Uses linked lists to store and lookup data, to keep the implementation of the fi #### HTrees -`EXT3` can also use a [[ready/algorithms-and-data/index]] instead of a linked list to store directory entries, making lookup times much faster. To build the HTree, all filenames are hashed and ordered, making the implementation more complex. This feature is disabled by default. +`EXT3` can also use a [index](ready/algorithms_and_data/index.md) instead of a linked list to store directory entries, making lookup times much faster. To build the HTree, all filenames are hashed and ordered, making the implementation more complex. This feature is disabled by default. #### Scalability @@ -111,10 +111,10 @@ These patches improved multicore performance by over 10x. #### Preallocation / Reservation Writing two files simultaneously can create noncontinuous space. -![[image6.png]] +![image6](image6.png) Because `EXT3` was designed to be used with HDDs, and separate portions of a file would slow down read speeds, `EXT3` implemented a preallocation/reservation system. Inside the block bitmap, a few extra blocks were preallocated, storing both files in separate locations. -![[image7.png]] +![image7](image7.png) Instead of `EXT2`, where errors were corrected directly in the hard drive, `EXT3` reserves space for each specific `inode` in memory. In the event of a crash, all data would be stored in memory, and thus, not corrupting the HDD itself. #### Online Resizer @@ -123,7 +123,7 @@ Instead of `EXT2`, where errors were corrected directly in the hard drive, `EXT3 #### Partition Layout -![[EXT3.png]] +![EXT3](EXT3.png) ### EXT4 diff --git a/content/notes/index/index.md b/content/notes/index/index.md deleted file mode 100644 index bc4be6c..0000000 --- a/content/notes/index/index.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -tags: - - index -author: TrudeEH -draft: false -showToc: false -title: Notes Index -searchHidden: true ---- -TODO diff --git a/content/notes/ready/algorithms-and-data/bigO.png b/content/notes/ready/algorithms_and_data/bigO.png similarity index 100% rename from content/notes/ready/algorithms-and-data/bigO.png rename to content/notes/ready/algorithms_and_data/bigO.png diff --git a/content/notes/ready/algorithms-and-data/index.md b/content/notes/ready/algorithms_and_data/index.md similarity index 99% rename from content/notes/ready/algorithms-and-data/index.md rename to content/notes/ready/algorithms_and_data/index.md index acb4753..307fa12 100644 --- a/content/notes/ready/algorithms-and-data/index.md +++ b/content/notes/ready/algorithms_and_data/index.md @@ -1,7 +1,6 @@ --- title: Algorithms & Data Structures description: -date: 2025-02-17T08:52:10+00:00 draft: false tags: - c diff --git a/content/notes/ready/algorithms-and-data/trie.png b/content/notes/ready/algorithms_and_data/trie.png similarity index 100% rename from content/notes/ready/algorithms-and-data/trie.png rename to content/notes/ready/algorithms_and_data/trie.png diff --git a/content/notes/ready/binary-operations/addition.png b/content/notes/ready/binary_operations/addition.png similarity index 100% rename from content/notes/ready/binary-operations/addition.png rename to content/notes/ready/binary_operations/addition.png diff --git a/content/notes/ready/binary-operations/binarycalc.png b/content/notes/ready/binary_operations/binarycalc.png similarity index 100% rename from content/notes/ready/binary-operations/binarycalc.png rename to content/notes/ready/binary_operations/binarycalc.png diff --git a/content/notes/ready/binary-operations/hand_addition1.png b/content/notes/ready/binary_operations/hand_addition1.png similarity index 100% rename from content/notes/ready/binary-operations/hand_addition1.png rename to content/notes/ready/binary_operations/hand_addition1.png diff --git a/content/notes/ready/binary-operations/hand_addition2.png b/content/notes/ready/binary_operations/hand_addition2.png similarity index 100% rename from content/notes/ready/binary-operations/hand_addition2.png rename to content/notes/ready/binary_operations/hand_addition2.png diff --git a/content/notes/ready/binary-operations/image68.png b/content/notes/ready/binary_operations/image68.png similarity index 100% rename from content/notes/ready/binary-operations/image68.png rename to content/notes/ready/binary_operations/image68.png diff --git a/content/notes/ready/binary-operations/image69.png b/content/notes/ready/binary_operations/image69.png similarity index 100% rename from content/notes/ready/binary-operations/image69.png rename to content/notes/ready/binary_operations/image69.png diff --git a/content/notes/ready/binary-operations/image70.png b/content/notes/ready/binary_operations/image70.png similarity index 100% rename from content/notes/ready/binary-operations/image70.png rename to content/notes/ready/binary_operations/image70.png diff --git a/content/notes/ready/binary-operations/image71.png b/content/notes/ready/binary_operations/image71.png similarity index 100% rename from content/notes/ready/binary-operations/image71.png rename to content/notes/ready/binary_operations/image71.png diff --git a/content/notes/ready/binary-operations/image72.png b/content/notes/ready/binary_operations/image72.png similarity index 100% rename from content/notes/ready/binary-operations/image72.png rename to content/notes/ready/binary_operations/image72.png diff --git a/content/notes/ready/binary-operations/image73.png b/content/notes/ready/binary_operations/image73.png similarity index 100% rename from content/notes/ready/binary-operations/image73.png rename to content/notes/ready/binary_operations/image73.png diff --git a/content/notes/ready/binary-operations/image74.png b/content/notes/ready/binary_operations/image74.png similarity index 100% rename from content/notes/ready/binary-operations/image74.png rename to content/notes/ready/binary_operations/image74.png diff --git a/content/notes/ready/binary-operations/image75.png b/content/notes/ready/binary_operations/image75.png similarity index 100% rename from content/notes/ready/binary-operations/image75.png rename to content/notes/ready/binary_operations/image75.png diff --git a/content/notes/ready/binary-operations/index.md b/content/notes/ready/binary_operations/index.md similarity index 98% rename from content/notes/ready/binary-operations/index.md rename to content/notes/ready/binary_operations/index.md index 655d83d..c5735fd 100644 --- a/content/notes/ready/binary-operations/index.md +++ b/content/notes/ready/binary_operations/index.md @@ -1,7 +1,6 @@ --- title: Binary Operations description: -date: 2025-02-17T08:37:24+00:00 draft: false tags: - computer-science @@ -122,21 +121,21 @@ Add 2, single-digit binary numbers. | 1 | 0 | 0 | 1 | | 1 | 1 | 1 | 0 | -![[image68.png]] +![image68](image68.png) #### Full Adder When adding 2 binary numbers, one operation might return a carry value, which the `half adder` can't accept, as it only has 2 inputs. -![[image69.png]] +![image69](image69.png) To solve this issue, a `full adder` accepts 3 inputs. -![[image70.png]] +![image70](image70.png) #### 8-Bit Adder -![[image71.png]] +![image71](image71.png) ### Subtraction @@ -153,7 +152,7 @@ Subtract 2, single-digit binary numbers. | 1 | 0 | 1 | 0 | | 1 | 1 | 0 | 0 | -![[image72.png]] +![image72](image72.png) #### Full Subtractor @@ -170,11 +169,11 @@ A `full subtractor` accepts the borrow value, allowing us to chain results. | 1 | 1 | 0 | 0 | 0 | | 1 | 1 | 1 | 1 | 1 | -![[image73.png]] +![image73](image73.png) #### 8-Bit Subtractor -![[image74.png]] +![image74](image74.png) ### Multiplication @@ -198,7 +197,7 @@ First, multiply the top number to every digit of the bottom one, and then add th #### 2-Bit By 2-Bit Multiplier -![[image75.png]] +![image75](image75.png) ### Division diff --git a/content/notes/ready/binary-operations/sb1.png b/content/notes/ready/binary_operations/sb1.png similarity index 100% rename from content/notes/ready/binary-operations/sb1.png rename to content/notes/ready/binary_operations/sb1.png diff --git a/content/notes/ready/binary-operations/sb10.png b/content/notes/ready/binary_operations/sb10.png similarity index 100% rename from content/notes/ready/binary-operations/sb10.png rename to content/notes/ready/binary_operations/sb10.png diff --git a/content/notes/ready/binary-operations/sb2.png b/content/notes/ready/binary_operations/sb2.png similarity index 100% rename from content/notes/ready/binary-operations/sb2.png rename to content/notes/ready/binary_operations/sb2.png diff --git a/content/notes/ready/binary-operations/sb3.png b/content/notes/ready/binary_operations/sb3.png similarity index 100% rename from content/notes/ready/binary-operations/sb3.png rename to content/notes/ready/binary_operations/sb3.png diff --git a/content/notes/ready/binary-operations/sb4.png b/content/notes/ready/binary_operations/sb4.png similarity index 100% rename from content/notes/ready/binary-operations/sb4.png rename to content/notes/ready/binary_operations/sb4.png diff --git a/content/notes/ready/binary-operations/sb5.png b/content/notes/ready/binary_operations/sb5.png similarity index 100% rename from content/notes/ready/binary-operations/sb5.png rename to content/notes/ready/binary_operations/sb5.png diff --git a/content/notes/ready/binary-operations/sb6.png b/content/notes/ready/binary_operations/sb6.png similarity index 100% rename from content/notes/ready/binary-operations/sb6.png rename to content/notes/ready/binary_operations/sb6.png diff --git a/content/notes/ready/binary-operations/sb7.png b/content/notes/ready/binary_operations/sb7.png similarity index 100% rename from content/notes/ready/binary-operations/sb7.png rename to content/notes/ready/binary_operations/sb7.png diff --git a/content/notes/ready/binary-operations/sb8.png b/content/notes/ready/binary_operations/sb8.png similarity index 100% rename from content/notes/ready/binary-operations/sb8.png rename to content/notes/ready/binary_operations/sb8.png diff --git a/content/notes/ready/binary-operations/sb9.png b/content/notes/ready/binary_operations/sb9.png similarity index 100% rename from content/notes/ready/binary-operations/sb9.png rename to content/notes/ready/binary_operations/sb9.png diff --git a/content/notes/ready/c-language.md b/content/notes/ready/c-language.md index afa94a2..6b3314c 100644 --- a/content/notes/ready/c-language.md +++ b/content/notes/ready/c-language.md @@ -1,7 +1,6 @@ --- title: C Language description: -date: 2025-02-17T08:54:40+00:00 draft: false tags: - c diff --git a/content/notes/ready/c-snippets.md b/content/notes/ready/c-snippets.md index 24a01b5..156a377 100644 --- a/content/notes/ready/c-snippets.md +++ b/content/notes/ready/c-snippets.md @@ -1,7 +1,6 @@ --- title: C Snippets description: -date: 2025-02-17T08:56:33+00:00 draft: false tags: - c diff --git a/content/notes/ready/compiling.md b/content/notes/ready/compiling.md index 263e5b9..75dc0ba 100644 --- a/content/notes/ready/compiling.md +++ b/content/notes/ready/compiling.md @@ -1,7 +1,6 @@ --- title: Compiling [MAKE / GCC] description: -date: 2025-02-17T08:59:53+00:00 draft: false tags: - c diff --git a/content/notes/ready/cpu_architecture/index.md b/content/notes/ready/cpu_architecture/index.md index 6db9bb9..efdfb81 100644 --- a/content/notes/ready/cpu_architecture/index.md +++ b/content/notes/ready/cpu_architecture/index.md @@ -1,7 +1,6 @@ --- title: CPU Architecture description: -date: 2025-02-17T08:06:50+00:00 draft: false tags: - computer-science @@ -14,33 +13,33 @@ showToc: true ### Registers We can combine registers to reduce the amount of wires needed. -![[image8.png]] +![image8](image8.png) Using a data bus (wiring at the top) and a binary decoder, we can select which register to read/write to. ### Memory -![[image9.png]] +![image9](image9.png) ## Assembly Assembly is a human-friendly representation of code: binary values that a computer can understand. -![[image10.png]] +![image10](image10.png) An assembler converts ASM instructions into machine code, which is given to the CPU as input. ### Arithmetic Operations For example, a simple computer architecture could use `00` to represent arithmetic operations. -![[image11.png]] +![image11](image11.png) To decide which type of operation to execute (subtraction, multiplication, addition, etc), the 3rd and 4th bits could be used. -![[image12.png]] -Using a [[ready/binary-operations/index]], we can build an inefficient, but simple circuit to do this. -![[image13.png]] +![image12](image12.png) +Using a [index](ready/binary_operations/index.md), we can build an inefficient, but simple circuit to do this. +![image13](image13.png) This type of circuit is an Arithmetic Logic Unit (ALU). ### Memory Operations Of course, assembly can also provide instructions to store or load values. -![[image14.png]] +![image14](image14.png) #### Load @@ -48,7 +47,7 @@ Of course, assembly can also provide instructions to store or load values. LOAD R2 1000 ;Load into register 2 the value in the memory address 1000 ``` -![[image15.png]] +![image15](image15.png) #### Store @@ -56,68 +55,68 @@ LOAD R2 1000 ;Load into register 2 the value in the memory address 1000 STORE R1 0110 ;Store the value in register 1 into the 0110 memory address ``` -![[image16.png]] +![image16](image16.png) #### Select Which Instruction to Execute (first 2 bits) To decide which operation to execute, a binary decoder can be used. -![[image17.png]] +![image17](image17.png) For memory operations, the 3rd and 4th bits are used to select which register to use. -![[image18.png]] +![image18](image18.png) The last 4 bits represent the memory address to read/write to. -![[image19.png]] +![image19](image19.png) ### Instruction Register For the instruction to be given, it is stored in a special register: An Instruction Register. -![[image20.png]] +![image20](image20.png) ### Optimization We can use a single Binary Decoder instead of two, to achieve the same result. (Optimization on the right pane) -![[image21.png]] +![image21](image21.png) Different architectures can have the exact same functionality, while being implemented differently, or even having different instructions. This is why code that is compiled for Intel x64 is not compatible with ARM or RISC-V. ## Control Unit We can finally add the ALU (Arithmetic Logic Unit) we built before into the new circuit, like so: -![[image22.png]] +![image22](image22.png) The gray trapezoids are multiplexers: -![[image23.png]] +![image23](image23.png) The output value is then stored in a temporary register, before replacing the first operand register's value. The component we just built to control the `ALU` is part of a `Control Unit`. The full `control unit` is very complex, as it needs to handle every possible instruction. (So far, we have seen how to implement the `ALU` and `RAM`.) -![[image24.png]] +![image24](image24.png) Each register in the `CU` has a specific purpose, unlike `RAM`, which can be used to store any values. -![[image25.png]] +![image25](image25.png) To read the first instruction, the `CU` will **fetch** data from the first address in memory. -![[image26.png]] +![image26](image26.png) After **fetching**, the `CU` will **decode** the instruction: interpret the bit sequence in the `instruction register`, to send the necessary signals to the components that will **execute** the instruction. We can finally load instructions into the instruction register. -![[image27.png]] +![image27](image27.png) Then, the `CU` increments 1 byte, to point the `address register` to the next instruction. (Modern architectures increment different values, as the instruction set is more complex) If the instruction is an arithmetic operation, the steps are similar. The ALU stores the output in a temporary register, which overwrites the register 0 with the result. The result can then be stored in `RAM`. -![[image28.png]] +![image28](image28.png) ## Load a Program Into Memory So far, we can store instructions in memory, but it is also necessary to store values, besides from the instructions themselves. For example: -![[image29.png]] +![image29](image29.png) This program uses 2 numeric values. The first 2 instructions load these values into the registers, and then, these values are added together and stored in another memory address. The final instruction, `HALT`, marks the end of the program, to make sure the `CU` does not attempt to read the number 20 as an instruction. If the program is extended, all memory addresses must be altered. To fix this issue, we can instead store values at the end of the memory stack. -![[image30.png]] +![image30](image30.png) ## Conditions and Loops To create a loop, we can simply jump to a smaller address in memory. -![[image31.png]] +![image31](image31.png) Internally, the `JMP` command overwrites the Address Register, making it so that the next CPU **cycle** *fetches* the chosen memory address, instead of the next one. -![[image32.png]] +![image32](image32.png) ### Flags Sometimes, we might want to loop only if a certain condition is met. For context, imagine subtracting a number from itself. In this case, the ALU will provide some extra information, using 1 bit registers called `flags`. -![[image33.png]] +![image33](image33.png) | N | Flag | Description | | --- | ------------ | --------------------------------------------------------- | @@ -144,19 +143,19 @@ $$a - 5 = b$$ | a < 5 | a == 5 | a > 5 | For example: -![[image34.png]] +![image34](image34.png) An `IF` statement works in the exact same way, but without the need to loop: -![[image35.png]] +![image35](image35.png) Note: These instructions are not from any real architecture. These are examples for this simple, custom architecture. ## Clock The final piece of the puzzle is the clock. A clock can give us time before a circuit loops. -![[image36.png]] +![image36](image36.png) This is necessary, because energy travels extremely quickly, and so, all memory would be reset before we could even use the stored values. Each clock tick corresponds to an action the `CU` performs (fetch, decode and execute). A `Data FLIP-FLOP`, for example, uses the clock to store data, acting as the manual `RESET` input. -![[image37.png]] +![image37](image37.png) This circuit can be used to build a single bit register. -![[image38.png]] +![image38](image38.png) To generate a clock pulse, we can use a circuit similar to this one: -![[image39.png]] +![image39](image39.png) diff --git a/content/notes/ready/databases/index.md b/content/notes/ready/databases/index.md index 8d74617..556a54b 100644 --- a/content/notes/ready/databases/index.md +++ b/content/notes/ready/databases/index.md @@ -1,7 +1,6 @@ --- title: Databases [SQL] description: -date: 2025-02-17T08:27:35+00:00 draft: false tags: - programming @@ -15,13 +14,13 @@ showToc: true A "table" written into a single file. The most common file type for this purpose is `CSV`. The `CSV` format reads each line as a row, and each comma-separated value as a column. The first row on a `CSV` file is used to describe the data in each column. If a `,` is present on the dataset, surround that entry with `"` to 'escape' it. -These files can be read and written to using languages like [[c-language]] and [[python]]. +These files can be read and written to using languages like [c-language](../c-language.md) and [python](../python.md). ## Relational Databases Instead of using a single table, a relational database can store data in multiple tables, and then define relationships between them. Each table must have one column with an unique key that identifies each row. -![[image94.png]] +![image94](image94.png) ### Relationships @@ -229,7 +228,7 @@ genres.show_id WHERE id = #### Many-to-many -![[image95.png]] +![image95](image95.png) ```SQL -- Select every person who starred in a show diff --git a/content/notes/ready/diodes.md b/content/notes/ready/diodes.md index 54fd976..7354795 100644 --- a/content/notes/ready/diodes.md +++ b/content/notes/ready/diodes.md @@ -1,7 +1,6 @@ --- title: Diodes description: -date: 2025-02-17T08:18:09+00:00 draft: false tags: - electronics diff --git a/content/notes/ready/encryption.md b/content/notes/ready/encryption.md index dceb40a..72f2f41 100644 --- a/content/notes/ready/encryption.md +++ b/content/notes/ready/encryption.md @@ -1,7 +1,6 @@ --- title: Encryption [GPG] description: -date: 2025-02-17T09:02:06+00:00 draft: false tags: - networking diff --git a/content/notes/ready/flask.md b/content/notes/ready/flask.md index 7949b12..2a039f0 100644 --- a/content/notes/ready/flask.md +++ b/content/notes/ready/flask.md @@ -1,7 +1,6 @@ --- title: Flask description: -date: 2025-02-17T09:01:01+00:00 draft: false tags: - programming diff --git a/content/notes/ready/gdb.md b/content/notes/ready/gdb.md index aef1a75..5376e1e 100644 --- a/content/notes/ready/gdb.md +++ b/content/notes/ready/gdb.md @@ -1,7 +1,6 @@ --- title: Debugging [GDB] description: -date: 2025-02-17T08:16:48+00:00 draft: false tags: - programming diff --git a/content/notes/ready/git.md b/content/notes/ready/git.md index c1b881c..548a7a6 100644 --- a/content/notes/ready/git.md +++ b/content/notes/ready/git.md @@ -1,7 +1,6 @@ --- title: Version Control [GIT] description: -date: 2025-02-17T08:58:11+00:00 draft: false tags: - programming diff --git a/content/notes/ready/html.md b/content/notes/ready/html.md index 3dc5833..3b59417 100644 --- a/content/notes/ready/html.md +++ b/content/notes/ready/html.md @@ -1,7 +1,6 @@ --- title: HTML description: -date: 2025-02-17T09:11:23+00:00 draft: false tags: - web diff --git a/content/notes/ready/http.md b/content/notes/ready/http.md index 619b6f7..b9162a0 100644 --- a/content/notes/ready/http.md +++ b/content/notes/ready/http.md @@ -1,7 +1,6 @@ --- title: HTTP [CURL] description: -date: 2025-02-17T09:22:33+00:00 draft: false tags: - networking diff --git a/content/notes/ready/https-ssl-certs.md b/content/notes/ready/https-ssl-certs.md index eb05561..fc50a04 100644 --- a/content/notes/ready/https-ssl-certs.md +++ b/content/notes/ready/https-ssl-certs.md @@ -1,7 +1,6 @@ --- title: HTTPS and SSL Certificates description: -date: 2025-02-17T09:17:30+00:00 draft: false tags: - networking @@ -17,7 +16,7 @@ The `http` protocol sends data as plaintext, which is an issue when sharing sens ## TLS -TLS is a form of [[encryption]], used to secure HTTPS connections. +TLS is a form of [encryption](encryption.md), used to secure HTTPS connections. TLS replaces SSL (a deprecated protocol), however, the term SSL is still used often. ### Handshake diff --git a/content/notes/ready/irc.md b/content/notes/ready/irc.md index f2933d2..50de725 100644 --- a/content/notes/ready/irc.md +++ b/content/notes/ready/irc.md @@ -1,7 +1,6 @@ --- title: IRC description: -date: 2025-02-17T09:13:13+00:00 draft: false tags: - networking @@ -17,7 +16,7 @@ IRC is a very simple communication protocol that allows users to chat in real ti ### Server -To be able to communicate, users must connect to a server. Each server has its own rules, bots and commands. The IRC protocol itself does not implement encryption, however, [[https-ssl-certs|SSL Certificates]] can be used to establish a secure connection **with the server**. +To be able to communicate, users must connect to a server. Each server has its own rules, bots and commands. The IRC protocol itself does not implement encryption, however, [SSL Certificates](../https-ssl-certs) can be used to establish a secure connection **with the server**. Every message sent **can be read by the server**, including **private messages** between users. Separate IRC instances can communicate. This concept is often called **server federation**. This allows for users in different servers to send messages to each other. @@ -163,7 +162,7 @@ services: ``` To properly configure your server, be sure to read the [container’s documentation](https://hub.docker.com/r/inspircd/inspircd-docker/). -This container generates a self-signed SSL certificate for secure connections, however, it won't be accepted by actual clients. Refer to my [[https-ssl-certs|SSL guide]] to generate a real certificate for TLS to work. After generating your certificate, simply replace the old one with it. +This container generates a self-signed SSL certificate for secure connections, however, it won't be accepted by actual clients. Refer to my [SSL Guide](../https-ssl-certs) to generate a real certificate for TLS to work. After generating your certificate, simply replace the old one with it. ### Linux @@ -189,7 +188,7 @@ Finally, start `inspircd`. sudo systemctl start inspircd ``` -To enable TLS, refer to my [[https-ssl-certs|SSL guide]]. After generating your certificate, copy it to `inspircd`'s ssl directory. +To enable TLS, refer to my [SSL Guide](../https-ssl-certs). After generating your certificate, copy it to `inspircd`'s ssl directory. ```Shell sudo cp /etc/letsencrypt/live/irc.example.com/fullchain.pem /etc/inspircd/ssl/cert.pem diff --git a/content/notes/ready/logic_gates/index.md b/content/notes/ready/logic_gates/index.md index ac50667..76a2131 100644 --- a/content/notes/ready/logic_gates/index.md +++ b/content/notes/ready/logic_gates/index.md @@ -1,7 +1,6 @@ --- title: Logic Gates description: -date: 2025-02-17T08:25:49+00:00 draft: false tags: - electronics @@ -13,7 +12,7 @@ showToc: true ## NOT Invert the input. -![[image42.png]] +![image42](image42.png) ### Truth Table @@ -25,7 +24,7 @@ Invert the input. ## AND Output `1` only when both inputs are `1`. -![[image43.png]] +![image43](image43.png) ### Truth Table @@ -39,7 +38,7 @@ Output `1` only when both inputs are `1`. ## OR Output `1` if at least one input is `1`. -![[image44.png]] +![image44](image44.png) ### Truth Table @@ -53,7 +52,7 @@ Output `1` if at least one input is `1`. ## NAND An `AND` gate followed by a `NOT` gate. -![[image45.png]] +![image45](image45.png) ### Truth Table @@ -67,7 +66,7 @@ An `AND` gate followed by a `NOT` gate. ## NOR An `OR` gate followed by a `NOT` gate. -![[image46.png]] +![image46](image46.png) ### Truth Table @@ -81,8 +80,8 @@ An `OR` gate followed by a `NOT` gate. ## XOR Either input is `1`, exclusively. -![[image47.png]] -![[image48.png]] +![image47](image47.png) +![image48](image48.png) ### Truth Table @@ -96,7 +95,7 @@ Either input is `1`, exclusively. ## XNOR Inverted `XOR`. -![[image49.png]] +![image49](image49.png) ### Truth Table @@ -111,13 +110,13 @@ Inverted `XOR`. ### NOT -![[image50.png]] +![image50](image50.png) ### AND -![[image51.png]] -![[image52.png]] +![image51](image51.png) +![image52](image52.png) ### OR -![[image53.png]] +![image53](image53.png) diff --git a/content/notes/ready/memory/index.md b/content/notes/ready/memory/index.md index 5587d8d..027ab21 100644 --- a/content/notes/ready/memory/index.md +++ b/content/notes/ready/memory/index.md @@ -1,7 +1,6 @@ --- title: Memory description: -date: 2025-02-17T08:22:26+00:00 draft: false tags: - computer-science @@ -12,21 +11,21 @@ showToc: true ## Remembering Data An `OR` gate could be used to store a single bit. -![[image76.png]] +![image76](image76.png) If the input `A` is changed to `1`, the `OR` gate will output `1`, and then receive it. -![[image77.png]] +![image77](image77.png) Even after the input `A` is set to `0`, the output does not change. The `OR` gate "remembers" that, at one point in the past, the `A` input was set to `1`. -![[image78.png]] +![image78](image78.png) The inverse can be done with an `AND` gate. -![[image79.png]] +![image79](image79.png) To remember either a `1` or a `0`, we can do the following: -![[image80.png]] +![image80](image80.png) ### AND-OR LATCH The input `A` sets the output to `1`, and the input `B` sets the output to `0`. This circuit is able to store a bit of information, while powered on, even after both inputs are set to `0`. A slightly more advanced and intuitive version can be built as follows: -![[image81.png]] +![image81](image81.png) ### GATED LATCH @@ -36,39 +35,39 @@ This is not the only way to store data using logic gates, but it is one of the s ## Registers A single bit isn't very useful, so we can use the previous circuit to create an 8bit register. -![[image82.png]] +![image82](image82.png) ## Binary Decoder Select which circuit to activate, depending on the task at hand. -![[image83.png]] +![image83](image83.png) ## RAM Registers don't scale well, however, as storing a large amount of data would require millions of wires. We can organize latches in a matrix instead of a long, horizontal line. -![[image84.png]] +![image84](image84.png) To access a specific latch, binary decoders can be used. -![[image85.png]] +![image85](image85.png) This way, a single, short memory address can select any latch in the matrix. ### Reading and Writing to the Matrix We can modify the latch to reduce the amount of wires needed. -![[image86.png]] +![image86](image86.png) This new latch uses the same wire for both input and output. -![[image87.png]] +![image87](image87.png) This circuit would store the same value on every latch, which isn't useful. With some modifications, however, we can use the memory address to select which latch to modify. -![[image88.png]] -![[image89.png]] +![image88](image88.png) +![image89](image89.png) ### Storing Bytes Instead of Bits -![[image90.png]] +![image90](image90.png) In this example, we can provide 1 byte of information, a `write` or `read` signal, and a memory address. Since we are storing a full byte, the same memory address applies for all 8, single bit circuits. This configuration is more commonly known as **RAM**. To make it easier to understand, we can abstract these concepts further. -![[image91.png]] +![image91](image91.png) The largest the Address Bus is, the more bits can be managed. This is why a 32bit CPU can't manage more than 4 GB of RAM. -![[image92.png]] +![image92](image92.png) This kind of RAM is Static RAM (**S**RAM), which uses many transistors, making it faster, but more expensive to produce than **D**RAM. diff --git a/content/notes/ready/pass.md b/content/notes/ready/pass.md index 748a77c..e4edd28 100644 --- a/content/notes/ready/pass.md +++ b/content/notes/ready/pass.md @@ -1,7 +1,6 @@ --- title: Password Manager [PASS] description: -date: 2025-02-17T09:19:30+00:00 draft: false tags: - tools @@ -17,10 +16,10 @@ There are many options available, however, *pass* is one of the simplest ones. ## Pass -*Pass* uses [[encryption]] to encrypt your passwords. If you don't have one already, use GPG to generate a personal key. +*Pass* uses [encryption](encryption.md) to encrypt your passwords. If you don't have one already, use GPG to generate a personal key. Besides from allowing you to read your passwords, *pass* can be scripted, providing your passwords to scripts and other programs securely. Instead of a database, *pass* stores every password in separate files, inside a directory called `password-store`. You can use *pass* to organize passwords just like regular files in the filesystem. -Pass also integrates with [[git|Git]], allowing you to undo changes, rollback to a previous state, and set a remote repository to save them on. +Pass also integrates with [Git](git.md), allowing you to undo changes, rollback to a previous state, and set a remote repository to save them on. ### Initialize Pass diff --git a/content/notes/ready/python.md b/content/notes/ready/python.md index 9727f3e..50851f9 100644 --- a/content/notes/ready/python.md +++ b/content/notes/ready/python.md @@ -1,7 +1,6 @@ --- title: Python description: -date: 2025-02-17T09:23:25+00:00 draft: false tags: - python diff --git a/content/notes/ready/ssh.md b/content/notes/ready/ssh.md index 48b7608..1cb3cae 100644 --- a/content/notes/ready/ssh.md +++ b/content/notes/ready/ssh.md @@ -1,7 +1,6 @@ --- title: SSH description: -date: 2025-02-17T09:21:16+00:00 draft: false tags: - networking diff --git a/content/notes/ready/tmux/index.md b/content/notes/ready/tmux/index.md index c548de4..f9e2f7c 100644 --- a/content/notes/ready/tmux/index.md +++ b/content/notes/ready/tmux/index.md @@ -1,7 +1,6 @@ --- title: Terminal Multiplexer [TMUX] description: -date: 2025-02-17T08:34:57+00:00 draft: false tags: - tools @@ -23,7 +22,7 @@ showToc: true - **Windows** (A session contains windows. These behave like tabs in other programs.) - **Panes** (A split in the window, each with its own terminal instance.) -![[tmux_design.png]] +![tmux_design](tmux_design.png) ## [Commands](https://tmuxcheatsheet.com/) diff --git a/content/notes/ready/transistors/index.md b/content/notes/ready/transistors/index.md index 2e8cca8..c780791 100644 --- a/content/notes/ready/transistors/index.md +++ b/content/notes/ready/transistors/index.md @@ -1,7 +1,6 @@ --- title: Transistors description: -date: 2025-02-17T08:14:53+00:00 draft: false tags: - electronics @@ -26,25 +25,25 @@ Base --(--|<) ### Switch If the `base` pin is provided with energy, the transistor allows current to flow in the main circuit. -![[image.png]] +![image](image.png) ### Amplifier Altering the voltage given to the `base` pin allows us to control a larger voltage in the main circuit. -![[image1.png]] +![image1](image1.png) ## Types of Transistor ### NPN An NPN transistor combines the `base` pin and `collector` pin. -![[image2.png]] +![image2](image2.png) -> Note: Even if the collector pin is disconnected from the circuit, a small amount of current still passes through. ![[image3.png]] +> Note: Even if the collector pin is disconnected from the circuit, a small amount of current still passes through. ![image3](image3.png) ### PNP A PNP transistor receives energy through the `emitter` pin, and then divides it to the remaining pins. -![[image4.png]] +![image4](image4.png) diff --git a/content/notes/ready/wsl2.md b/content/notes/ready/wsl2.md index d3717f0..ad7b779 100644 --- a/content/notes/ready/wsl2.md +++ b/content/notes/ready/wsl2.md @@ -1,7 +1,6 @@ --- title: WSL2 description: -date: 2025-02-17T09:18:31+00:00 draft: false tags: - tools diff --git a/content/ready/transistors.md b/content/ready/transistors.md new file mode 100644 index 0000000..e69de29