Skip to content

Instantly share code, notes, and snippets.

View dgrebb's full-sized avatar

Dan Grebb dgrebb

View GitHub Profile
@dgrebb
dgrebb / obsidian-web-clipper.js
Last active January 29, 2024 03:01 — forked from kepano/obsidian-web-clipper.js
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
@dgrebb
dgrebb / docker-burn.sh
Last active February 21, 2024 23:52 — forked from Jaid/dockerPurge.bash
docker burn
#!/usr/bin/env bash
set -e
set -o errexit
docker stop `docker ps -qa` > /dev/null 2>&1; ## Stop all running containers
docker buildx stop; ## Stop the buildx builder
docker system prune --all --force --volumes; ## Remove all volumes, images, and containers
docker buildx rm --all-inactive --force; ## Remove all buildx builders
docker buildx prune --all --force; ## Prune buildx builder caches
@dgrebb
dgrebb / package.json
Created March 2, 2024 00:52
Commitizen config customization in package.json
{
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"cz": "cz",
"release": "standard-version --no-verify"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
@dgrebb
dgrebb / .aliases
Last active June 9, 2024 22:03
Git `gcn!` alias — amend the last commit without prompting to edit or running git hooks
#!/usr/bin/env bash
alias gcn!='f() {
if git diff --cached --quiet && git diff --quiet; then
printf "No changes to commit\n"
else
if git diff --cached --quiet; then
printf "No files added to staging! Did you forget to run git add?\n" >&2
else
git commit --verbose --no-edit --amend --no-verify
@dgrebb
dgrebb / svelte.config.js
Created August 23, 2024 06:33
SvelteKit multi-alias Generator
import adapter from '@sveltejs/adapter-auto';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
import { resolve } from 'path';
function createAlias(paths) {
const aliases = {};
Object.entries(paths).forEach(([key, value]) => {
const keys = key.split(',').map((k) => k.trim());
keys.forEach((alias) => {
@dgrebb
dgrebb / Dockerfile
Created August 27, 2024 03:22
Jira 10 Docker Container: Jira Software Data Center Edition with PostgreSQL 15
FROM atlassian/jira-software:10.0.0
@dgrebb
dgrebb / _daily.md
Last active November 27, 2024 23:04
Daily note template for Obsidian. Paste this into Obsidian while in "source" mode.

<%* tR += "---" %> tags:

  • "#n/daily"
  • "#n/notes"

<%* tR += tp.date.now("dddd", 0, tp.file.title, "YY.MM.DD") + ", " + tp.date.now("YY.MM.DD", 0, tp.file.title, "YY.MM.DD") %>

[[_Notes/Daily/<% tp.date.now("YY.MM.DD", -1, tp.file.title, "YY.MM.DD") %> Daily|← Yesterday]] | [[_Notes/Daily/<% tp.date.now("YY.MM.DD", 1, tp.file.title, "YY.MM.DD") %> Daily| Tomorrow →]]