This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -eux | |
IMG="aider-wrap" | |
GEMINI_API_KEY="..." | |
tmpfile=$(mktemp) | |
trap 'rm -f "$tmpfile"' EXIT | |
exists() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function multiple_download(array $urls, $save_path = '/tmp') | |
{ | |
$multi_handle = curl_multi_init(); | |
$file_pointers = []; | |
$curl_handles = []; | |
// Add curl multi handles, one per file we don't already have | |
foreach ($urls as $key => $url) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import time | |
from datetime import datetime, timedelta | |
class DurationUnits: | |
Nanosecond = 1 | |
Microsecond = 1000 * Nanosecond | |
Millisecond = 1000 * Microsecond | |
Second = 1000 * Millisecond |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"fmt" | |
"os" | |
"os/exec" | |
"strings" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Locate tool whose basename matches ours in toolbox's scripts directory | |
# ie. ln -s [$HOME/.local/bin/]intellij.sh [$HOME/.local/bin/]clion | |
# ensure "$HOME/.local/bin" in PATH is *before* toolbox's path ($HOME/.local/share/JetBrains/Toolbox/scripts), | |
# that way invoking "clion" invokes intellij.sh and it invokes toolbox's in CLI's background. | |
declare TOOL="$( find "$HOME/.local/share/JetBrains/Toolbox/scripts" -mindepth 1 -maxdepth 1 -type f \ | |
-name "$(basename $0)" -executable -exec readlink -f {} \; )" | |
# No tool found is an error ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
DEFAULT_CHART="${1:-grafana/loki-stack}" | |
REPO_NAME="${2:-grafana}" | |
REPO_URL="${3:-https://grafana.github.io/helm-charts}" | |
helm repo add "${REPO_NAME}" "${REPO_URL}" | |
helm search repo "${REPO_NAME}" | |
read -p "Chart? [${DEFAULT_CHART}]: " CHART | |
[ -z "${CHART}" ] && CHART="${DEFAULT_CHART}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# git-dotfiles: simple git alias for dotfiles management | |
# 1. configure dotfiles checkout location ... | |
git config --global --replace-all dotfiles.dir "$HOME/.dotfiles" | |
# 2. init dotfiles ... | |
git init --bare "$(git config --global dotfiles.dir)" | |
# 3. create git dotfiles alias ... | |
git config --global --replace-all alias.dotfiles '!git --git-dir="$(git config --global dotfiles.dir)" --work-tree="$HOME"' | |
# 4. (OPTIONAL) | |
echo \* >> $HOME/.gitignore |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo 'One Punch Gauge, choose:' | |
cat <<EOS | |
π£ π£ 0 00 π π π± π± π π | |
πͺ π€ 10 90 π πΎ πΈ π² π π | |
π± π₯ 20 80 π π· πΏ π³ π π | |
πΈ π¦ 30 70 π π° π π΄ πΎ π | |
πΏ π§ 40 60 π π© π π΅ π· π |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
########################################## | |
# args - shell arguments parsing library # | |
########################################## | |
# Usage: | |
# - function "args_parse" with the parameters to parse, response will be a temp filename used to store the | |
# parsed data (see "Arguments parsing" and "Cleanup"). | |
# Example: ARGS=$(args_parse "$@") | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SemVer bump small shell/python function: bumps component $1 ("major", "minor" or "patch") from version in $2 (or STDIN). | |
# Version components to the right of the bump rollback to 0, ie. 1.2.3:1.2.4 or 1.2.3:1.3.0 or 1.2.3:2.0.0. | |
function bump() { | |
echo ${2:-$(</dev/stdin)} | python -c 'from sys import argv,stdin,stdout;n={"major":0,"minor":1,"patch":2}.get(argv[-1]);v=list(map(int,stdin.read().strip().split(".")));v[n]=v[n]+1;v[n+1:]=[0]*len(v[n+1:]);stdout.write(".".join(map(str,v))+"\n")' $1 | |
} | |
## Examples | |
# # Version as parameter | |
# $ bump minor 1.0.1 | |
# 1.1.0 |
NewerOlder