Wednesday, March 11, 2009

Sprunge.us

IRC breeds unusually useful tech.
What happens when a scrub comes into your channel and proclaims "I GET THIS ERROR" and pastes 30 lines from his log file for you to read.
Great..
Enter Sprunge.us.
Now said scrub can enter this into his terminal:
cat thatlogfileinquestion.log | curl -F 'sprunge=<-' http://sprunge.us

The output is something like:
http://sprunge.us/TTWP (or some other random assortment of characters) which can then be pasted to where ever.
The link will contain the complete unabridged text of thatlogfileinquestion.log.

sprunge.us: saving the world from channel flooding.

Labels: ,

Conkeror: a sign emacs has taken over your brain.

So I'm writing this post in Conkeror.

At first I thought it was just a cute little Firefox extension that added a few emacs commands to make browsing a little easier.

Oh boy, was I pleasantly wrong.

Conkeror is not just a Firefox extension. Conkeror is just about a Firefox replacement. It runs with XUL Runner, so it's got all of the functionality of Firefox with a completely new interface, modeled on Emacs.

Some quick things to give you an idea:

C-x C-f - opens a new URL into a new buffer
C-x b - opens switch buffer, so you can change between open pages. (basically: tabs are replaced by buffers)
B / F - forward and back. These take a tad bit of remembering but it's not too bad.
f - opens 'follow' overlay. This will highlight every 'followable' link on the page, which have corresponding numbers. You can either type the number or the text in the link to open the corresponding page.


Best of all: I no longer feel strange when editing text in an input box, or text area. All the basic text navigation works perfectly.

It doesn't have some of the nice things real emacs has, such as M-} and M-{ for navigating between paragraphs, but overall it's far superior to needing a mouse.

It's been a joy to use so far, with my initial impression. If you're an emacs junkie, give it a shot.

Also: Conkeror is a horrible name. I dove into the files and renamed it Firemacs. ;)

Next step: figuring out how to get adblock.

Labels: ,

Tuesday, March 10, 2009

How do you know when you've been indexed by google?

When your traffic chart looks like this:

Google Analytics Chart

And 95% of the traffic on that spike is direct (non-referral) from San Fransisco. ;)

Little emacs tricks

Found this in IUScheme.el:

(define-key global-map "\r" 'newline-and-indent)


Bothered me to no end having to hit tab after a return. This is especially a godsend in python-mode.

Drop me a line if you have a .emacs one-liner that saves you a headache.

Labels: ,

Friday, March 6, 2009

Colors in emacs

Picking the right color in emacs is... laborious.

Where's M-x show-color-list (like: complete with colors displayed)?

Well, I happened upon this lisp. Works wonderfully.

This will print a full html file that you can load into a browser and use for whatever purpose.

(defun list-colors-display-htm (&optional list)
  "Create HTML page which lists all the defined colors."
  (interactive)
  (if (and (null list) window-system)
      (progn
        (setq list (x-defined-colors))
        ;; Delete duplicate colors.
        (let ((l list))
          (while (cdr l)
            (if (facemenu-color-equal (car l) (car (cdr l)))
                (setcdr l (cdr (cdr l)))
              (setq l (cdr l)))))))
  (with-output-to-temp-buffer "*Colors*"
    (save-excursion
      (set-buffer standard-output)
      (insert "<html>\n"
              "<head>\n"
              "<meta http-equiv=\"Content-Style-Type\" content=\"text/css\">\n"
              "<title>Colors</title>\n"
              "</head>\n"
              "<body>\n"
              "<h1>Colors</h1>\n"
              "<p>\n"
              "<pre>\n")
      (let (s)
        (while list
          (insert (format (concat "<span style=\"background-color:%s\">%-20s</span>"
                                  "  "
                                  "<span style=\"color:%s\">%s</span>"
                                  "\n")
                  (html-color (car list)) (car list) 
                  (html-color (car list)) (car list)))
          (setq list (cdr list))))
      (insert "</pre>"
              "</body>"
              "</html>"))))

(defun html-color (string)
  "Convert colors names to rgb(n1,n2,n3) strings."
  (format "rgb(%d,%d,%d)"
          (/ (nth 0 (x-color-values string)) 256)
          (/ (nth 1 (x-color-values string)) 256)
          (/ (nth 2 (x-color-values string)) 256)))

Labels: , ,