Skip to content

Commit

Permalink
asciinema scripts and commands
Browse files Browse the repository at this point in the history
  • Loading branch information
gsantoro committed Aug 19, 2022
1 parent c58e960 commit e623a37
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,5 @@ go.work
## Personal changes
.vscode/
build
tmp
tmp
dev-tools/ascii
File renamed without changes.
34 changes: 33 additions & 1 deletion Taskfile.yaml → dev-tools/Taskfile.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,44 @@
version: '3'

vars:
WORKSPACE: "~/workspace/personal"
KUBERNETES_VERSION: v1.24.0

tasks:
install-prerequisites:
# - brew install go-task/tap/go-task // needed to run this command. need to run manually
# - task: install-linter:
# - brew install kind
# - go install github.com/cosmtrek/air@latest
# - brew install helm
- brew install asciinema

# Asciicinema
install-asciinema-recorder:
cmds:
# - cd {{.WORKSPACE}} && gh repo clone zechris/asciinema-rec_script
- echo 'export PATH=$PATH:{{.WORKSPACE}}/asciinema-rec_script/bin/' >> ~/.profiles.d/asciinema.sh # add script to path
# - source ~/.profiles.d/asciinema.sh # run in your terminal

install-asciinema-gif:
cmds:
# - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh # install Rush
# - cd {{.WORKSPACE}} && gh repo clone asciinema/agg asciinema-agg
# - source ~/.profiles.d/rust.sh && cd {{.WORKSPACE}}/asciinema-agg && cargo build -r
- echo 'export PATH=$PATH:{{.WORKSPACE}}/asciinema-agg/target/release' >> ~/.profiles.d/asciinema.sh # add script to path

script-to-gif:
cmds:
- asciinema-rec_script {{.CLI_ARGS}}
- agg --speed 0.5 --theme solarized-dark {{.CLI_ARGS}}.cast {{.CLI_ARGS}}.gif
- mv {{.CLI_ARGS}}.cast {{.CLI_ARGS}}.gif ascii


# golang

build:
cmds:
- go build -v -tags=go_json cmd/hello.go -o build/hello
- go build -v -tags=go_json -o ../build/hello ../cmd/hello.go

run:
cmds:
Expand Down
File renamed without changes.
File renamed without changes.
17 changes: 17 additions & 0 deletions dev-tools/sample_script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
## Date maths

# The `date` command can be used to retrieve the:
# * *day of the week* using the `%l` option
day_of_the_week=$(date +%l)

# * *hour of the day* using the `%u` option
hour=$(date +%u)


# Now, can you guess what we're going to do with those two numbers?
# 🤔...
sleep 3

# We're going to add them together!
echo $((day_of_the_week + hour))

0 comments on commit e623a37

Please sign in to comment.