Skip to content

Instantly share code, notes, and snippets.

dmitrym0 / gist:f9d37d4975103c19c9332edd65f7699b
Created May 30, 2024 17:12
a script to select a workflow and specify a branch to run this workflow on
# List workflows, pick one with fzf, get its ID
workflow_id=$(gh workflow list --json id,name | jq -r '.[] | "\(.id) \(.name)"' | fzf --prompt="Select Workflow: " | awk '{print $1}')
# List branches, pick one with fzf
branch=$(git branch -r | sed 's/origin\///' | fzf --prompt="Select Branch: ")
# Run the selected workflow with the specified b
dmitrym0 / ediff.el
Created January 19, 2024 18:13
Prot's ediff setup
(setq ediff-keep-variants nil)
(setq ediff-make-buffers-readonly-at-startup nil)
(setq ediff-merge-revisions-with-ancestor t)
(setq ediff-show-clashes-only t)
(setq ediff-split-window-function 'split-window-horizontally)
(setq ediff-window-setup-function 'ediff-setup-windows-plain)
dmitrym0 / ot.el
Created October 26, 2022 17:50 — forked from jdtsmith/ot.el
org transpose: transpose shared level 1 and level 2 org headlines (i.e. grouping by level 2), and display in a new (read-only) buffer.
(defun my/org-transpose-view ()
(let* ((tree (org-element-parse-buffer 'headline))
(buf (current-buffer))
(tbuf (concat "*" (buffer-name buf) "-transpose*"))
(org-element-map tree 'headline
(lambda (hl)
(if (eq (org-element-property :level hl) 2) ;only level 2
(let* ((l2 (org-element-property :raw-value hl))

nothing to hide



dmitrym0 / focus.el
Created May 26, 2022 17:04
Create a stand alone frame for org-capture and then kill it when capture concludes.
(defun my/get-frame-by-name (fname)
"If there is a frame with named FNAME, return it, else nil."
(require 'dash) ; For `-some'
(-some (lambda (frame)
(when (equal fname (frame-parameter frame 'name))
(defun my/display-buffer-in-named-frame (buffer alist)
"Display BUFFER in frame with specific name.
local clockingLog ="clocking")
local clockingMenu =
local currentTask = nil
local function trim(s)
return (s:gsub("^%s*(.-)%s*$", "%1"))
local function eval(sexp, callback)

timestamp playground

Expect this heading to show up with TIMESTAMP<=<+14d> but it doesn’t

<2019-05-18 Sat>

dmitrym0 / dupes.el
Last active April 27, 2019 05:25
emacs lisp sandbox. see if all characters in a string are unque
(defun are-any-chars-duplicated (char-array &optional top-char)
"Takes in a list of characters and returns true if there's a dupe char. returns false if all chars are unique"
(message "top char: %s and array is" top-char)
(princ char-array)
(cond ((null char-array) false)
((null top-char) (are-any-chars-duplicated (cdr char-array) (car char-array)))
((equal (length char-array) 1)
(message "1 comparing %s %s" top-char (car char-array))
(equal top-char (car char-array))
(defun make-orgcapture-frame ()
"Create a new frame and run org-capture."
(make-frame '((name . "remember") (width . 80) (height . 16)
(top . 400) (left . 300)
(font . "-apple-Monaco-medium-normal-normal-*-13-*-*-*-m-0-iso10646-1")
(select-frame-by-name "remember")