Skip to content

Instantly share code, notes, and snippets.

View StephenBrown2's full-sized avatar

Stephen Brown II StephenBrown2

  • JumpCloud
  • San Antonio, TX
View GitHub Profile
@basesnow
basesnow / automations.yaml
Created August 7, 2020 19:15
Garage Door / HVAC notifications
## Garage Door Notification
- id: '1588906118469'
alias: 'Notification: Colin''s Stuff: Garage door left open'
description: ''
trigger:
- entity_id: cover.garage_door
for: 00:10:00
platform: state
to: open
- entity_id: cover.garage_door
@kmatarese
kmatarese / pydantic_from_marshmallow.py
Last active January 23, 2024 06:48
Hack to convert marshmallow schemas to pydantic models
"""WARNING: not thoroughly tested and does not support full translation
between the two libraries.
Uses a pydantic root_validator to init the marshmallow schema. It attempts
to map marshmallow field types to pydantic field types as well, but not all
field types are supported.
You can either use the pydantic_from_marshmallow function that does all of
the above or just subclass MarshmallowModel and manually define your pydantic
fields/types/etc.
@cb109
cb109 / vscode_python_sort_imports_isort_on_save.md
Last active June 12, 2023 03:50
VSCode: Python Sort Imports on File Save (isort)

VSCode: Python Sort Imports on File Save (isort)

Problem

VSCode does have support to sort imports inside a .py file using isort. The recommended way to turn this on is via the following settings:

"[python]": {
    "editor.formatOnSave": true,
 "editor.codeActionsOnSave": {
@huntrar
huntrar / full-disk-encryption-arch-uefi.md
Last active May 19, 2024 10:44
Arch Linux Full-Disk Encryption Installation Guide [Encrypted Boot, UEFI, NVMe, Evil Maid]

Arch Linux Full-Disk Encryption Installation Guide

This guide provides instructions for an Arch Linux installation featuring full-disk encryption via LVM on LUKS and an encrypted boot partition (GRUB) for UEFI systems.

Following the main installation are further instructions to harden against Evil Maid attacks via UEFI Secure Boot custom key enrollment and self-signed kernel and bootloader.

Preface

You will find most of this information pulled from the Arch Wiki and other resources linked thereof.

Note: The system was installed on an NVMe SSD, substitute /dev/nvme0nX with /dev/sdX or your device as needed.

@detunized
detunized / join.sh
Last active March 6, 2024 20:09
Join repos into subfolders with flat history
#!/bin/bash
set -euo pipefail
$REPO_DIR=~/devel
repos="1password bitwarden dashlane lastpass opvault passwordbox roboform stickypassword truekey zoho-vault"
# pull all repos
(
for repo in $repos; do
echo $repo
@ex-nerd
ex-nerd / tutorial1.rst
Created March 11, 2012 10:01
Yet Another (corporate) Git Workflow Recommendation

Yet Another (corporate) Git Workflow Recommendation

I noticed myself passing around similar copies of the same git description to friends and coworkers enough times that I finally decided to write it up for a wider audience, though mostly so I would only have to do it one last time.

First off, this recommendation is for novice git users, particularly those who are coming from a CVS or Subversion background.

This workflow is based on the Branching workflow described in the Pro Git book (which I recommend that you find some time to read). In my experience, I've found that the distributed model just doesn't make sense in a corporate environment where people want there to be a single canonical origin repository.

*This is a work in progress. It's currently divided up into two sections, one describing what I hope is an easy walkthrough of recommended workflows, the other delving into much more detail about how git allows you to some of the more interes