Skip to content

Instantly share code, notes, and snippets.

@taglia
Last active December 21, 2015 05:09
Show Gist options
  • Save taglia/6255115 to your computer and use it in GitHub Desktop.
Save taglia/6255115 to your computer and use it in GitHub Desktop.
Snippets of code for OSOMac's post Org-mode – Moving forward
; Custom Agenda Views
(setq org-agenda-custom-commands
'(("p" agenda ""
((org-agenda-ndays 28)
(org-agenda-files '("~/Documents/org/personal.org"))
(org-agenda-text-search-extra-files nil)
)
)
("w" agenda ""
((org-agenda-ndays 28)
(org-agenda-files '("~/Documents/org/work.org"))
(org-agenda-text-search-extra-files nil)
)
)
("m" agenda ""
((org-agenda-ndays 28)
)
)
("P" todo ""
((org-agenda-files '("~/Documents/org/personal.org"))
(org-agenda-text-search-extra-files nil)
)
)
("W" todo ""
((org-agenda-files '("~/Documents/org/work.org"))
(org-agenda-text-search-extra-files nil)
)
)
))
#!/bin/sh
while true; do
date
echo "git add ."
/usr/bin/git add .
echo "git commit"
/usr/bin/git commit -a --allow-empty-message -m ''
echo "git pull"
/usr/bin/git pull origin master
echo "git push"
/usr/bin/git push origin master
echo "Sleeping..."
sleep 1800
done
;; Auto-sync with org-caldav
(defvar org-caldav-sync-timer nil)
(defvar org-caldav-sync-idle-secs (* 60 60 12))
(defun org-caldav-sync-enable ()
"enable automatic org-caldav sync with Google calendar"
(interactive)
(setq org-caldav-sync-timer
(run-with-idle-timer org-caldav-sync-idle-secs t
'org-caldav-sync)));
(defun org-caldav-sync-disable ()
"disable automatic org-caldav sync"
(interactive)
(cancel-timer org-caldav-sync-timer))
(org-caldav-sync-enable)
; Auto sync when starting and quitting
(add-hook 'after-init-hook 'org-caldav-sync)
(add-hook 'kill-emacs-hook 'org-caldav-sync)
;; Auto-sync with org-caldav
(defvar org-caldav-sync-timer nil)
(defvar org-caldav-sync-idle-secs (* 60 60 12))
(defun org-caldav-sync-enable ()
"enable automatic org-caldav sync with Google calendar"
(interactive)
(setq org-caldav-sync-timer
(run-with-idle-timer org-caldav-sync-idle-secs t
'org-caldav-sync)));
(defun org-caldav-sync-disable ()
"disable automatic org-caldav sync"
(interactive)
(cancel-timer org-caldav-sync-timer))
(org-caldav-sync-enable)
; Auto sync when starting and quitting
(add-hook 'after-init-hook 'org-caldav-sync)
(add-hook 'kill-emacs-hook 'org-caldav-sync)
Snippets of code for OSOMac's post Org-mode – Moving forward
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Setting org files in registers
(set-register ?p '(file . "~/Documents/org/personal.org"))
(set-register ?w '(file . "~/Documents/org/work.org"))
(set-register ?i '(file . "~/Documents/org/mobile-inbox.org"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment