Skip to content

Instantly share code, notes, and snippets.

View gregnewman's full-sized avatar

Greg Newman gregnewman

View GitHub Profile
;; Save all backup file in this directory.
(setq backup-directory-alist (quote ((".*" . "~/.emacs_backups/"))))
(defvar user-temporary-file-directory
(concat temporary-file-directory user-login-name "/"))
(make-directory user-temporary-file-directory t)
(setq backup-by-copying t)
(setq backup-directory-alist
`(("." . ,user-temporary-file-directory)
(,tramp-file-name-regexp nil)))
@gregnewman
gregnewman / license
Created January 27, 2010 10:34 — forked from defunkt/license
#!/bin/sh -e
# Usage: license
# Prints an MIT license appropriate for totin' around.
#
# $ license > COPYING
year=`date "+%Y"`
cat <<EOF
Copyright (c) $year Chris Wanstrath
Permission is hereby granted, free of charge, to any person obtaining
;;; init.el --- Where all the magic begins
;;
;; This file loads both
;; - Org-mode : http://orgmode.org/ and
;; - Org-babel: http://orgmode.org/worg/org-contrib/babel/org-babel.php#library-of-babel
;;
;; It then loads the rest of our Emacs initialization from Emacs lisp
;; embedded in literate Org-mode files.
;; Load up Org Mode and Org Babel for elisp embedded in Org Mode files
"""
This fabric file makes setting up and deploying a django application much
easier, but it does make a few assumptions. Namely that you're using Git,
Apache and mod_wsgi and your using Debian or Ubuntu. Also you should have
Django installed on your local machine and SSH installed on both the local
machine and any servers you want to deploy to.
_note that I've used the name project_name throughout this example. Replace
this with whatever your project is called._
=====================
Readernaut Public API
=====================
1.0 (pre-release)
=================
Reader Books
------------
#!/bin/sh
# on ubuntu: need some utils & dev libs
sudo apt-get install apache2-utils openssl libssl-dev libpcre3-dev
# compile nginx
cd /tmp
curl http://nginx.org/download/nginx-0.7.64.tar.gz | tar xz
cd nginx*
./configure --with-http_ssl_module --with-http_dav_module \
#!/bin/sh
# Add dot file changes to bitbucket - to include my org files
REPOS="hgfiles"
for REPO in $REPOS
do
echo "Repository: $REPO"
cd ~/$REPO
# Add new files
emacs -q --eval '(condition-case err (progn (load "~/.emacs") (kill-emacs 0)) (error (kill-emacs 1)))'
# Source http://groups.google.com/group/gnu.emacs.help/browse_thread/thread/bed5b2bd8b237f5a?pli=1
(defvar org-my-archive-expiry-days 1
"The number of days after which a completed task should be auto-archived.
This can be 0 for immediate, or a floating point value.")
(defconst org-my-ts-regexp "[[<]\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [^]>\r\n]*?\\)[]>]"
"Regular expression for fast inactive time stamp matching.")
(defun org-my-closing-time ()
(let* ((state-regexp
(concat "- State \"\\(?:" (regexp-opt org-done-keywords)
(defvar org-my-archive-expiry-days 1
"The number of days after which a completed task should be auto-archived.
This can be 0 for immediate, or a floating point value.")
(defconst org-my-ts-regexp "[[<]\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [^]>\r\n]*?\\)[]>]"
"Regular expression for fast inactive time stamp matching.")
(defun org-my-closing-time ()
(let* ((state-regexp
(concat "- State \"\\(?:" (regexp-opt org-done-keywords)