Skip to content

Instantly share code, notes, and snippets.

I'm glad to hear that! Is there anything else you need help with in relation to Emacs?

ChatGPT> How do I ward off evil wizards who may turn me into emacs in the future? Ah, warding off evil wizards can be quite challenging! However, I can suggest some ways to keep yourself safe from such curses in the future. Here are some preventative measures you can take:

  1. Stay away from wizards who practice dark magic. It's easier said than done, but if you're able to, avoid wizards who have a reputation for being particularly malicious or using their powers for unethical purposes.
  2. Carry a protective talisman or amulet with you at all times. There are many magical items that can help ward off evil curses, such as crystals or charms that are charged with positive energy.
  3. Learn some basic protective spells. If you have some knowledge of magic, you may be able to learn spells that can protect you from curses and other harmful magic. It's always good to know how to defend yourself!
  4. Regularly c

Here’s a handy key-binding I use to open a vterm at the current directory

(global-set-key
 "\C-ct"
 (lambda (&optional new-vterm) (interactive "P")
   (let ((dir (expand-file-name default-directory)))
     (vterm new-vterm)
     (if

On Apple’s Terminal.app, dragging a file into the terminal inserts the path to the file as text. This feels ergonomic to me; here’s a quick way to set up vterm to do the same thing:

(defun russruss/insert-local-url-as-path-vterm
    (url &optional action)
  (vterm-send-string
   (car
@russellmcc
russellmcc / rtemp.coffee
Created January 7, 2014 03:55
Russell Temperature scale
http = require 'http'
kelvinToRussell = (kelvin) ->
kelvin = +kelvin
temps = [0, 273.15, 310.15, 373.15]
for i in [0...temps.length - 1]
if kelvin < temps[i + 1]
return i + (kelvin - temps[i]) / (temps[i + 1] - temps[i])
return 3 + (1 - 373.15 / kelvin)
@russellmcc
russellmcc / fish.el
Last active January 15, 2025 20:40
How to use fish shell paths from emacs
(let*
((fish-path (shell-command-to-string "/opt/homebrew/bin/fish -i -c \"echo -n \\$PATH[1]; for val in \\$PATH[2..-1];echo -n \\\":\\$val\\\";end\""))
(full-path (append exec-path (split-string fish-path ":"))))
(setenv "PATH" fish-path)
(setq exec-path full-path))