2005-04-08

randomfox: (Default)
2005-04-08 03:29 pm

Simple versioned backup

This Perl script adds a time stamp to the file name and copies the file to a backup directory.

Read more... )
randomfox: (Default)
2005-04-08 03:29 pm

Rename to a numbered file name

This Perl script renames buff-out.ogf to b###.ogf, where ### is the next higher number after the highest numbered b###.ogf file. It is used for keeping an archive of submitted distributed.net OGR packets.

Read more... )
randomfox: (Default)
2005-04-08 04:12 pm

Vim: Convert special characters to HTML entities

This Vim macro converts <, >, ", and & into &lt;, &gt;, &quot;, and &amp; respectively. You can use this macro in both normal and visual modes. Its main use so far has been to convert scripts and code for posting to this journal.

Read more... )
randomfox: (Default)
2005-04-08 04:12 pm

Vim: Convert HTML from "My Caches" page at geocaching.com into a list of cache links

This Vim macro takes the HTML table from the "My Caches" page at geocaching.com and converts it into a simple list of cache links. In order to use this macro:
  1. Go to the "My Caches" page.
  2. Invoke "View Source" in the web browser.
  3. Copy the portion of the table to be converted.
  4. Paste it into Vim.
  5. Enter visual mode and select the text that was pasted.
  6. Invoke the macro.


Read more... )
randomfox: (Default)
2005-04-08 04:13 pm

Vim: Convert waypoint-name pair into geocaching link

This Vim macro converts a line of the form "GCxxxx cache-title" into a HTML link to the geocache page.

Read more... )
randomfox: (Default)
2005-04-08 04:13 pm

Vim: Convert ddd mm.mmm coordinates to decimal degrees

This Vim macro converts coordinates from "N ddd mm.mmm W ddd mm.mmm" to "dd.ddddd -dd.ddddd".

Read more... )
randomfox: (Default)
2005-04-08 04:14 pm

Vim: Toggle between linebreak and nolinebreak mode

This Vim macro toggles between linebreak and nolinebreak mode. In linebreak mode, lines are wrap at word boundaries. In addition, the macro maps the Up, Down, Home, and End keys so that they behave more naturally in linebreak mode.

Read more... )
randomfox: (Default)
2005-04-08 04:14 pm

Vim: Date stamps

The first set of Vim mappings will insert the current date. The second set of Vim mappings will update a line of the form "Last updated: date" so that it holds the current date.

Read more... )
randomfox: (Default)
2005-04-08 04:14 pm

Vim: Delete all buffers

The following macro deletes all the buffers.

Read more... )
randomfox: (Default)
2005-04-08 04:15 pm

Vim: Maximize/unmaximize the window vertically

This Vim macro toggles between a full-height window and a regular window.

Read more... )