Skip to content

Instantly share code, notes, and snippets.

@AndrewLester
AndrewLester / zsh.stuff
Created January 10, 2024 06:41
zsh stuff
local user='%{$fg[magenta]%}%n%{$reset_color%}'
local pwd='%{$fg[cyan]%}%~%{$reset_color%}'
local return_code='%(?..%{$fg[red]%}%? ↵%{$reset_color%})'
local git_branch='$(git_prompt_status)%{$reset_color%}$(git_prompt_info)%{$reset_color%}'
ZSH_THEME_RVM_PROMPT_OPTIONS="i v g"
ZSH_THEME_GIT_PROMPT_PREFIX="(%{$fg[green]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%})"
ZSH_THEME_GIT_PROMPT_DIRTY=""
@AndrewLester
AndrewLester / rwlock.ts
Last active September 27, 2023 17:24
Promise-based readers-writer lock implementation in TypeScript
export class RWLock<ID> {
readLocked = new Set<ID>();
writeLocked: ID | null = null;
writeUnlockedPromises = new Map<
ID,
{ promise?: Promise<unknown>; resolve?: (value: unknown) => void }
>();
readUnlockedPromises = new Map<
ID,
{ promise?: Promise<unknown>; resolve?: (value: unknown) => void }
@AndrewLester
AndrewLester / pages.yml
Last active April 1, 2024 03:32
Github Actions Workflow Deploy SvelteKit Github Pages
# Updated from SvelteKit docs. See https://kit.svelte.dev/docs/adapter-static#github-pages for more information
name: Deploy to GitHub Pages
on:
push:
branches: 'main'
jobs:
build_site:
@AndrewLester
AndrewLester / auto.csv
Last active February 11, 2020 02:15
Basic auto path
x y heading
2.995 -0.116 0
3.881 1.1 36.42742
5.341 1.674 9.1128
6.749 1.605 -45.360
7.097 0.77 -91
6.297 -0.099 208.27
4.437 0.127 183.56