Skip to content

Instantly share code, notes, and snippets.


Henrik Lissner hlissner

View GitHub Profile
hlissner /
Last active Oct 27, 2020
Codesign gdb on OSX
hlissner /
Last active Sep 26, 2020
Bulk search & replace with ag (the_silver_searcher)
# ag <>
# usage: [search] [replace]
# caveats: will choke if either arguments contain a forward slash
# notes: will back up changed files to *.bak files
ag -0 -l $1 | xargs -0 perl -pi.bak -e "s/$1/$2/g"
# or if you prefer sed's regex syntax:
ag -0 -l $1 | xargs -0 sed -ri.bak -e "s/$1/$2/g"
hlissner / git-gutter.el
Last active Sep 13, 2020
My Emacs git-gutter configuration, paraphrased
View git-gutter.el
(defconst doom-fringe-size '3 "Default fringe width")
;;; Setting up the fringe
;; switches order of fringe and margin
(setq-default fringes-outside-margins t)
;; standardize fringe width
(fringe-mode doom-fringe-size)
(push `(left-fringe . ,doom-fringe-size) default-frame-alist)
(push `(right-fringe . ,doom-fringe-size) default-frame-alist)
hlissner / custom-set-faces.el
Last active May 30, 2020
Convenience macro for additively setting face attributes in Doom Emacs
View custom-set-faces.el
(defmacro custom-theme-set-faces! (theme &rest specs)
"Apply a list of face specs as user customizations for THEME.
THEME can be a single symbol or list thereof. If nil, apply these settings to
all themes. It will apply to all themes once they are loaded.
(custom-theme-set-faces! '(doom-one doom-one-light)
`(mode-line :foreground ,(doom-color 'blue))
`(mode-line-buffer-id :foreground ,(doom-color 'fg) :background \"#000000\")
'(mode-line-success-highlight :background \"#00FF00\")
hlissner /
Last active May 13, 2020
(Doom Emacs) Persists the Emacs' frame's dimensions, location and full-screen state across sessions
hlissner /
Created Apr 3, 2019
Install yay on Arch Linux
if ! command -v yay >/dev/null; then
tmp=$(mktemp -d)
function finish { rm -rf "$tmp"; } # clean up after yourself...
trap finish EXIT # matter how you exist
git clone "$tmp"
pushd "$tmp"
makepkg -sri --noconfirm --needed
View org-lazy-babel.el
(defvar +org-babel-mode-alist
'((cpp . C)
(C++ . C)
(D . C)
(sh . shell)
(bash . shell)
(matlab . octave)
(amm . ammonite))
"An alist mapping languages to babel libraries. This is necessary for babel
libraries (ob-*.el) that don't match the name of the language.
hlissner /
Last active May 16, 2019
Install pacaur on Arch Linux
if ! command -v pacaur >/dev/null; then
tmp=$(mktemp -d)
function finish {
rm -rf "$tmp"
trap finish EXIT
pushd $tmp
for pkg in cower pacaur; do
curl -o PKGBUILD$pkg && \
hlissner /
Last active Apr 18, 2019
Iptables default rules
#### IPS ######
# Get server public ip
SERVER_IP=$(ifconfig eth0 | grep 'inet addr:' | awk -F'inet addr:' '{ print $2}' | awk '{ print $1}')
#### FILES #####
You can’t perform that action at this time.