http://al3xandr3.github.com/ is a better platform for writing longer texts, minimalist design, focused on my original content and not to be updated frequently. Is hosted on github.com pages, using jekkyl site generator and git for version control.
Have now improved workflow: I write in (aqua)emacs using orgmode, do orgmode-export-project and git commit the changes that updates the site directly. Also have full control over the site html, so i can make it in whatever layout i feel like(even if is ugly :P ).
source code is here: http://github.com/al3xandr3/al3xandr3.github.com
Note: I'm still keeping the http://alexandrenotebook.blogspot.com/ for re-posting, re-linking, and other shorter content.
Showing posts with label emacs. Show all posts
Showing posts with label emacs. Show all posts
Automating todo tasks lists reports
Here's the geek automation of the week, its for helping creating reports from my TODO tasks list when using the amazing emacs org-mode(see here whats org-mode all about).
(simplified) Work Flow
- I get a request, add it into my todo list queue, marking it as a TODO item.
- Work, work, work, guided by the todo listed tasks, balancing priority and effort and (..add your own reason here..).
- When finished, mark an item DONE.
- Generate a report every week with the done tasks.
Generating the Report
(I use this setup on Mac, with some adaptations should also on Linux and Windows)
Every week i then generate a report of the DONE Tasks, by running:
# file: get-work-done.sh
# run: sh get-work-done.sh
# Uses emacs to extract the DONE items from work.org, generating a work-done.csv
/Applications/Aquamacs.app/Contents/MacOS/Aquamacs -batch -l ~/.emacs -eval '(org-batch-agenda-csv "+TODO=\"DONE\"" org-agenda-files (quote ("/.../work.org")))' > work-done.csv
# Applies desired report formatting to the exported work-done.csv, generating work.csv
ruby format-report.rb work-done.csv
# Clean up the originally exported file
rm work-done.csv
# Opens the final file in the default .csv handler, typically Excel.
open work.csv
(see the comments "#" to understand what it does in each step)
Then I use the format-report.rb bellow to apply formatting to the report, for example: add my own header, add/remove columns, Dates, change names, calculate values, etc, etc... see example:
# file: format-report.rb
flines = File.open(ARGV[0]).readlines
column_map = {
"friendly_name_i_use1" => "required_final_report_name1",
"friendly_name_i_use2" => "required_final_report_name2",
"friendly_name_i_use3" => "required_final_report_name3"
}
File.open( "work.csv","w+") do |fl|
fl.puts "header1,header2,header3,header4"
flines.each do |l|
a = l.split(",")
# Time, mapping-defined-in-column_map, original-column-2, original-column-3
fl.puts Time.now.strftime("%m/%d/%Y") + "," + (column_map[a[1]] || a[1]) + "," + a[2] "," + a[3]
end
end
And voila, i run this and an excel sheet opens up with the report of the week.
Javascript validator on Emacs (v2)
A Javascript validator that I use frequently, mentioned here for Textmate, now on Emacs:
To force to run: M-x my-js-validate
With the hooks setup, whenever a javascript file is saved then my-js-validate is executed.
(if you use js2-mode or espresso-mode, then you need to change 'javascript-mode-hook accordingly, for example to 'espresso-mode-hook)
(defun my-js-validate () (interactive) (if (string-match "\\.js$" (buffer-file-name)) (shell-command (concat "java -jar /Bins/Javascript/rhino1_7R2/js.jar /Bins/Javascript/lint/rhino_jslint.js " (buffer-file-name (current-buffer)))))) (defun my-js-hooks () (progn (message "Entered Javascript Mode") (add-hook 'after-save-hook 'my-js-validate))) (add-hook 'javascript-mode-hook 'my-js-hooks)
To force to run: M-x my-js-validate
With the hooks setup, whenever a javascript file is saved then my-js-validate is executed.
(if you use js2-mode or espresso-mode, then you need to change 'javascript-mode-hook accordingly, for example to 'espresso-mode-hook)
Emacs (v2)
Iteration I
Started using the Carbon version of emacs. Then take a look at: Emacs Starter Kit(ESK), it provides a saner set of defaults than you get normally with Emacs. For step by step installation instructions, here's a good tutorial: Setting up Emacs & Clojure with Emacs Starter Kit. And finally, a few of more details about developing Clojure setup with the ESK, from ESK author himself.
Iteration II
After spending some time with Carbon Emacs(and learning a bit better how emacs work) I've decided to try out the Aquamacs version.
Aquamacs is, out of the box, more mac friendly because supports default key bindings like copy, paste, selectAll, etc.. that all mac text handling apps normally have.
And thats actually very useful, even after learning a lot of emacs shortcuts. Note that emacs key bindings are also worth learning, is amazing to discover how many applications support them. But i've found that stuff like Ctr-C, Ctr-V, and Selecting text working as you expect just make you move around faster.
One issue i ran into, is that the ESK i mentioned before is not compatible with Aquamacs because of different key bindings schemes.
But that turned out not to be a problem, and ended up learning on how to customize Emacs in the process, Here's a a few references i've used for my current emacs setup:
References:
- AquamacsFAQ, for several tips and tricks on the Aquamacs
- Emacs Wiki, central point for a lot of emacs packages and tips, essential reference.
- ESK, I use this as a reference, for learning on how to customize and go check what packages are used there. I use, for example, the zenburn.el theme from there.
Packages:
- ELPA, for installing packages, great to install all you need for Clojure development instantly.
- ido, lot of helpful stuff, especially the automatic completion when using Dired.
- espresso, for javascript editing.
- Balancing your parentheses, to customize the highlight of your parenthesis, even possible to highlight a mismatched parenthesis with red, to give visual hint you closing the wrong ones!
Subscribe to:
Posts (Atom)