This file contains 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
(local fennel (require :fennel)) | |
(require :hs.ipc) | |
(let [coro (coroutine.create fennel.repl)] | |
(coroutine.resume coro {:readChunk (fn [] | |
(let [input (coroutine.yield)] | |
(.. input "\n"))) | |
:onValues (fn [xs] | |
(print (table.concat xs "\t"))) | |
:onError (fn [_ msg] |
This file contains 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
[[ "$(date '+%Y-%m-%d')" < "$(date '+%Y-%m-%d' -d "$(openssl s_client -connect localhost:465 2>/dev/null </dev/null | openssl x509 -noout -dates | awk -F= '/notAfter/ { print $2 " - 1 month" }')" )" ]] |
This file contains 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
pixels.fill((0, 128, 0)) | |
pixels.show() | |
time.sleep(1.0) | |
pixels.fill((0, 255, 0)) | |
pixels.show() | |
time.sleep(0.05) | |
pixels.fill((0, 128, 0)) | |
pixels.show() |
This file contains 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
k get ingress -A --output json | jq ' | |
def pad(n): tostring | if length >= n then . else ([range(n-length) | "0"] | join("")) + . end; | |
.items | |
| sort_by(.metadata.namespace) | |
| map({ ns: .metadata.namespace, name: .spec.rules[].http.paths[].backend.service.name, host: .spec.rules[].host, path: .spec.rules[].http.paths[].path }) | |
| to_entries | |
| map({ name: [.value.ns, .value.name, .key | pad(2)] | join("-"), url: ["https://", .value.host, .value.path] | join("") }) | |
| map(select(.url | contains("*") | not)) | |
| unique_by(.url) | |
| sort_by(.name) |
This file contains 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 | |
# kobocomic: Modifies CBR and CBZ files to be displayed correctly on Kobo devices | |
# Requires perl, rar, unrar, zip, unzip | |
if [ "$#" -lt 1 ]; then | |
echo Supply a CBZ, CBR, ZIP, or RAR file to modify. | |
exit | |
fi | |
if [ -d "tmp_kobocomic" ]; then |
This file contains 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
(make-network-process :name "rmacs" | |
:server t | |
:host 'local | |
:service 52699 | |
:filter #'(lambda (proc string) | |
(delete-process proc) | |
(raise-frame) | |
(let ((tramp-allow-unsafe-temporary-files t)) | |
(find-file (string-trim string))))) | |
;; (delete-process "rmacs") |
This file contains 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
function tl() { | |
tldr --list | awk -v RS=', |\n' '/^[^\s]/ { print }' \ | |
| fzf --preview 'tldr {}' --query "$1" \ | |
| xargs -I{} tldr '{}' | |
} |
This file contains 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
local clockingLog = hs.logger.new("clocking") | |
local clockingMenu = hs.menubar.new() | |
local currentTask = nil | |
local function trim(s) | |
return (s:gsub("^%s*(.-)%s*$", "%1")) | |
end | |
local function eval(sexp, callback) | |
hs.task.new( |
This file contains 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
(setq tab-line-close-tab-function | |
#'(lambda (tab) | |
"Delete window when the last tab buried." | |
(let* ((buffer (if (bufferp tab) tab (cdr (assq 'buffer tab)))) | |
(window (get-buffer-window buffer))) | |
(with-selected-window (or window (selected-window)) | |
(let ((last-tab-p (length< (tab-line-tabs-window-buffers) 2))) | |
(if (eq buffer (current-buffer)) | |
(bury-buffer) | |
(set-window-prev-buffers nil (assq-delete-all buffer (window-prev-buffers))) |
This file contains 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
(defvar helm-source-lens-kubeconfigs nil "Lens kubeconfigs source") | |
(defun my/kubel-with-lens-configs (&optional kubeconfigs-dir) | |
"Launch kubel with Lens configs. | |
Require `yq' (a wrapper of `jq' for `yaml') in your path." | |
(interactive) | |
(unless kubeconfigs-dir | |
(setq kubeconfigs-dir "~/Library/Application Support/Lens/kubeconfigs")) | |