Skip to content

Instantly share code, notes, and snippets.

View veracioux's full-sized avatar

Haris Gušić veracioux

View GitHub Profile
@veracioux
veracioux / app.tsx
Created November 2, 2025 14:58
OpenTUI character delete crash
import { TextareaRenderable } from "@opentui/core"
import { createEffect } from "solid-js"
export function App() {
let input: TextareaRenderable
createEffect(() => {
input.insertText("a ".repeat(200))
})
@veracioux
veracioux / @gh
Last active October 20, 2025 19:29
Shell that doesn't exit cleanly
#!/usr/bin/env bash
if [ "$#" -lt 3 ]; then
echo "Usage: @gh REPO_URL [BRANCH_OR_COMMIT] COMMAND [ARGS...]"
exit 1
fi
ref="$2"
mkdir -p ~/.cache/haris/tmp-{commits,repos}
(cd ~/.cache/haris/tmp-commits && git init --bare &>/dev/null)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@veracioux
veracioux / asciinema_upload_and_create_svg.sh
Created October 16, 2021 18:42
Record a command with asciinema, upload it and create an animated SVG for inclusion into a README
#!/usr/bin/env sh
# NOTE: Change this to suit your needs
TERM_WIDTH="<YOUR WIDTH>"
TERM_HEIGHT="<YOUR HEIGHT>"
RECORDED_COMMAND="<YOUR COMMAND>"
alias copy='xsel -b'
# Dependencies:
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@veracioux
veracioux / find_broken_urls.sh
Last active October 16, 2021 18:50
Find broken links in a git project
#!/usr/bin/env bash
# Should be called from the project root in order to search all subdirectories
# Reads each file in the working directory recursively and for each link runs
# curl to check the HTTP status code. If the status code starts with a 2 or a 3,
# then the link is OK, and BAD otherwise. If at least one BAD link is found, the
# script exits with an error code.
bad_count=0
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
output_tab_size = 4
indent_columns = 4