Tweak some skeleton files.

Add bun to zshrc
This commit is contained in:
Sage Vaillancourt 2024-06-24 12:24:19 -04:00
parent f9d69a590a
commit 16b704d1be
4 changed files with 64 additions and 0 deletions

View File

@ -10,6 +10,43 @@ fi
alias _slides="$(which slides 2> /dev/null || echo "echo 'slides not installed'")"
function roll {
local count=1
if [[ "$2" != "" ]]; then
count="$2"
fi
local rolls="$(shuf -i 1-$1 -n $count)"
echo "$rolls" | toilet
for i in {1..$count}; do
setsid cvlc --play-and-exit $HOME/Videos/roll.mp3 &> /dev/null
sleep "0.0$(shuf -i 5-9 -n 1)"
done
if [[ "$count" != "1" ]]; then
echo "Total: $(echo "$rolls" | paste -s -d+ - | bc)" | toilet
fi
}
alias d4='roll 4'
alias 4='roll 4'
alias d6='roll 6'
alias 6='roll 6'
alias d8='roll 8'
alias 8='roll 8'
alias d10='roll 10'
alias 10='roll 10'
alias d12='roll 12'
alias 12='roll 12'
alias d20='roll 20'
alias 20='roll 20'
alias dedup="awk '!seen_lines[$0]++'"
alias dedup-keep-last="tac | awk '!seen_lines[$0]++' | tac"
function helpdef {
if [[ "$1" == "--help" ]] || [[ "$1" == "-h" ]]; then
echo "$2"

View File

@ -39,6 +39,7 @@ int main(int argc, char* argv[])
);
person->greet();
// Not necessary with unique_ptr:
// delete person;

View File

@ -3,3 +3,22 @@
document.addEventListener('DOMContentLoaded', function initJs () {
console.log('Hello, world!')
})
// skeleton-script.js
#!/usr/bin/env bun
// See: https://bun.sh/docs/runtime/shell
import { $ } from "bun";
const lines = $`ls`.lines()
for await (let line of lines) {
console.log(line);
}
const lineArray = await Array.fromAsync(lines)
console.log(lineArray.filter(s => s.startsWith("D")))

View File

@ -290,3 +290,10 @@ function load_nvm {
test -f /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh && source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
test -f "$HOME/.asdf/asdf.sh" && . "$HOME/.asdf/asdf.sh"
test -f ~/.cargo/env && source ~/.cargo/env
# bun completions
[ -s "/home/sage/.bun/_bun" ] && source "/home/sage/.bun/_bun"
# bun
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"