#+STARTUP: showall #+TITLE: danamlund.dk #+LINK_UP: index.html #+LINK_HOME: index.html * COMMENT : #+OPTIONS: toc:nil : #+STYLE: : :headline-level 4 : :section-numbers nil : :style "" ** publish function #+BEGIN_SRC elisp (progn (progn (require 'org-publish) (set-background-color "white") (set-foreground-color "black") (org-publish-projects '( ("danamlund.dk-notes" :base-directory "~/data/danamlund.dk/org" :base-extension "org" :publishing-directory "~/data/danamlund.dk" :recursive t :publishing-function org-publish-org-to-html :headline-levels 4 :auto-preamble t :sub-superscript nil :author "Dan Amlund Thomsen" :email "dan@danamlund.dk" ) ("danamlund.dk-static" :base-directory "~/data/danamlund.dk/org" :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf\\|deb\\|zip\\|gz\\|html\\|txt\\|xml" :publishing-directory "~/data/danamlund.dk" :recursive t :publishing-function org-publish-attachment ))) (set-background-color "black") (set-foreground-color "white")) (let* ((dir-root "~/data") (dir-publish "danamlund.dk") (dir-ftp-clone "danamlund.dk_ftp") (ftp-host "danamlund.dk") (ftp-user "danamlund.dk") (ftp-pass (read-passwd "ftp password: ")) (ftp-dir "") (ftp-url (format "ftp://%s:%s@%s/%s" ftp-user ftp-pass ftp-host ftp-dir))) (defun get-newer-files (dir1 dir2 &optional filter) (let ((filter- (or filter (lambda (f) (or (equal f ".") (equal f "..") (equal f ".svn"))))) (f-newer (lambda (f1 f2) (let ((a1 (file-attributes f1)) (a2 (file-attributes f2))) (or (null a2) (> (car (nth 5 a1)) (car (nth 5 a2))) (> (cadr (nth 5 a1)) (cadr (nth 5 a2))))))) (output '()) (inputs (directory-files dir1))) (while (not (null inputs)) (let* ((f (car inputs)) (f1 (concat dir1 "/" f)) (f2 (concat dir2 "/" f))) (setq inputs (cdr inputs)) (cond ((funcall filter- (file-name-nondirectory f)) t) ((file-directory-p f1) (if (not (file-exists-p f2)) (setq output (cons f output))) (setq inputs (append (mapcar (lambda (f-) (concat f "/" f-)) (directory-files f1)) inputs))) ((funcall f-newer f1 f2) (setq output (cons f output)))))) (reverse output))) (let* ((changed-files (get-newer-files (concat dir-root "/" dir-publish) (concat dir-root "/" dir-ftp-clone))) (files (length changed-files)) (cur-file 1) (max-mini-window-height-temp max-mini-window-height)) (cd dir-root) (dolist (f changed-files) (message (format "Uploading file %d/%d: '%s'" cur-file files f)) (setq max-mini-window-height 0) (if (not (= 0 (shell-command (concat "curl " ;"--socks4 localhost:8080 " (if (file-directory-p f) (concat "-Q \"mkd " f "\"") (concat "-T \"" dir-publish "/" f "\"")) " \"" ftp-url (file-name-directory f) "\"")))) (error "Error uploading '%s'" (concat dir-publish "/" f))) (if (not (= 0 (shell-command (if (file-directory-p f) (concat "mkdir " dir-ftp-clone f "\n") (concat "cp \"" dir-publish "/" f "\" " "\"" dir-ftp-clone "/" f "\""))))) (error "error copying '%s'" (concat dir-publish "/" f))) (setq max-mini-window-height max-mini-window-height-temp) (setq cur-file (+ 1 cur-file))) (switch-to-buffer "*Uploaded files*") (dolist (f changed-files) (insert (concat f "\n"))) changed-files)) ) (setq org-publish-use-timestamps-flag nil) (setq org-publish-use-timestamps-flag t) #+END_SRC * Description #+HTML: A collection of stuff by Dan Amlund Thomsen. * Contents + [[./minesweeper_solver/index.html][Minesweeper solver]] : A minesweeper solver combining several approaches and an actual minesweeper game with a text-based GUI. + [[http://danamlund.dk/ubuntu_setup.html#sec-14][Emacs, notmuch, offlineimap and Gmail email system]] : How I have set up my mail system. (Links to the My Ubuntu 11.10 Eee 1011PX setup article) + [[./ubuntu_setup.org][My Ubuntu 11.10 Eee 1011PX setup]] : Description of how I have set up my system. + [[./pathfinding_visualizer.org][Path Finding Visualizer]] : OCaml script visualizing the result and calculation of path finding algorithms. + [[./eee-control/eee-control.org][eee-control karmic repackage]] : A hacked together deb for eee-control that works with karmic. + [[./emacs/no-easy-keys.org][No easy-keys]] : Train yourself to use the proper Emacs movement keys. + [[./emacs/make-runner.org][Make runner]] : Run makefiles easier in Emacs. + [[./emacs/orgsite.org][org-mode website example]] : How I make and manage this website using org-mode. + [[./sqlsorter.org][php ORDERBY function]] : Sort php arrays using the ORDERBY syntax from SQL.