Skip to content

Instantly share code, notes, and snippets.

View ericchansen's full-sized avatar

Eric Hansen ericchansen

View GitHub Profile
@ericchansen
ericchansen / setup-peon-copilot.ps1
Last active April 15, 2026 17:34
One-command setup: Warcraft Peon sounds for Windows Terminal (Stable, Preview, Canary) with volume control
<#
.SYNOPSIS
Replace the Windows Terminal bell with Warcraft Peon sounds.
.DESCRIPTION
Downloads Peon WAV files and configures Windows Terminal's native bellSound
setting to randomly play one on each bell event. That's it - no hooks,
no runtimes, no extra dependencies. Just WAVs + a settings.json change.
Supports all Windows Terminal variants: Stable, Preview, and Canary.
@ericchansen
ericchansen / profile.ps1
Last active April 15, 2026 03:32
PowerShell profile - Oh My Posh theme, Split-Copilot, PSCommandHelper
<#
.SYNOPSIS
PowerShell profile with Oh My Posh, posh-git, and Copilot CLI helpers.
.DESCRIPTION
Configures the interactive PowerShell experience:
- Oh My Posh prompt with a custom clean-detailed theme (hosted as a gist)
- osc99 enabled so split panes inherit the current working directory
- posh-git for Git branch/tag tab completion
- Split-Copilot function (alias: spc) to open Copilot CLI in a side pane
@ericchansen
ericchansen / clean-detailed.omp.json
Created February 23, 2026 23:37
Custom Oh My Posh clean-detailed theme with osc99 for split-pane directory inheritance
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"pwd": "osc99",
"blocks": [
{
"alignment": "left",
"newline": true,
"segments": [
{
"background": "#FEF5ED",
@ericchansen
ericchansen / apps-script.gs
Last active April 15, 2026 03:36
Import events from one calendar into another
/**
* Google Calendar Sync — Import events from one calendar into another.
*
* Copies upcoming events from a secondary calendar into your primary calendar
* as private "Personal Appointment" blocks (title and times only). Keeps them
* in sync: creates new blocks, updates moved events, and deletes stale ones.
*
* Setup:
* 1. Replace SECONDARY_CALENDAR_ID with the calendar you want to import from.
* 2. Add a time-driven trigger to run sync() on your preferred schedule.
@ericchansen
ericchansen / monitor_usb.ps1
Last active April 15, 2026 03:36
PowerShell script to monitor device connects and disconnects on Windows.
<#
.SYNOPSIS
Monitor PnP device connects and disconnects in real time.
.DESCRIPTION
Polls Get-PnpDevice every 5 seconds and reports any devices that appeared
or disappeared since the last check. Useful for debugging USB, Bluetooth,
and other hot-pluggable peripherals.
.EXAMPLE
@ericchansen
ericchansen / .emacs_on_windows
Last active April 15, 2026 03:36
.emacs_on_windows
;;; .emacs_on_windows --- Bootstrap Emacs config on Windows -*- lexical-binding: t; -*-
;; On Windows, Emacs looks for init files in %APPDATA% by default.
;; Place this file at C:\Users\<username>\AppData\Roaming\.emacs
;; and update the paths below to point to your real config.
;; This lets you keep your .emacs and .emacs.d wherever you want
;; (e.g., a Git repo, a secondary drive, etc.).
;; Place this file in C:\Users\<username>\AppData\Roaming and point to the appropriate files
(setq user-init-file "C:/path/to/.emacs")
@ericchansen
ericchansen / .emacs
Last active April 15, 2026 03:36
My .emacs configuration
;;; .emacs --- Personal Emacs configuration -*- lexical-binding: t; -*-
;; Opinionated defaults: no tabs, visible whitespace, centralized backups,
;; and a handy C-c c binding to toggle comments on region or line.
;; Highlights dumb stuff.
(require 'whitespace)
(setq whitespace-style '(face empty tabs lines-tail trailing))
(global-whitespace-mode t)
@ericchansen
ericchansen / install-with-fresh-ubuntu.sh
Last active April 15, 2026 03:36
Fresh Ubuntu install script
#!/bin/bash
# Fresh Ubuntu / WSL2 setup script
#
# Installs essential build tools, configures Git credential forwarding
# from Windows, sets up Docker, and wires up an SSH agent that persists
# across shell sessions.
#
# Usage:
# chmod +x install-with-fresh-ubuntu.sh && ./install-with-fresh-ubuntu.sh