Skip to content

Instantly share code, notes, and snippets.

View hlissner's full-sized avatar
🛠️
Chipping away at Doom v3.0

Henrik Lissner hlissner

🛠️
Chipping away at Doom v3.0
View GitHub Profile
@hlissner
hlissner / doom-persist-frame.md
Last active April 15, 2024 19:20
(Doom Emacs) Persists the Emacs' frame's dimensions, location and full-screen state across sessions
@hlissner
hlissner / codesign_gdb.md
Last active March 11, 2024 07:09
Codesign gdb on OSX
(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
hlissner / replace.sh
Last active September 11, 2023 10:14
Bulk search & replace with ag (the_silver_searcher)
# ag <https://github.com/ggreer/the_silver_searcher>
# usage: ag-replace.sh [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
hlissner / synology-ddns.linode.php
Last active July 29, 2022 14:44
A DDNS service provider script for Synology NAS (based off https://github.com/cpascal/syno-ddns-linode/blob/master/linode.php)
#!/usr/bin/php -d open_basedir=/usr/syno/bin/ddns
<?php
if ($argc !== 5) {
echo 'badparam';
exit();
}
// Entered into DSM (Control Panel > External Access > DDNS)
$username = (string) $argv[1]; // Resource ID
@hlissner
hlissner / capture.el
Last active July 16, 2022 21:26
Examples of Doom CLI scripts
#!/usr/bin/env doomscript
;; An example script showing off how use Doom's CLI framework to write your own.
(defcli! (capture)
((key ("-k" "--key" key))
&input input &args args)
"Open an org-capture window."
(exit! "emacsclient" "-a" "" "-e"
(format "(+org-capture/open-frame %S %S)"
(concat input (string-join args " "))
@hlissner
hlissner / lb6.js
Last active January 20, 2022 16:36
LaunchBar 6 API stubs (for ternjs)
/**
* LaunchBar Javascript API (see http://www.obdev.at/products/launchbar/index.html)
*
* For use with auto-completion libraries.
*/
// Included to hide "unused function" warnings
run();
runWithItem({});
runWithPaths({});
@hlissner
hlissner / git-gutter.el
Last active September 13, 2020 11:24
My Emacs git-gutter configuration, paraphrased
(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
hlissner / custom-set-faces.el
Last active May 30, 2020 13:18
Convenience macro for additively setting face attributes in Doom Emacs
(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\")