Skip to content

Instantly share code, notes, and snippets.

View nathonius's full-sized avatar
🤖
beep boop

Nathan nathonius

🤖
beep boop
View GitHub Profile
@nathonius
nathonius / router-link-status.directive.ts
Created April 30, 2025 04:06
Angular routerLinkStatus directive
@nathonius
nathonius / .eleventy.ts
Created December 31, 2024 02:35
11ty preact renderer
import { render } from "preact-render-to-string";
import type { FunctionComponent } from "preact";
export default function (config) {
config.addExtension("11ty.tsx", {
getInstanceFromInputPath: async function (path) {
const module: { default: FunctionComponent } = await import(path);
return module.default;
},
compile: function (component: FunctionComponent) {
@nathonius
nathonius / 11ty.ts
Last active December 31, 2024 02:29
Tailwind 11ty plugin
interface BeforeEventConfig {
directories: {
input: string;
output: string;
data: string;
includes: string;
inputFile?: string;
inputGlob?: string;
layouts?: string;
};
@nathonius
nathonius / fittext.directive.ts
Created November 17, 2024 03:22
Angular directive to set font size based on an element's container size
import type { OnInit, OnChanges, SimpleChanges } from '@angular/core';
import { ElementRef, Renderer2, Directive, inject, input } from '@angular/core';
import { Subject } from 'rxjs';
import { debounceTime } from 'rxjs/operators';
@Directive({
selector: '[fittext]',
standalone: true,
})
@nathonius
nathonius / numbered-headers.css
Created June 25, 2024 21:16
Obsidian.md Numbered Headers (for default theme)
body {
.markdown-source-view.is-live-preview,
.markdown-rendered,
.print {
/* Approximate width of the h1-h6 marker and the fold marker */
--marker-width: -34px;
h1,
h2,
h3,
@nathonius
nathonius / Readme.md
Created December 26, 2023 19:08
Obsidian "new note" button snippet

image

@nathonius
nathonius / minimal.js
Last active July 13, 2023 17:51
QuickAdd + Minimal CSS Helpers
const iframeChoices = [
{ value: "iframe-100", label: "Iframes fill 100% of the pane width" },
{ value: "iframe-max", label: "Iframes fill the max line width" },
{ value: "iframe-wide", label: "Iframes fill the wide line width" },
];
const embedChoices = [
{
value: "embed-strict",
label: "Transclusions appear seamlessly in the flow of text",
},
@nathonius
nathonius / Session Notes - DM.md
Last active November 24, 2021 23:47
TTRPG Templates
metatable title campaign session session_date tags
true
Untitled
CampaignName
1
<% tp.date.now("MM.DD.YYYY") %>
RPG/CampaignName, RPG/SessionNotes/DM

= this.title

@nathonius
nathonius / strahd.css
Last active November 2, 2021 12:29
Curse of Strahd button CSS
/* Curse of Strahd Button */
.strahd .block-language-button .button-default {
/* This is a google font */
font-family: "Vollkorn SC", serif;
text-transform: uppercase;
letter-spacing: 1px;
color: #d2c8ae;
border-width: 44px 132px;
border-style: solid;
border-color: #000;
@nathonius
nathonius / main.js
Last active September 24, 2021 00:20
collapse plugin with tag support
/*
THIS IS A GENERATED/BUNDLED FILE BY ROLLUP
if you want to view the source visit the plugins github repository
*/
'use strict';
var obsidian = require('obsidian');
/*! *****************************************************************************