Skip to content

Instantly share code, notes, and snippets.

@abrochard
abrochard / magit-test-section.el
Created October 24, 2022 15:57
Quick gist to play around with magit-section
;; See https://magit.vc/manual/magit-section.html
(defun magit-test-section ()
(interactive)
;; create a new buffer
(with-current-buffer (get-buffer-create "*magit-test-section*")
;; trigger the magit section mode
(magit-section-mode)
;; deactivate the buffer read-only mode temporarily

ERT: Emacs Lisp Regression Testing

Why should you care

“Software is easy to write, hard to debug, impossible to maintain.”

Automatically make sure that you didn’t break stuff by writing tests.

Emacs lisp in particular:

  • ancient
  • quirky
@abrochard
abrochard / presentation.org
Last active November 13, 2024 19:00
Notes from the "Conquering Kubernetes with Emacs" presentation

Conquering Kubernetes with Emacs

Specific Annoying workflow

Listing pods with kubectl get pods, then select a pod name and copy paste it into kubectl logs [pod name]

Why?

  • I want to streamline my workflow and stop using the terminal
  • learn more about kubernetes
  • main kubernetes extension for Emacs out there is greedy for permissions
@abrochard
abrochard / scratch.el
Created June 12, 2019 19:47
transient demo
(defun echo-function (&optional args)
(interactive
(list (transient-args 'test-transient-command)))
(message "echo %s" args))
(define-infix-argument test-transient:--message ()
:description "Message"
:class 'transient-option
:shortarg "-m"
(require 'flycheck)
;; checkout https://www.macs.hw.ac.uk/~rs46/posts/2018-12-29-textlint-flycheck.html
;;
;; sudo npm install -g textlint write-good textlint-plugin-latex textlint-rule-write-good textlint-rule-no-start-duplicated-conjunction textlint-rule-max-comma textlint-rule-terminology textlint-rule-period-in-list-item textlint-rule-unexpanded-acronym textlint-rule-abbr-within-parentheses textlint-rule-alex textlint-rule-common-misspellings textlint-rule-en-max-word-count textlint-rule-diacritics textlint-rule-stop-words
(flycheck-define-checker textlint
"A linter for textlint."
:command ("textlint"
;; "--config" "/home/abrochard/.emacs.d/.textlintrc"
@abrochard
abrochard / yasnippet.org
Created December 4, 2018 20:42
Notes for the Emacs lightning talk about yasnippet of 12/03/2018

Lightning Talk: Yasnippet

Why

Because writing is hard but also our job. Yasnippet replaces a text key with a defined template.

Basic Usage

Installation