Skip to content

Instantly share code, notes, and snippets.

View choroba's full-sized avatar
🐫
open source

E. Choroba choroba

🐫
open source
  • Prague, Czech Republic
View GitHub Profile
@choroba
choroba / quote-region.el
Created August 29, 2018 21:59
Emacs lisp: quote region
(defun quote-region (from to char)
"Surround region in quotes or brackets"
(interactive "r\ncChar:")
(let ((to (+ to 1))
(chars (case char
(?\( (list "(" ")"))
(?\[ (list "[" "]"))
(?\{ (list "{" "}"))
(?\< (list "<" ">"))
(t (list char char)))))
@choroba
choroba / git-rebase.sh
Created February 28, 2020 14:40
Git rebase with copy
#!/bin/bash
set -eu
tmp=$(mktemp -d)
cd "$tmp"
git init
git config user.email abc@example.com
echo file a > a.txt
echo file b > b.txt