This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { spawn } = require( 'child_process' ); | |
| const open = require('open'); | |
| const startHomepageServer = () => { | |
| // spawn a new process | |
| // change directory to HOMEPAGE_PATH | |
| // run npm run dev | |
| // run it in a shell | |
| const server = spawn( `cd ${HOMEPAGE_PATH} && npm`, [ 'run', 'dev' ], { | |
| shell: true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| getFrontmatter () { | |
| const file = this.app.workspace.getActiveFile(); | |
| const fm = this.app.metadataCache.getFileCache(file)?.frontmatter; | |
| if (fm === undefined) { | |
| new Notice('No frontmatter found.'); | |
| return; | |
| } | |
| if (fm.slug === undefined) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // frontend - react | |
| import { useState } from "react"; | |
| import Alert from "@reach/alert"; | |
| export default function Contact() { | |
| const [name, setName] = useState(""); | |
| const [email, setEmail] = useState(""); | |
| const [message, setMessage] = useState(""); | |
| const [messageSent, setMessageSent] = useState(false); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| background-image: url('img.jpg'); | |
| /* you need to match the shadow color to your background or image border for the desired effect*/ | |
| box-shadow: 0 0 50px 50px white inset; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <%* let day = tp.date.now("dd") | |
| if (day == "Su") { %> | |
| ```tasks | |
| not done | |
| heading includes todo/sunday | |
| ``` | |
| <%* } else if (day == "Sa") { %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export {} | |
| // https://jestjs.io/docs/expect#expectextendmatchers | |
| declare global { | |
| // eslint-disable-next-line @typescript-eslint/no-namespace | |
| namespace jest { | |
| interface Matchers<R> { | |
| toBeWithinRange(a: number, b: number): R; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| << <% tp.date.now("YYYY") %>-W<% tp.date.now("WW") - -1 %> | <% tp.date.now("YYYY") %>-W<% tp.date.now("WW") - -3 %> >> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // npm install wavesurfer.js | |
| import React, { useState, useEffect, useRef } from "react"; | |
| const formWaveSurferOptions = (ref) => ({ | |
| container: ref, | |
| waveColor: "#eee", | |
| progressColor: "#0178FF", | |
| cursorColor: "OrangeRed", | |
| barWidth: 3, | |
| barRadius: 3, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import moment from "moment"; | |
| import { spawn } from "child_process"; | |
| import * as dotenv from "dotenv"; | |
| dotenv.config(); | |
| const OWNER = process.env.OWNER || process.argv[2]; | |
| const REPO = process.env.REPO || process.argv[3]; | |
| const AUTHOR = process.env.AUTHOR || process.argv[4]; | |
| const GH_URL = `https://github.com/${OWNER}/${REPO}/commit/`; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "rewrites": [ | |
| { | |
| "source": "/zettelkasten/", | |
| "destination": "https://publish.obsidian.md/serve?url=bramadams.dev/zettelkasten" | |
| }, | |
| { | |
| "source": "/zettelkasten/:path*", | |
| "destination": "https://publish.obsidian.md/serve?url=bramadams.dev/zettelkasten/:path*" | |
| } |