Skip to content

Instantly share code, notes, and snippets.

View dudil's full-sized avatar

Dudi Levy dudil

View GitHub Profile
@dudil
dudil / op_toml.py
Last active March 8, 2024 12:01
This gist will show you how to use the 1password CLI to inject references into a toml file, and then use the OPToml class to read the toml file with the 1password references.
import shlex
import subprocess
import tomllib as toml
from pathlib import Path
from typing import Any
class OPToml:
"""
A wrapper around the tomlib.toml library to inject 1password references into the toml file
@dudil
dudil / navbar.html
Created February 2, 2018 14:34
This is a hack to allow menu items with external links to be open in a new tab
<!-- Header -->
<header id="header">
{{ if or .IsHome (not .Site.Params.DynamicTitles) }}
<h1><a href="{{ "/" | relURL }}">{{ .Site.Params.navbarTitle }}</a></h1>
{{ else if ne .Section "" }}
<h1><a href="{{ "/" | relURL }}">{{ .Section }}</a></h1>
{{ else }}
<h1><a href="{{ "/" | relURL }}">{{ .Title }}</a></h1>
{{ end }}