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
for i in `seq 150 650`; do | |
convert -size 1016x200 -background white -fill black -font Libre-Barcode-39-Regular -pointsize 160 -gravity center caption:"*66250${i}*" -gravity south -extent 1016x260 -resize 1016x648\! "66250${i}.png" | |
done | |
convert *.png 0.pdf |
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
module Sig = | |
struct | |
module type NoteSig = sig type t end | |
module type TodoSig = sig type t end | |
end | |
module Same = | |
struct | |
module rec Note:Sig.NoteSig = struct type t = { | |
todo: Todo.t;} end | |
and Todo:Sig.TodoSig = struct type t = { |
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
(defun org-sync-attachments () | |
"Update the current entry's attachment metadata." | |
(interactive) | |
(let* ((attachments (if (org-attach-dir) | |
(org-attach-file-list (org-attach-dir)))) | |
(tag-state (if attachments 'on 'off)) | |
(org-attach-file-list-property "Attachments")) | |
(if attachments | |
(org-set-property org-attach-file-list-property |
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")) | |
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
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( |