I’ve been putting together memhack , a memory scanner for Linux written in Go. You point it at a running process, search its memory for a value, narrow the matches down as that value changes, then write new values back. On Windows this is what Cheat Engine is for, and on Linux there’s already scanmem , with GameConqueror as its GTK front-end. Cheat Engine in particular still goes well beyond…
It’s often the case one has to deal with a repl-crashing amount of data via Babashka. In clojure I reach for hashp but this time I thought I’d try out Chris Badahdah’s Portal which describes itself as the following: “A clojure tool to navigate through your data”. Amazingly, you can even try it out online! Here’s how to set it up: In bb.edn: { ... :deps { djblue/portal { :mvn/version "0.42.1" }}…
At least in Doom Emacs the default keybindings for evil-mc are really cumbersome, here’s a Hydra that makes things much easier: ( defhydra my-mc-hydra ( :color pink :hint nil :pre ( evil-mc-pause-cursors )) " ^Match^ ^Line-wise^ ^Manual^ ^^^^^^---------------------------------------------------- _Z_: match all _J_: make & go down _z_: toggle here _m_: make & next _K_: make & go up _r_: remove last…
( defmacro named-time "Evaluates expr and prints the `nme` and the time it took. Returns the value of expr." [ nme # expr ] ` ( let [ start # ( . System ( nanoTime )) ret # ~ expr ] ( prn ( str "Elapsed time (" ~ nme # ") " ( / ( double ( - ( . System ( nanoTime )) start # )) 1000000.0 ) " msecs" )) ret # )) Like the time function that Babashka/Clojure has in core, but accepts a name so that it’s…
I recently ran rm -rf * in my home directory, which apart from being very foolish, reminded me that I have backups of basically every file I’ve edited: ( setq backup-directory-alist ` (( "." . "~/.backups" )) backup-by-copying t delete-old-versions t kept-new-versions 6 kept-old-versions 2 version-control t ) Most of those are self-explanatory, but the long-and-short of it is that I end up with…
I was just introduced to a tool called Delta which is a pager you can use with Git to give you Github-esque diffs. Tiny bit of elisp to configure: ( use-package magit-delta :ensure t :hook ( magit-mode . magit-delta-mode )) Delta itself is incredibly configurable and from the command line has some nice features such as side-by-side diffs.
To save all attachments from an mu4e email to a particular directory, you can use this handy snippet for older versions of the client. For more modern mu4e versions, use the elisp by @sj30 .
Hopefully the docstring explains this well enough: ( defmacro condev "Takes clauses in the same style as `cond` but, if the left side is truthy, will execute the right side of the expressions as a function which gets the result of evaluation of the left side." [ & clauses ] ( assert ( even? ( count clauses ))) ( let [ pstep ( fn [[ test step ]] ` ( when-let [ r # ~ test ] ( ~ step r # )))] ` (…
Handy function to export environment variables to Emacs from the command line: function export-emacs { if [ " $( emacsclient -e t ) " != 't' ] ; then return 1 fi for name in " ${ @ } " ; do value = $( eval echo \"\$ { ${ name } // \\\" / \\\\ 042 } \" ) emacsclient -e "(setenv \" ${ name } \" \" ${ value } \" )" > /dev/null done } Use it like this: export BLAH = "Some value" export-emacs BLAH And…
Yadm’s an amazing dotfile manager that’s basically a thin wrapper around git and a bare repo. With it being a bare repo, you’ll not be able to manage it directly with Magit so here’s a really smart tip I found that will let you access it via Tramp: ( use-package tramp :config ( add-to-list 'tramp-methods ' ( "yadm" ( tramp-login-program "yadm" ) ( tramp-login-args (( "enter" ))) ( tramp-login-env…