Last active
December 21, 2015 05:09
-
-
Save taglia/6255115 to your computer and use it in GitHub Desktop.
Snippets of code for OSOMac's post Org-mode – Moving forward
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; 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) | |
) | |
) | |
)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Snippets of code for OSOMac's post Org-mode – Moving forward |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
; 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