diff --git a/.gitignore b/.gitignore index 1b67d59d7d7..bbb3a495c22 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ git/gitconfig.local.symlink +Brewfile.lock.json diff --git a/Brewfile b/Brewfile new file mode 100644 index 00000000000..93aed700585 --- /dev/null +++ b/Brewfile @@ -0,0 +1,40 @@ +cask_args appdir: '/Applications' + +tap 'homebrew/bundle' + +brew 'atuin' +brew 'cloudflared' +brew 'imagemagick' +brew 'postgresql@17' +brew 'redis' +brew 'ruby-build' +brew 'spaceman-diff' +brew 'spark' +brew 'stripe/stripe-cli/stripe' +brew 'stripe/stripe-mock/stripe-mock' +brew 'wget' +brew 'yt-dlp' + +cask '1password' +cask 'airtable' +cask 'arq' +cask 'codex' +cask 'conductor' +cask 'diffusionbee' +cask 'ghostty' +cask 'handbrake-app' +cask 'iina' +cask 'messenger' +cask 'notion-calendar' +cask 'plex' +cask 'qlvideo' +cask 'sonos' +cask 'steam' +cask 'transmission' +cask 'raycast' +cask 'whatsapp' +cask 'windsurf' +cask 'visual-studio-code' +cask 'vlc' +cask 'zed' +cask 'zoom' diff --git a/atuin/env.zsh b/atuin/env.zsh new file mode 100644 index 00000000000..4bfbc3daeb5 --- /dev/null +++ b/atuin/env.zsh @@ -0,0 +1 @@ +eval "$(atuin init zsh)" \ No newline at end of file diff --git a/bin/a b/bin/a new file mode 100755 index 00000000000..c3ddc41bf08 --- /dev/null +++ b/bin/a @@ -0,0 +1,12 @@ +#!/bin/sh +# +# Quick shortcut to ~*-~*AI*~-*~ +# +# Load up a current $HotThing AI client with preferable settings (which is +# usually yolo-lfg style anyway; computers wouldn't do anything to us). +# +# USAGE: +# +# $ a +# # => opens the AI client. yeah, easy peasy. +claude --dangerously-skip-permissions diff --git a/bin/atom-package-install b/bin/atom-package-install deleted file mode 100755 index 218bf414ee1..00000000000 --- a/bin/atom-package-install +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -# -# Usage: atom-package-install -# -# Installs the atom packages listed in your packages.txt file -# located at ~/.dotfiles/atom.symlink/packages.txt -# -# You can generate a new list based on currently installed -# packages via atom-package-backup - -set -e - -apm install --packages-file ~/.dotfiles/atom.symlink/packages.txt diff --git a/bin/cloudapp b/bin/cloudapp deleted file mode 100755 index 1ec555ab660..00000000000 --- a/bin/cloudapp +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env ruby -# -# cloudapp -# Zach Holman / @holman -# -# Uploads a file from the command line to CloudApp, drops it into your -# clipboard (on a Mac, at least). -# -# Example: -# -# cloudapp drunk-blake.png -# -# This requires Aaron Russell's cloudapp_api gem: -# -# gem install cloudapp_api -# -# Requires you set your CloudApp credentials in ~/.cloudapp as a simple file of: -# -# email -# password - -require 'rubygems' - -['json', 'cloudapp_api'].each do |gem| - begin - require gem - rescue LoadError - puts "You need to install #{gem}: gem install #{gem}" - exit!(1) - end -end - -config_file = "#{ENV['HOME']}/.cloudapp" -unless File.exist?(config_file) - puts "You need to type your email and password (one per line) into "+ - "`~/.cloudapp`" - exit!(1) -end - -email,password = File.read(config_file).split("\n") - -if ARGV[0].nil? - puts "You need to specify a file to upload." - exit!(1) -end - -urls = [] -ARGV.each do |x| - CloudApp.authenticate(email,password) - puts "Attempting to upload #{x}" - url = CloudApp::Item.create(:upload, {:file => x}).url - - # Say it for good measure. - puts "Uploaded #{x} to #{url}" - - # Get the embed link. - url = "#{url}/#{ARGV[0].split('/').last}" - urls << url -end - -# Copy it to your (Mac's) clipboard. -`echo '#{urls.join(',')}' | tr -d "\n" | pbcopy` diff --git a/bin/dot b/bin/dot index 605b0591ec5..d84a178a29b 100755 --- a/bin/dot +++ b/bin/dot @@ -40,9 +40,16 @@ done export ZSH=$HOME/.dotfiles +# Update dotfiles themselves +echo "› git pull" +git -C $ZSH pull + # Set macOS defaults $ZSH/macos/set-defaults.sh +# Set macOS hostname +$ZSH/macos/set-hostname.sh + # Install homebrew $ZSH/homebrew/install.sh 2>&1 @@ -50,6 +57,9 @@ $ZSH/homebrew/install.sh 2>&1 echo "› brew update" brew update +echo "› brew upgrade" +brew upgrade + # Install software -echo "› $ZSH/script/install" +echo "› script/install" $ZSH/script/install diff --git a/bin/movieme b/bin/movieme deleted file mode 100755 index 115a364f0fa..00000000000 --- a/bin/movieme +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -# -# MOVIE ME as in: "MOVIE ME AN ANIMATED GIF FROM THIS MOVIE, DAMMIT" -# -# Creates an animated gif from a movie file. Uploads to CloudApp. You must also -# have `gifme` and `cloudapp` in your $PATH. -# -# $1 - the path to the movie we're converting. -# $2 - the start time of the finished product. -# This can be in seconds, or it also accepts the "hh:mm:ss[.xxx]" format. -# $3 - the duration of the video sequence. -# This can be in seconds, or it also accepts the "hh:mm:ss[.xxx]" format. -# -# Examples: -# -# movieme -# ~/Desktop/dr-strangelove.mp4 23:12 3 -# ~/Desktop/holman-backflip-on-fire.mov 3.9 1.75 - -# cleanup -rm -rf /tmp/movieme - -# create tmp dir -mkdir -p /tmp/movieme - -# split the movie into constituent frames -ffmpeg -i "$1" -f image2 -vf "scale=iw*sar:ih" -ss $2 -t $3 -r 7 /tmp/movieme/d-%05d.png - -# ANIMATE -gifme /tmp/movieme/* -d 0 diff --git a/bin/mustacheme b/bin/mustacheme deleted file mode 100755 index ad28a39f6e2..00000000000 --- a/bin/mustacheme +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/sh -# -# mustacheme -# expanded from an idea from Rick Olson (@technoweenie) -# -# Takes a .gif, splits it into constituent frames, mustaches each, restitches -# the gif, and uploads to cloudapp. -# -# This leverages the nifty service mustachify.me, which will analyze your photo, -# identify faces, and add a mustache to your image. -# -# If the .gif is a remote file, we'll download it and blow it up locally. -# -# $1 - the path of the gif -# -# Examples: -# -# mustacheme holman-jumping-off-cliff-into-butter.gif -# mustacheme http://github.com/holman/butter/blob/master/holman-butter.gif -# -# Dependencies: -# -# - ImageMagick. If you're on a Mac, run: -# brew install imagemagick -# - wget -# - cloudapp: https://github.com/holman/dotfiles/blob/master/bin/cloudapp -# - gifme: https://github.com/holman/gifme - -set -e - -# Set up mustacheme temporary working directory -output=/tmp/mustacheme -rm -rf $output -mkdir $output - -if [[ $1 == http* ]] -then - wget $1 -O /tmp/mustache-download.gif - file=/tmp/mustache-download.gif -else - file="$1" -fi - -# Blow apart the GIF -convert $1 -coalesce $output/frame_%03d.gif - -# Mustache each frame -for frame in $output/*.gif -do - url=$(cloudapp $frame | grep Uploaded | awk '{print substr($0, index($0, "http://"))}') - url="$url/$(basename $frame)" - wget "http://mustachify.me/?src=$url" -O "$frame-stache" -done - -# Ding! Fries are done. -gifme $output/*-stache -d 0 diff --git a/bin/res b/bin/res deleted file mode 100755 index 40afcfdf55e..00000000000 --- a/bin/res +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/osascript -# -# A small command line script to change screen resolutions on Mountain Lion. -# -# Primarily I switch between two resolutions on my Retina MacBook Pro: Retina, -# and the full resolution setting. This means for particular apps I use, I can -# quickly jump between seeing more pixels and less. -# -# There doesn't appear to be an easy way to do this without just using -# AppleScript to automate clicking buttons, so that's what this does. -# -# Most of this script is adapted from this helpful answer: -# -# http://apple.stackexchange.com/a/91590 -# -# Make sure "Enable access for assistive devices" is checked in the -# Accessibility section of System Properties. - -local index1, index2 - -set index1 to 3 -- 1440 x 900 (Best for Retina) -set index2 to 5 -- 1920 x 1200 (More Space) - -tell application "System Preferences" - reveal anchor "displaysDisplayTab" of pane "com.apple.preference.displays" -end tell - -local indexToUse - -tell application "System Events" to tell process "System Preferences" to tell window "Built-in Retina Display" - - click radio button "Display" of tab group 1 - click radio button "Scaled" of radio group 1 of tab group 1 - - -- Click the "Scaled" radio button - click radio button "Scaled" of radio group 1 of tab group 1 - - tell tab group 1 - tell radio group 1 of group 1 - -- Depending on what scale option/index is current selected, set the appropriate new option/index to use - if (value of radio button index1) is true then - set indexToUse to index2 - else if (value of radio button index2) is true then - set indexToUse to index1 - end if - - -- Click the radio button for the new scale option/index - click radio button indexToUse - end tell - end tell - - -- If option/index 1 is selected a warning prompt is displayed, click the OK button to dismiss the prompt - if indexToUse = 1 then - click button "OK" of sheet 1 - end if -end tell - -tell application "System Preferences" - quit -end tell diff --git a/bin/time-report b/bin/time-report deleted file mode 100755 index f9d31e06ffd..00000000000 --- a/bin/time-report +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/zsh -# -# time-report [from] [to] -# -# A quick script to pull a report from `watson` -# (https://github.com/TailorDev/Watson) and dump it out to my desktop. -# -# Example: -# -# time-report 2022-08-15 2022-08-31 - -set -e - -start=$1 -end=$2 - -file=$HOME/Desktop/"$1 to $2.txt" -log=$(watson log --from $1 --to $2) -total=$(watson report --from $1 --to $2 | tail -1) - -(echo $total; echo ""; echo $log) > "${file}" \ No newline at end of file diff --git a/editors/env.zsh b/editors/env.zsh new file mode 100644 index 00000000000..0fca5519166 --- /dev/null +++ b/editors/env.zsh @@ -0,0 +1 @@ +export EDITOR='zed' diff --git a/editors/windsurf.zsh b/editors/windsurf.zsh new file mode 100644 index 00000000000..4ec661acb02 --- /dev/null +++ b/editors/windsurf.zsh @@ -0,0 +1 @@ +export PATH="/Users/holman/.codeium/windsurf/bin:$PATH" \ No newline at end of file diff --git a/git/gitconfig.symlink b/git/gitconfig.symlink index 7f0647ba36f..29e0e804c06 100644 --- a/git/gitconfig.symlink +++ b/git/gitconfig.symlink @@ -38,3 +38,5 @@ [init] defaultBranch = main +[pull] + rebase = true diff --git a/homebrew/install.sh b/homebrew/install.sh index f01dbdc7f75..be72ff076eb 100755 --- a/homebrew/install.sh +++ b/homebrew/install.sh @@ -21,4 +21,7 @@ then fi +# Link keg-only formulas that we want in PATH +brew list | grep 'postgresql@' | xargs -I {} brew link {} --force 2>/dev/null + exit 0 diff --git a/macos/install.sh b/macos/install.sh deleted file mode 100755 index 312f8eb6ca9..00000000000 --- a/macos/install.sh +++ /dev/null @@ -1,12 +0,0 @@ -if test ! "$(uname)" = "Darwin" - then - exit 0 -fi - -# The Brewfile handles Homebrew-based app and library installs, but there may -# still be updates and installables in the Mac App Store. There's a nifty -# command line interface to it that we can use to just install everything, so -# yeah, let's do that. - -echo "› sudo softwareupdate -i -a" -sudo softwareupdate -i -a diff --git a/macos/set-defaults.sh b/macos/set-defaults.sh index 03d6f2d9dbe..f2d73256450 100755 --- a/macos/set-defaults.sh +++ b/macos/set-defaults.sh @@ -31,11 +31,16 @@ defaults write com.apple.dock wvous-bl-corner -int 5 defaults write com.apple.dock wvous-bl-modifier -int 0 # Hide Safari's bookmark bar. -defaults write com.apple.Safari ShowFavoritesBar -bool false +defaults write com.apple.Safari.plist ShowFavoritesBar -bool false + +# Always show Safari's "URL display" tab in the lower left on mouseover. Strangely +# like, everyone and their LLMs on the internet thinks this is ShowStatusBar, but +# it's not. +defaults write com.apple.Safari ShowOverlayStatusBar -bool true # Set up Safari for development. -defaults write com.apple.Safari IncludeInternalDebugMenu -bool true -defaults write com.apple.Safari IncludeDevelopMenu -bool true -defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true -defaults write com.apple.Safari "com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled" -bool true +defaults write com.apple.Safari.SandboxBroker ShowDevelopMenu -bool true +defaults write com.apple.Safari.plist IncludeDevelopMenu -bool true +defaults write com.apple.Safari.plist WebKitDeveloperExtrasEnabledPreferenceKey -bool true +defaults write com.apple.Safari.plist "com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled" -bool true defaults write NSGlobalDomain WebKitDeveloperExtras -bool true diff --git a/macos/set-hostname.sh b/macos/set-hostname.sh new file mode 100755 index 00000000000..a8e773c9b53 --- /dev/null +++ b/macos/set-hostname.sh @@ -0,0 +1,26 @@ +#!/bin/sh +# +# This corrects a shitty point of confusion with macOS where if you bounce +# between wireless and wired connections, macOS will suddenly throw up its hands +# and add a random-ass number to your hostname. Do it a couple times and you're +# in like, the thousands appended to your hostname, which makes you look like a +# chump when your machine is called "incredible-programmer-9390028", like +# you're behind 9,390,027 other better programmers before you. Sheesh. +# +# Anyway, this runs in `dot` and only asks for your permission (usually TouchID) +# if it actually needs to change your hostname for you, otherwise it's fast to +# toss into `dot` anyway. +# +# None of this really matters in the big scheme of things, but it bothered me. + +hostname=$(scutil --get LocalHostName) + +# if hostname contains a hyphen and then a number, remove the hyphen and number +normal_hostname=$(echo "$hostname" | sed 's/-[0-9]*$//') + +# if our hostname was changed by macOS, change it back +if [ "$normal_hostname" != "$hostname" ]; then + echo "Changing hostname from $hostname to $normal_hostname" + scutil --set LocalHostName "$normal_hostname" + scutil --set ComputerName "$normal_hostname" +fi diff --git a/node/install.sh b/node/install.sh deleted file mode 100755 index 03c92217043..00000000000 --- a/node/install.sh +++ /dev/null @@ -1,7 +0,0 @@ -if test ! $(which spoof) -then - if test $(which npm) - then - sudo npm install spoof -g - fi -fi diff --git a/ruby/irbrc.symlink b/ruby/irbrc.symlink index 061e9e16c94..d8cf3001043 100644 --- a/ruby/irbrc.symlink +++ b/ruby/irbrc.symlink @@ -1,9 +1,7 @@ #!/usr/bin/ruby require 'irb/completion' -require 'irb/ext/save-history' require 'rubygems' -IRB.conf[:SAVE_HISTORY] = 1000 IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb_history" IRB.conf[:PROMPT_MODE] = :SIMPLE diff --git a/ruby/rbenv.zsh b/ruby/rbenv.zsh index cb93d589d6a..8b8542f8073 100644 --- a/ruby/rbenv.zsh +++ b/ruby/rbenv.zsh @@ -1,3 +1,6 @@ +# fun: https://bugs.ruby-lang.org/issues/14009 +export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES + # init according to man page if (( $+commands[rbenv] )) then diff --git a/script/install b/script/install index 1887fc2ca49..826f87e8dd0 100755 --- a/script/install +++ b/script/install @@ -6,5 +6,8 @@ set -e cd "$(dirname $0)"/.. +echo "› brew bundle" +brew bundle + # find the installers and run them iteratively find . -name install.sh | while read installer ; do sh -c "${installer}" ; done diff --git a/system/_path.zsh b/system/_path.zsh index 255c2cfca66..ed7da9058f1 100644 --- a/system/_path.zsh +++ b/system/_path.zsh @@ -1,2 +1,2 @@ -export PATH="./bin:/usr/local/bin:/usr/local/sbin:$ZSH/bin:$PATH" +export PATH="./bin:$HOME/.local/bin:/usr/local/bin:/usr/local/sbin:$ZSH/bin:$PATH" export MANPATH="/usr/local/man:/usr/local/mysql/man:/usr/local/git/man:$MANPATH" diff --git a/system/env.zsh b/system/env.zsh index b99078ff655..e69de29bb2d 100644 --- a/system/env.zsh +++ b/system/env.zsh @@ -1 +0,0 @@ -export EDITOR='code' diff --git a/xcode/aliases.zsh b/xcode/aliases.zsh index 53dc5922efe..1c7c6c1c3a6 100644 --- a/xcode/aliases.zsh +++ b/xcode/aliases.zsh @@ -1,2 +1 @@ -alias ios="open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app" -alias watchos="open /Applications/Xcode.app/Contents/Developer/Applications/Simulator\ \(Watch\).app" +alias ios="open -a Simulator" diff --git a/zsh/zshrc.symlink b/zsh/zshrc.symlink index 36fa863cc97..d398ac84809 100644 --- a/zsh/zshrc.symlink +++ b/zsh/zshrc.symlink @@ -1,5 +1,3 @@ -# Fig pre block. Keep at the top of this file. -[[ -f "$HOME/.fig/shell/zshrc.pre.zsh" ]] && . "$HOME/.fig/shell/zshrc.pre.zsh" # shortcut to this dotfiles path is $ZSH export ZSH=$HOME/.dotfiles @@ -41,15 +39,3 @@ do done unset config_files - -# Better history -# Credits to https://coderwall.com/p/jpj_6q/zsh-better-history-searching-with-arrow-keys -autoload -U up-line-or-beginning-search -autoload -U down-line-or-beginning-search -zle -N up-line-or-beginning-search -zle -N down-line-or-beginning-search -bindkey "^[[A" up-line-or-beginning-search # Up -bindkey "^[[B" down-line-or-beginning-search # Down - -# Fig post block. Keep at the bottom of this file. -[[ -f "$HOME/.fig/shell/zshrc.post.zsh" ]] && . "$HOME/.fig/shell/zshrc.post.zsh"