Skip to content

Instantly share code, notes, and snippets.

@smbkr
smbkr / utility.ts
Created April 26, 2021 16:04
TypeScript utility types
export type Primitive<T> = T extends string
? string
: T extends number
? number
: T extends boolean
? boolean
: T extends Record<keyof any, unknown>
? Lookalike<T>
: never;
@smbkr
smbkr / remove_jpg_if_raw_exists.py
Last active October 4, 2017 20:36 — forked from therealmarv/remove_jpg_if_raw_exists.py
Remove jpg when raw existing
#!/usr/bin/env python
# Script: remove_jpg_if_raw_exists.py
#
# Description: This script looks in all sub directories for
# pairs of JPG and RAW files.
# For each pair found the JPG is moved to a
# waste basket directory.
# Otherwise JPG is kept.
#
# Author: Thomas Dahlmann