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 bb | |
| (require '[babashka.process :as proc]) | |
| ;; Idea: Parse test description from collect output. | |
| ;; Adapted from https://github.com/patterninstitute/pyprojroot/blob/main/R/criteria.R | |
| (defn detect-python-project-type [path] | |
| "Detect the type of the Python project in `path`. |
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
| (defun emacs-ime (&optional close-frame) | |
| (interactive) | |
| (let ((char (with-temp-buffer | |
| (call-interactively 'insert-char) | |
| (buffer-string)))) | |
| (when close-frame | |
| (delete-frame)) | |
| (gui-set-selection 'CLIPBOARD char) | |
| (start-process "xdotool" | |
| "*emacs-ime*" |
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
| use anyhow::{Error, Result}; | |
| use std::env; | |
| use std::fs::read_to_string; | |
| use std::io::{stderr, stdout, Write}; | |
| use yaml_rust::YamlLoader; | |
| fn kube_config_path() -> String { | |
| let mut home = dirs::home_dir().expect("No home directory found"); | |
| home.extend(vec![".kube", "config"]); | |
| env::var("KUBECONFIG").unwrap_or( |
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/env bb | |
| (require '[babashka.fs :as fs]) | |
| (require '[babashka.curl :as curl]) | |
| (defn get-day-component [] | |
| (let [components (fs/components (fs/cwd))] | |
| (-> (filter #(str/starts-with? % "day") components) | |
| first))) | |
| (defn get-day-number [day-name] |
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 bb | |
| (ns bookstats | |
| (:require [babashka.pods :as pods] | |
| [clojure.pprint :as pprint])) | |
| (pods/load-pod 'org.babashka/go-sqlite3 "0.1.0") | |
| (pods/load-pod 'retrogradeorbit/bootleg "0.1.9") | |
| (require '[pod.babashka.go-sqlite3 :as sqlite] | |
| '[pod.retrogradeorbit.hickory.select :as s] | |
| '[pod.retrogradeorbit.bootleg.utils :as utils]) | |
| (import [java.net URLEncoder] |
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/bash | |
| NUPX="${1%%x*}" | |
| NUPY="${1##*x}" | |
| PAGESTART="${2%%-*}" | |
| PAGEEND="${2##*-}" | |
| FILE="$3" | |
| # TODO: Check file and values. | |
| PAGESIZES="$(pdfinfo -box -f "$PAGESTART" -l "$PAGEEND" "$FILE" | awk '/[0-9]+ size:/ {print $4 "x" $6}')" | |
| PAGESIZEX="${PAGESIZES%%x*}" |
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
| if which sponge &>/dev/null; then | |
| qjc() { | |
| ALIAS="$1" | |
| DIR="$(pwd)" | |
| hash -d "$1"="$DIR" | |
| echo "hash -d \"$1\"=\"$DIR\"" >> ~/.zsh/dirhashes | |
| } | |
| qjd() { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | |
| #Warn ; Enable warnings to assist with detecting common errors. | |
| #SingleInstance force | |
| SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | |
| markSet = 0 | |
| cxPrefix = 0 | |
| GroupAdd, EmacsControls, ahk_exe firefox.exe | |
| GroupAdd, EmacsControls, ahk_exe WINWORD.EXE |
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
| scp() { | |
| totalcolons=$(echo "$*" | tr -cd ':' | wc -c) | |
| if [[ totalcolons -lt 1 ]]; then | |
| echo "Less than 1 colon in scp command." | |
| else | |
| /usr/bin/scp $@ | |
| fi | |
| } |
NewerOlder