Skip to content

Instantly share code, notes, and snippets.

View dustinknopoff's full-sized avatar

Dustin Knopoff dustinknopoff

View GitHub Profile
@dustinknopoff
dustinknopoff / Brewfile
Created December 29, 2022 10:44
public version on 2022-12-29
tap "alexanderwillner/tap"
tap "apparition47/tap"
tap "charmbracelet/tap"
tap "cuelang/tap"
tap "dagger/tap"
tap "dart-lang/dart"
tap "dokku/repo"
tap "earthly/earthly"
tap "elastic/tap"
tap "federico-terzi/espanso"
@dustinknopoff
dustinknopoff / migrateToTaxonomies.ts
Last active October 12, 2024 10:05
This is written expecting to be in the top level directory of a Zola project and can be run `deno run --allow-read=. --allow-write=. migrateToTaxonomies.ts`
import {
extract,
test as containsFrontmatter,
} from "https://deno.land/[email protected]/encoding/front_matter/any.ts";
import { walk } from "https://deno.land/[email protected]/fs/mod.ts";
import { stringify } from "npm:[email protected]"
async function writeFile(path: string, attrs: { [key: string]: any }, body: string) {
await Deno.writeTextFile(path, `---\n${stringify(attrs)}\n---\n\n${body}`)
}
// Lowercase letters start at 97 => 1
// Max is 122 for z => 26
pub fn ascii_sum(string: &'static str) -> u32 {
string.bytes().map(|char| {
(char - 96) as u32
}).sum::<u32>()
}
<div class="layout layout--row flex flex--center">
<div class="item">
<div class="meta"></div>
<div class="content">
<span class="value value--xsmall">{{ IDX_0.commonName }}</span>
<span class="label flex flex--row">
{% for attrs in IDX_0.additionalProperties %}
{%- if attrs.key == "NbEmptyDocks"-%}
<span class="label">⬜ {{attrs.value | number_with_delimiter}}</span>
{%- endif -%}