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
--- | |
creation date: <% tp.file.creation_date() %> | |
tags: DailyNote <% tp.file.title.split('-')[0] %> | |
--- | |
modification date: <%+ tp.file.last_modified_date("dddd Do MMMM YYYY HH:mm:ss") %> // This doesn't currently work in front matter, hoping that gets fixed. | |
# <% tp.file.title %> | |
<< [[<% tp.date.now("YYYY-MM-DD", -1, tp.file.title, "YYYY-MM-DD") %>]] | [[<% tp.date.now("YYYY-MM-DD", 1, tp.file.title, "YYYY-MM-DD") %>]]>> |
This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.
Description | Syntax |
---|---|
Get the length of a string | ${#VARNAME} |
Get a single character | ${VARNAME[index]} |
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 #e8e9ec | |
foreground #33374c | |
selection_background #d2d4dd | |
selection_foreground #33374c | |
cursor #33374c | |
cursor_text_color #e8e9ec | |
# white |
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 #161821 | |
foreground #c6c8d1 | |
selection_background #1e2132 | |
selection_foreground #c6c8d1 | |
cursor #d2d4de | |
# black | |
color0 #161821 |
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 addons from '@storybook/addons'; | |
import { FORCE_RE_RENDER } from '@storybook/core-events'; | |
import { themes } from '@storybook/theming'; | |
// Automatically switch light/dark theme based on system pref. | |
addons.register("auto-theme-switcher", api => { | |
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)'); | |
let lastTheme; |
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
-- The Maybe Monad: | |
local NOTHING = { val = nil } | |
maybe = {} | |
maybe.__index = maybe | |
-- Constructors: | |
maybe.just = function(val) | |
local obj = setmetatable({ val = val }, maybe) |
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
#!/usr/bin/env python3 | |
# Convert XML file from the firefox (pre-Quantum) extension | |
# into a CSV suitable to be imported into keepassxc | |
# Notes: | |
# - Python3 only! | |
# - password must be exported in plain text | |
# - requires defusedxml package ("pip install defusedxml") |
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
/* | |
Open console. | |
(Import https://raw.githubusercontent.com/MikeMcl/decimal.js/master/decimal.js first if you want/need number formatting) | |
Then copy & paste this + enter, to run this. | |
Copy console output to a NewFile.js or NewFile.jsx file. | |
prettier --write NewFile.js | |
*/ | |
/* eslint no-console: ["error", { allow: ["log"] }] */ | |
/* global document, Decimal*/ | |
(() => { |
NewerOlder