Skip to content

Instantly share code, notes, and snippets.

@atomicmattie
atomicmattie / concfg-pastel.json
Created April 3, 2019 17:12
concfg pastel theme
{
"cursor_size": "small",
"font_face": "Fira Code Retina",
"font_size": "0x16",
"popup_colors": "dark_magenta,white",
"dark_gray": "#8e8e8e",
"screen_colors": "gray,black",
"dark_green": "#b4fa72",
"command_history_no_duplication": false,
"window_size": "120x50",
@atomicmattie
atomicmattie / aws-assume-role
Created August 12, 2022 17:23
wraps the AWS CLI, assuming a role before invoking your command
#!/usr/bin/env bash
set -e
role="$1"
shift
if [ "x$role" = "x" -o "x$1" = "x" ]
then
echo usage: $0 ROLE_ARN AWS_COMMAND ... >&2
@atomicmattie
atomicmattie / docker
Created September 2, 2022 15:43
starts Docker Desktop on macOS on-demand
#!/bin/ksh
#
# Starts Docker Desktop on macOS on-demand.
#
# Put this in your PATH before `/usr/local/bin/desktop`.
#
set -e
if ! /usr/local/bin/docker system info >/dev/null 2>/dev/null
@atomicmattie
atomicmattie / import-branch
Created February 26, 2023 21:56
imports a branch from another Git repository, optionally moving everything into a folder
#!/bin/sh
#
# Merges a branch from another repository into this repository,
# putting it under a directory.
#
# Example to bring main from widget-api into the api folder:
#
# import-branch \
# git@github.com:example/widget-api.git develop \
# api
@atomicmattie
atomicmattie / is-undefined.ts
Created July 6, 2023 13:26
type guard for undefined values
/**
* Checks if a value is undefined, serving as a type guard for narrowing.
*
* @param value value to check
* @returns true if value is `undefined`
*/
export const isUndefined = (value: any): value is undefined => typeof value === 'undefined';