Skip to content

Instantly share code, notes, and snippets.

View ZacharyThompson's full-sized avatar

Zachary Thompson ZacharyThompson

  • Santa Maria, CA, USA
View GitHub Profile
@ZacharyThompson
ZacharyThompson / flactoalac.sh
Created October 2, 2024 21:25
Convert flac to alac (for apple music upload)
#!/bin/sh
mkdir -p "./output"
for x in *.flac
do
ffmpeg -i "$x" -c:v copy -c:a alac "./output/$(basename -- "$x" .flac).m4a"
done
@ZacharyThompson
ZacharyThompson / highlight.txt
Created August 27, 2024 23:16
zsh highlight
To activate the syntax highlighting, add the following at the end of your .zshrc:
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
If you receive "highlighters directory not found" error message,
you may need to add the following to your .zshenv:
export ZSH_HIGHLIGHT_HIGHLIGHTERS_DIR=/usr/local/share/zsh-syntax-highlighting/highlighters
@ZacharyThompson
ZacharyThompson / updatenvim.sh
Created January 19, 2024 23:42
Auto update neovim from source
#!/bin/sh
git clone https://github.com/neovim/neovim.git
cd ./neovim
git checkout stable
make CMAKE_BUILD_TYPE=RelWithDebInfo
sudo make install
cd ..
rm -rf ./neovim
@ZacharyThompson
ZacharyThompson / test.zsh
Created August 28, 2023 21:05
Test coinflip
#!/bin/zsh
alias coinflip='echo "H\nT" | shuf -n 1'
list=()
repeat 1000 do
list+=$(coinflip)
# list+=$(python3 -c "import random; x=random.randint(0,1); print('H') if x==0 else print('T')")
done
typeset -A freq
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
if empty(glob(data_dir . '/autoload/plug.vim'))
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin(has('nvim') ? stdpath('data') . '/plugged' : '~/.vim/plugged')
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-surround'
Plug 'numToStr/Comment.nvim'
// Zachary Thompson
// Idea from "The Algorithm Design Manual" by Skiena page 179
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#define N 100000000
int main() {
format = '$directory$character'
right_format = '$package$git_branch$git_status'
add_newline = false
[directory]
truncation_length=0
truncate_to_repo=false
style='bold blue'
read_only=''
read_only_style='bold red'
# Based on https://github.com/morhetz/gruvbox by morhetz <[email protected]>
# Adapted to kitty by wdomitrz <[email protected]>
cursor #928374
cursor_text_color background
url_color #83a598
visual_bell_color #8ec07c
bell_border_color #8ec07c
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_STATE_HOME="$HOME/.local/state"
export GRADLE_USER_HOME="$XDG_DATA_HOME/gradle"
export NODE_REPL_HISTORY="$XDG_DATA_HOME/node_repl_history"
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npm/npmrc"
export NVM_DIR="$XDG_DATA_HOME/nvm"
export TLDR_CACHE_DIR="$XDG_CACHE_HOME/tldrc"
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_STATE_HOME="$HOME/.local/state"
export GRADLE_USER_HOME="$XDG_DATA_HOME/gradle"
export NODE_REPL_HISTORY="$XDG_DATA_HOME/node_repl_history"
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npm/npmrc"
export NVM_DIR="$XDG_DATA_HOME/nvm"
export TLDR_CACHE_DIR="$XDG_CACHE_HOME/tldrc"