Skip to content

Instantly share code, notes, and snippets.

@dmitrym0
dmitrym0 / ediff.el
Created January 19, 2024 18:13
Prot's ediff setup
;; https://www.youtube.com/watch?v=pSvsAutseO0
(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
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 ()
(interactive)
(let* ((tree (org-element-parse-buffer 'headline))
(buf (current-buffer))
(tbuf (concat "*" (buffer-name buf) "-transpose*"))
tp)
(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

privacy

Notes

@dmitrym0
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))
frame))
(frame-list)))
(defun my/display-buffer-in-named-frame (buffer alist)
"Display BUFFER in frame with specific name.
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(

timestamp playground

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

<2019-05-18 Sat>

@dmitrym0
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)
(progn
(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."
(interactive)
(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")
(raise-frame)
(delete-other-windows)
version: '2'
services:
wordpress:
image: wordpress:4.7-apache
volumes:
- "/var/blog/wordpress:/var/www/html"
environment:
WORDPRESS_DB_PASSWORD: passwordd