<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="/assets/rss.xsl" type="text/xsl"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"

>
<channel>
	<title>Sacha Chua - tag - hack</title>
	<atom:link href="https://sachachua.com/blog/tag/hack/feed/index.xml" rel="self" type="application/rss+xml" />
	<atom:link href="https://sachachua.com/blog/tag/hack" rel="alternate" type="text/html" />
	<link>https://sachachua.com/blog/tag/hack/feed/index.xml</link>
	<description>Emacs, sketches, and life</description>
  
	<lastBuildDate>Mon, 06 Jul 2026 16:20:27 GMT</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>daily</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>11ty</generator>
  <item>
		<title>Crazy Emacs: Personalized signatures with random taglines</title>
		<link>https://sachachua.com/blog/2006/10/crazy-emacs-personalized-signatures-with-random-taglines/</link>
		<dc:creator><![CDATA[Sacha Chua]]></dc:creator>
		<pubDate>Mon, 02 Oct 2006 19:05:00 GMT</pubDate>
    <category>bbdb</category>
<category>emacs</category>
		<guid isPermaLink="false">https://sachachua.com/blog/?p=3904</guid>
		<description><![CDATA[<p>Of course, that naturally leads to the crazy idea: &#8220;What if I can<br>
personalize my signatures?&#8221; Knowing that Paul Lussier is an Emacs geek, I can reward him for reading all the way<br>
to the bottom of my message&#8230; ;)</p>
<pre class="example">
(defun sacha/gnus-personalize-signature ()
  "Personalizes signature based on BBDB signature field.
BBDB signature field should be a lambda expression.
First person with a custom signature field gets used."
  (let* ((bbdb-get-addresses-headers
          (list (assoc 'recipients bbdb-get-addresses-headers)))
         (records (bbdb-update-records
                   (bbdb-get-addresses
                    nil
                    gnus-ignored-from-addresses 'gnus-fetch-field)
                   nil
                   nil))
         signature)
    (while (and records (not signature))
      (when (bbdb-record-getprop (car records) 'signature)
        (setq signature
              (eval (read (bbdb-record-getprop (car records)
                                               'signature)))))
      (setq records (cdr records)))
    (or signature t)))
(setq-default message-signature 'sacha/gnus-personalize-signature)
</pre>
<p>So then all I have to do is add the following field to his record:</p>
<pre class="example">
      signature: (concat "Sacha Chua - Emacs geek
                 What crazy idea can I help you hack next?
                 Random Emacs symbol: "
                 (sacha/random-tagline
                  "~/.taglines.random-emacs-symbols"))
</pre>
<p>Emacs. One crazy idea at a time. Now I can use this to select random<br>
information, like my favorite networking books or a list of my<br>
upcoming events&#8230;</p>

<p>Random Emacs symbol: sort-coding-systems-predicate &#8211; Variable: If non-nil, a predicate function to sort coding systems.</p>

<p>You can <a href="https://sachachua.com/blog/2006/10/crazy-emacs-personalized-signatures-with-random-taglines/#comment">view 1 comment</a> or <a href="mailto:sacha@sachachua.com?subject=Comment%20on%20https%3A%2F%2Fsachachua.com%2Fblog%2F2006%2F10%2Fcrazy-emacs-personalized-signatures-with-random-taglines%2F&body=Name%20you%20want%20to%20be%20credited%20by%20(if%20any)%3A%20%0AMessage%3A%20%0ACan%20I%20share%20your%20comment%20so%20other%20people%20can%20learn%20from%20it%3F%20Yes%2FNo%0A">e-mail me at sacha@sachachua.com</a>.</p>]]></description>
		</item><item>
		<title>Emacs: Show only people whom I haven't pinged since&#8230;</title>
		<link>https://sachachua.com/blog/2006/09/emacs-show-only-people-whom-i-havent-pinged-since/</link>
		<dc:creator><![CDATA[Sacha Chua]]></dc:creator>
		<pubDate>Thu, 28 Sep 2006 15:23:00 GMT</pubDate>
    <category>bbdb</category>
<category>connecting</category>
<category>emacs</category>
<category>planner</category>
		<guid isPermaLink="false">https://sachachua.com/blog/?p=3883</guid>
		<description><![CDATA[<p>One of the things I want in a contact management system is a quick way<br>
to find out who I haven't pinged in a while. The following code<br>
filters currently-displayed contacts to show who I might want to get<br>
back in touch with. Call it from a *BBDB* window and specify the date<br>
(could be 2006.01.01 for annual, -7 for the last seven days, etc.).<br>
This works incredibly well with the following hacks:</p>
<ul>
<li><a href="https://sachachua.com/notebook/wiki/2006.09.01.php#anchor-2">Emacs: Keep track of messages sent</a></li>
<li><a href="https://sachachua.com/notebook/wiki/2006.06.03.php#anchor-5">BBDB pinging code</a></li>
</ul>
<p>I should write a small book about how to build a contact management<br>
system with Emacs. ;) It's insanely powerful, you know.</p>
<pre class="example">
(require 'planner)
(require 'bbdb)
(defun sacha/bbdb-show-only-no-contact-since (date)
  "Show only people who haven't been pinged since DATE or at all."
  (interactive (list (planner-read-date)))
  (let ((records bbdb-records)
        new-records
        last-match
        omit
        notes)
    (while records
      ;; Find the latest date mentioned in the entry
      (setq notes (or (bbdb-record-notes (caar records)) ""))
      (setq last-match nil omit nil)
      (while (string-match
              "[0-9][0-9][0-9][0-9]\\.[0-9][0-9]\\.[0-9][0-9]"
              notes
              (or last-match 0))
        (unless (string> date (match-string 0 notes))
          (setq omit t)
          (setq last-match (length notes)))
        (setq last-match (match-end 0)))
      (unless (and last-match omit)
        (add-to-list 'new-records (caar records) t))
      (setq records (cdr records)))
    (bbdb-display-records new-records)))
</pre>
<p>One of the other things I'd like to smooth over is keeping track of<br>
who owes whom e-mail&#8230; &lt;laugh&gt;</p>


<p>You can <a href="mailto:sacha@sachachua.com?subject=Comment%20on%20https%3A%2F%2Fsachachua.com%2Fblog%2F2006%2F09%2Femacs-show-only-people-whom-i-havent-pinged-since%2F&body=Name%20you%20want%20to%20be%20credited%20by%20(if%20any)%3A%20%0AMessage%3A%20%0ACan%20I%20share%20your%20comment%20so%20other%20people%20can%20learn%20from%20it%3F%20Yes%2FNo%0A">e-mail me at sacha@sachachua.com</a>.</p>]]></description>
		</item><item>
		<title>More Emacs fun: Composing mail to everyone with notes</title>
		<link>https://sachachua.com/blog/2006/09/more-emacs-fun-composing-mail-to-everyone-with-notes/</link>
		<dc:creator><![CDATA[Sacha Chua]]></dc:creator>
		<pubDate>Fri, 01 Sep 2006 16:24:00 GMT</pubDate>
    <category>bbdb</category>
<category>emacs</category>
		<guid isPermaLink="false">https://sachachua.com/blog/?p=3817</guid>
		<description><![CDATA[<pre class="example">
(defun sacha/compose-mail-to-everyone (&optional subject)
  (mapc (lambda (rec)
          (setq rec (car rec))
          (when (bbdb-record-net rec)
            (bbdb-send-mail rec subject)
            (save-excursion
              (message-goto-signature)
              (forward-line -2)
              (insert "\n&#45;&#45;&#45;&#45; NOTES &#45;&#45;-\n" (bbdb-record-notes rec) "\n"))))
        bbdb-records))

(defun sacha/gnus-delete-notes ()
  (goto-char (point-min))
  (when (re-search-forward "^&#45;&#45;- NOTES &#45;&#45;-" nil t)
    (goto-char (match-beginning 0))
    (message-kill-to-signature)))
(add-hook 'message-send-hook 'sacha/gnus-delete-notes)
</pre>


<p>You can <a href="mailto:sacha@sachachua.com?subject=Comment%20on%20https%3A%2F%2Fsachachua.com%2Fblog%2F2006%2F09%2Fmore-emacs-fun-composing-mail-to-everyone-with-notes%2F&body=Name%20you%20want%20to%20be%20credited%20by%20(if%20any)%3A%20%0AMessage%3A%20%0ACan%20I%20share%20your%20comment%20so%20other%20people%20can%20learn%20from%20it%3F%20Yes%2FNo%0A">e-mail me at sacha@sachachua.com</a>.</p>]]></description>
		</item><item>
		<title>More Emacs coolness: List of contacts</title>
		<link>https://sachachua.com/blog/2006/09/more-emacs-coolness-list-of-contacts/</link>
		<dc:creator><![CDATA[Sacha Chua]]></dc:creator>
		<pubDate>Fri, 01 Sep 2006 16:14:00 GMT</pubDate>
    <category>bbdb</category>
<category>emacs</category>
<category>planner</category>
		<guid isPermaLink="false">https://sachachua.com/blog/?p=3818</guid>
		<description><![CDATA[<p>This bit of Emacs Lisp code produces a Planner-ready list of the contacts displayed in the BBDB window.</p>
<pre class="example">
(defun sacha/planner-bbdb-annotation-from-bbdb (&optional record)
  "If called from a bbdb buffer, return an annotation.
Suitable for use in `planner-annotation-functions'."
  (when (or record (eq major-mode 'bbdb-mode))
    (setq record (if record (car record) (bbdb-current-record)))
    (or (bbdb-record-getprop record 'plan)
        ;; From a BBDB entry with a plan page; use that. Yay!
        (planner-make-link
         (concat "bbdb://"
                 (planner-replace-regexp-in-string
                    " " "." (bbdb-record-name record)))
         (bbdb-record-name record)))))
(defalias 'planner-bbdb-annotation-from-bbdb 'sacha/planner-bbdb-annotation-from-bbdb)

(defun sacha/yank-planner-bbdb-list ()
  "Copy the list of people displayed in the buffer."
  (interactive)
  (kill-new
   (mapconcat 'sacha/planner-bbdb-annotation-from-bbdb
              bbdb-records
              ", "))
        (sacha/planner-bbdb-annotation-from-bbdb rec))
</pre>
<p>It allows me to say, for example, that I met 23 people yesterday:<br>
Bruce, <a href="http://blog.digitalketchup.net/">Daniel Charles</a>, Shane D'Costa, Emily, <a href="http://www.mistergadgets.ca">Greg A. Fitz</a>, Clara Fong, <a href="http://www.radiantcore.com">Jay Goldman</a>, Harvey, Kai Fai Ho, Iris, KC, Charles McCulloch, <a href="http://www.scimatic.com">Jamie McQuay</a>, Joshua Meles, Naomi, <a href="http://www.nonlinear.ca">Helen Overland</a>, <a href="http://www.aiim.com">W- Penney</a>, <a href="http://www.simonrowland.com">Simon Rowland</a>, San, Colin Smillie, Solomon, Le Quan Truong, Perry Wong</p>


<p>You can <a href="mailto:sacha@sachachua.com?subject=Comment%20on%20https%3A%2F%2Fsachachua.com%2Fblog%2F2006%2F09%2Fmore-emacs-coolness-list-of-contacts%2F&body=Name%20you%20want%20to%20be%20credited%20by%20(if%20any)%3A%20%0AMessage%3A%20%0ACan%20I%20share%20your%20comment%20so%20other%20people%20can%20learn%20from%20it%3F%20Yes%2FNo%0A">e-mail me at sacha@sachachua.com</a>.</p>]]></description>
		</item><item>
		<title>Emacs: Keep track of messages sent</title>
		<link>https://sachachua.com/blog/2006/09/emacs-keep-track-of-messages-sent/</link>
		<dc:creator><![CDATA[Sacha Chua]]></dc:creator>
		<pubDate>Fri, 01 Sep 2006 16:06:00 GMT</pubDate>
    <category>bbdb</category>
<category>emacs</category>
		<guid isPermaLink="false">https://sachachua.com/blog/?p=3819</guid>
		<description><![CDATA[<p>Because a Big Brother Database of my contacts isn't complete if I<br>
don't keep track of what e-mail I sent them and when I sent it, this<br>
bit of Emacs Lisp code adds Gnus subjects to the BBDB records of the<br>
people to whom I sent e-mail.</p>
<pre class="example">
(defun sacha/gnus-add-subject-to-bbdb-record ()
  "Add datestamped subject note for each person this message has been sent to."
  (let* ((subject (concat (planner-today)
                          ": E-mail: " (message-fetch-field "Subject") "\n"))
         (bbdb-get-addresses-headers
          (list (assoc 'recipients bbdb-get-addresses-headers)))
         records)
    (setq records
          (bbdb-update-records
           (bbdb-get-addresses nil gnus-ignored-from-addresses 'gnus-fetch-field)
           nil nil))
    (mapc (lambda (rec)
            (bbdb-record-set-notes rec
                                   (concat subject
                                           (bbdb-record-notes rec))))
            records)))
(add-hook 'message-send-hook 'sacha/gnus-add-subject-to-bbdb-record)
</pre>
<p>It should be really easy to set up Gnus to expand some kind of<br>
!followup macro into a TODO item in my planner and an &#8220;I hope to hear<br>
from you by &#8230;.&#8221;. Ridiculously easy with Emacs Lisp and an insanely<br>
customizable editor, but I might not have enough battery life. I've<br>
got 28 minutes, and then I'm off PC for a while.</p>

<p><a href="https://sachachua.com/mnt/media/sacha/notebook/emacs/dotgnus.el">/mnt/media/sacha/notebook/emacs/dotgnus.el</a></p>

<p>You can <a href="mailto:sacha@sachachua.com?subject=Comment%20on%20https%3A%2F%2Fsachachua.com%2Fblog%2F2006%2F09%2Femacs-keep-track-of-messages-sent%2F&body=Name%20you%20want%20to%20be%20credited%20by%20(if%20any)%3A%20%0AMessage%3A%20%0ACan%20I%20share%20your%20comment%20so%20other%20people%20can%20learn%20from%20it%3F%20Yes%2FNo%0A">e-mail me at sacha@sachachua.com</a>.</p>]]></description>
		</item><item>
		<title>Livening up your laptop lid: self-adhesive reusable surface</title>
		<link>https://sachachua.com/blog/2006/08/livening-up-your-laptop-lid-self-adhesive-reusable-surface/</link>
		<dc:creator><![CDATA[Sacha Chua]]></dc:creator>
		<pubDate>Sat, 26 Aug 2006 07:20:00 GMT</pubDate>
    <category>laptop</category>
<category>marketing</category>
		<guid isPermaLink="false">https://sachachua.com/blog/?p=3799</guid>
		<description><![CDATA[
<p>All you need to transform your laptop lid into a reusable surface<br>where you can display your latest doodles are: one photo album with<br>self-adhesive pages, a knife, and double-sided tape. Get a photo album<br>that uses plastic and a sticky(ish) surface. Life is easier and neater<br>if the strip that keeps the plastic attached to the book is on the<br>outside edge. You'll see what I mean.</p>



<p>Step 1. Position the laptop face-down on one page of the photo album<br>so that the strip that keeps the plastic attached to the book is along<br>the top edge of the laptop lid. Trace laptop outline onto one page of<br>the photo album. (If you feel particularly diligent, you can measure<br>it instead.)</p>



<img loading="lazy" width="240" height="180" src="https://sachachua.com/blog/wp-content/uploads/2019/06/224774421_135c1fc2a6_m.jpg" alt="" class="wp-image-29433">



<p>Step 2. Cut the photo album page to size. Trim a bit off the bottom<br>part to avoid hitting the laptop hinge.</p>



<figure class="wp-block-image"><img loading="lazy" width="240" height="180" src="https://sachachua.com/blog/wp-content/uploads/2019/06/224774326_afa1e92fbd_m.jpg" alt="" class="wp-image-29434"></figure>



<p>Step 3. Attach double-sided adhesive tape to the laptop.</p>



<figure class="wp-block-image"><img loading="lazy" width="240" height="180" src="https://sachachua.com/blog/wp-content/uploads/2019/06/224774168_06b15ca63c_m.jpg" alt="" class="wp-image-29435"></figure>



<p>Step 4. Mount photo album piece on laptop.</p>



<figure class="wp-block-image"><img loading="lazy" width="240" height="180" src="https://sachachua.com/blog/wp-content/uploads/2019/06/224774043_8ac3584e6e_m.jpg" alt="" class="wp-image-29436"></figure>



<p>Step 5. Peel back plastic and put in stuff.</p>



<figure class="wp-block-image"><img loading="lazy" width="240" height="180" src="https://sachachua.com/blog/wp-content/uploads/2019/06/224773844_3e3e5324dd_m.jpg" alt="" class="wp-image-29437"></figure>



<p>I like this approach because it doesn't require me to bring any<br>special supplies in order to add to the display. For example, I can<br>add fortunes from fortune cookies, Post-it notes, or even business<br>cards.</p>



<figure class="wp-block-image"><img loading="lazy" width="240" height="180" src="https://sachachua.com/blog/wp-content/uploads/2019/06/224773928_65849163a8_m.jpg" alt="" class="wp-image-29438"></figure>



<p>This is handy for my wild idea about selling advertising on my laptop. This laptop hack's primarily about creatively expressing yourself, though. =)</p>



<p>Good stuff.</p>



<p>I came up with a terrific plan B: a whiteboard with a plastic<br>protector to keep it from being erased in one's backpack. That one's<br>pretty cool, too. I'll blog about it more on Sunday, Aug 27. In the<br>meantime&#8230; enjoy!</p>

<p>You can <a href="mailto:sacha@sachachua.com?subject=Comment%20on%20https%3A%2F%2Fsachachua.com%2Fblog%2F2006%2F08%2Flivening-up-your-laptop-lid-self-adhesive-reusable-surface%2F&body=Name%20you%20want%20to%20be%20credited%20by%20(if%20any)%3A%20%0AMessage%3A%20%0ACan%20I%20share%20your%20comment%20so%20other%20people%20can%20learn%20from%20it%3F%20Yes%2FNo%0A">e-mail me at sacha@sachachua.com</a>.</p>]]></description>
		</item>
	</channel>
</rss>