Skip to content

Instantly share code, notes, and snippets.

View dwcoates's full-sized avatar

Dodge Coates dwcoates

  • Chess.com
  • New York, NY
View GitHub Profile
@dwcoates
dwcoates / eshell-swap-prompts.el
Created December 14, 2017 05:39
Swap between minimal/cwd+git eshell prompts.
(defun eshell-default-prompt-function ()
(interactive)
(concat
(system-name) ":"
(propertize (car (last (split-string (pwd-repl-home (eshell/pwd)) "/"))) 'face
`(:foreground "#cdcd00"))
(or (curr-dir-git-branch-string (eshell/pwd)))
(propertize "# " 'face 'default)))
(defun eshell-short-prompt-function ()
@dwcoates
dwcoates / org-latex-export-region-to-pdf.el
Created January 27, 2018 19:55
A function for cleanly exporting current active region to pdf. Unlike normal exporting, prompts for filename and declutters output.
(defun org-latex-export-region-to-pdf (beg end &optional no-declutter)
"Export the current region to pdf, prompting for output filename.
This can be done by narrowing region, but it's a bit slow, and
the output is ugly and cluttered. More importantly, it also
writes the pdf file for the region using the name of the
original file, which is obviously annoying.
with NO-DECLUTTER non-nil, don't declutter the pdf output."
(interactive (if (region-active-p)
@dwcoates
dwcoates / build-gcc.sh
Created December 29, 2021 22:43 — forked from jeetsukumaran/build-gcc.sh
Build and Install GCC Suite from Scratch
#! /bin/bash
GCC_VERSION="5.2.0"
WORKDIR="$HOME/src/"
INSTALLDIR="/platform"
## NOTE: XCode must be installed (through App Store) and the following run to install command-line tools.
## THIS IS IMPORTANT! Among other things, it creates '/usr/include' and installs the system header files.
# xcode-select --install