Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python
"""\
A command-line utility that can (re)send all messages in an mbox file
to a specific email address, with options for controlling the rate at
which they are sent, etc.
"""
# I got this script from Robin Dunn a few years ago, see
# https://github.com/wojdyr/fityk/wiki/MigrationToGoogleGroups
(defun mac-osx-editing-insert-at ()
"Insert @ at point"
(interactive)
(insert-char ?@ 1))
(defun mac-osx-editing-insert-curly-left ()
"Insert { at point"
(interactive)
(insert-char ?{ 1))
;; Keybonds
(global-set-key [(hyper a)] 'mark-whole-buffer)
(global-set-key [(hyper v)] 'yank)
(global-set-key [(hyper c)] 'kill-ring-save)
(global-set-key [(hyper s)] 'save-buffer)
(global-set-key [(hyper l)] 'goto-line)
(global-set-key [(hyper w)]
(lambda () (interactive) (delete-window)))
(global-set-key [(hyper z)] 'undo)
@priyadarshan
priyadarshan / reorg_library.py
Created May 27, 2013 20:25
Reorganise Library
import os
import re
import subprocess
import sys
PART_RE = re.compile(ur"^(.+)-part-\d+$")
if __name__ == "__main__":
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
import os
import re
import sys
CITE_KEY_RE = re.compile(ur"\s*:CITE-KEY:\s*(\w+)(-\d+)?", re.IGNORECASE)
PROPERTIES_RE = re.compile(ur"(\s*):PROPERTIES:\s*", re.IGNORECASE)
END_RE = re.compile(ur"\s*:END:\s*", re.IGNORECASE)
citeKeys = {}
import os
import re
import sys
CITE_KEY_RE = re.compile(ur"\s*:CITE-KEY:\s*(\w+)(-\d+)?", re.IGNORECASE)
PROPERTIES_RE = re.compile(ur"(\s*):PROPERTIES:\s*", re.IGNORECASE)
END_RE = re.compile(ur"\s*:END:\s*", re.IGNORECASE)
GENRE_RE = re.compile(ur"\s*:GENRE:\s*(note|preface|section)\b", re.IGNORECASE)
@priyadarshan
priyadarshan / xorg.conf
Created June 5, 2013 16:31
pc-bsd xorg.conf
Section "ServerLayout"
Identifier "X.org Configured"
Screen 0 "Screen0" 0 0
Screen 1 "Screen1" RightOf "Screen0"
Screen 2 "Screen2" RightOf "Screen1"
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection
Section "Files"
@priyadarshan
priyadarshan / PC-BSD 9.1-RELEASE-p5 Diagnostic Sheet.txt
Created June 5, 2013 17:08
PC-BSD 9.1-RELEASE-p5 Diagnostic Sheet
PC-BSD 9.1-RELEASE-p5 Diagnostic Sheet
Generated: Wed Jun 5 13:07:26 EDT 2013
-----------------Dmesg Output-------------------------
Copyright (c) 1992-2012 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 9.1-RELEASE-p5 #0: Thu May 23 16:45:07 UTC 2013
@priyadarshan
priyadarshan / cite_key.py
Last active December 18, 2015 20:48
Fix CITE-KEY regex
import os
import re
import sys
CITE_KEY_RE = re.compile(ur"\s*:CITE-KEY:(?:\s*(\w+)(-\d+)?)?", re.IGNORECASE)
PROPERTIES_RE = re.compile(ur"(\s*):PROPERTIES:\s*", re.IGNORECASE)
END_RE = re.compile(ur"\s*:END:\s*", re.IGNORECASE)
META_GENRE_RE = re.compile(ur"\s*:GENRE:\s*(note|preface|section)\b", re.IGNORECASE)