Skip to content

Instantly share code, notes, and snippets.

View clo4's full-sized avatar

Robert Clover clo4

View GitHub Profile
@clo4
clo4 / pinterest_domains.txt
Last active February 28, 2024 02:31
List of Pinterest domains I've blocked in Kagi because I'm tired of them ruining image search. Copy/Paste this list into the Kagi block list!
pinterest.at
pinterest.ca
pinterest.co.uk
pinterest.com
pinterest.com.au
pinterest.com.mx
pinterest.de
pinterest.dk
pinterest.es
pinterest.fr
defaults write -g NSWindowShouldDragOnGesture -bool true
@clo4
clo4 / optional_groups.ts
Created April 14, 2022 02:30
Create groups of properties that must be provided together
type OptionalGroup<T> = T | { [K in keyof T]?: undefined };
// deno-fmt-ignore
type OptionalGroups<Sets extends unknown[]> = Sets extends [infer Head, ...infer Rest]
? Rest extends []
? OptionalGroup<Head>
: OptionalGroup<Head> & OptionalGroups<Rest>
: Sets;
export type PropertySets<Base, Sets extends unknown[]> =
// Copyright 2021 SeparateRecords
//
// Permission to use, copy, modify, and/or distribute this software for any purpose
// with or without fee is hereby granted, provided that the above copyright notice
// and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
#!/usr/bin/env bash
# --- Variables and folder structure ---
: ${SCREENSHOT_LOCATION:="$HOME/Pictures/Screenshots"} && mkdir -p "$SCREENSHOT_LOCATION"
: ${ENV_MGR_LOCATION:="$HOME/.local/share"} && mkdir -p "$ENV_MGR_LOCATION"
: ${WORKSPACES_LOCATION:="$HOME/Workspaces"} && mkdir -p "$WORKSPACES_LOCATION"
: ${LISTS_LOCATION:="$HOME/Lists"} && mkdir -p "$LISTS_LOCATION"
@clo4
clo4 / abbreviable_group.py
Created October 10, 2019 02:03
Abbreviable group for Click, based on the example in the documentation. Flexible and subclassable implementation.
import click
class SuperGroup(click.Group):
@classmethod
def new(cls, name=None, **attrs):
"""Decorator to create a new group (use as `click.group()`)"""
attrs.setdefault('cls', cls)
return click.command(name, **attrs)