Skip to content

Instantly share code, notes, and snippets.

@ieure
ieure / tiling
Created March 17, 2009 16:52
Code to handle centering and tiling of Emacs frames
;; Functions to work with frames
(provide 'ime-frame)
(defun screen-usable-height (&optional display)
"Return the usable height of the display.
Some window-systems have portions of the screen which Emacs
cannot address. This function should return the height of the
screen, minus anything which is not usable."
@djsutherland
djsutherland / latex-clean.sh
Last active December 27, 2023 23:19
A bash script to clean latex temp files
#!/bin/bash
# Note: you might prefer latexmk -c since latexmk is great. It doesn't clean all of these, but see
# https://tex.stackexchange.com/questions/83341/clean-bbl-files-with-latexmk-c/83386#83386
exts=".aux .lof .log .lot .fls .out .toc .dvi .bbl .bcf .blg -blx.aux -blx.bib -blx.bib .run.xml .fdb_latexmk .synctex.gz .syntex.gz(busy) .pdfsync .algorithms .alg .loa .thm .nav .snm .vrb .acn .acr .glg .glo .gls .brf .lol .idx .ilg .ind .ist .maf .mtc .mtc0 .pyg .nlo .tdo .xdy .keys"
for x in "${@:-.}"; do
arg=$(echo ${x:-.} | perl -pe 's/\.(tex|pdf)$//')
@dpo
dpo / BibTeX.sublime-build
Last active March 2, 2020 21:56
Sublime build definition to clean up auxiliary LaTeX files. CleanLatexFiles.sublime-build is taken from https://gist.github.com/2852859. Other files are adapted from various sources. Place all files in Packages/User/
{
"cmd": ["bibtex", "$project_path/$project_base_name"],
"working_dir": "$project_path",
"path": "$PATH:/usr/texbin:/usr/local/bin",
"file_regex": "^(...*?):([0-9]+): ([0-9]*)([^\\.]+)",
"selector": "text.tex.latex"
}
@bjmorgan
bjmorgan / Bibtex.sublime-build
Created December 20, 2012 23:30 — forked from dpo/BibTeX.sublime-build
Build files, keymap entries, and `run_latex_build.py` plugin for adding the option for running bibtex and cleaning up auxiliary files for LaTeX in Sublime Text 2. Added the ability to run bibtex, and changed key bindings.
{
"cmd": ["bibtex", "$file_base_name"],
"path": "$PATH:/usr/texbin:/usr/local/bin",
"file_regex": "^(...*?):([0-9]+): ([0-9]*)([^\\.]+)",
"selector": "text.tex.latex"
}
@abo-abo
abo-abo / org-agenda-quick-jump
Created July 20, 2013 11:35
org-mode agenda quick month/year selection with hjkl and 0-9.
(defvar lawlist-month)
(defvar lawlist-year nil)
(defun lawlist-org-agenda-view-mode-dispatch ()
"Select the month in agenda view."
(interactive)
(message "View: [1-9] [o]CT [n]OV [d]EC, j(next), k(prev).")
(let* ((a (read-char-exclusive))
(year (or lawlist-year
(setq lawlist-year