WP-Syntax Download Extension

Moving from tDiary, I’m kind of new to WordPress. I chose it because it was easy enough to run it on my server and had a lot of nifty, nice-looking plugins that would do me with everything that I needed.  As you may imagine, while using those plugins is fine and cool, looking into the code is hell. Through my journey of fixing problems I encountered and submitting a couple of patches to the plugin authors, I’ve seen full of code duplicates, unoptimized funtion call repetition, lack of look-up table pre-generation or even a simple memoization, parsing and substituting HTML with messy, awkward, terribly composed regexps, etc. etc. .  OK, life is short, let’s just turn a blind eye to them as long as the code works.
Well,  so much for digressions.  I just wanted to write a code blog like this.  In order to do that, there is no doubt you need a good code highlighting engine with download/view buttons.  I searched around for the best, but no combination of plugins appealed to my taste.  I decided to write a plugin to add what is lacking for me  to WP-Syntax and here it is.  WP-Syntax Download Extension renders a nice caption on each WP-Syntax highlighted code snippet as below.

(defun goto-next-window (&optional arg)
  (interactive "P")
  (cond ((one-window-p)
         (select-window (split-window-horizontally)))
        (arg (other-window -1))
        (t (other-window 1))))
(global-set-key "\C-o" 'goto-next-window)
(global-set-key "\M-\C-o" 'open-line)

I’ll probably add “print” and “copy to clipboard” buttons in the future. Try it out and feel free to leave a comment.

git-shift: Changing commit timestamps in Git

Git is known to be so flexible that one can even fix or delete old commits, but what would you do if you wanted to change the timestamp of a particular commit? This need can arise for various reasons, such as when a merged commit has picked the unwanted timestamp on squash, when a contributor’s (or your notebook’s) machine clock was obviously far out of sync, and so on.
git-shift (update: repository moved) is the tool I wrote to change dates (timestamps) of specified commits in a git repository.  The choice of the name sounds a bit too bold, so maybe I will rename it later—but anyway.
The usage is simple; specify the amount of time you want to shift timestamps by, and a list of commit IDs you want to change timestamps of. (Range notation is currently not supported)
e.g. to move timestamps of commits identified by the IDs f9e8d7c6 and 579acf two hours backwards:

$ git-shift -2h f9e8d7c6 579acf

Use it wisely and enjoy your life, night and day workers! :D