Cover photo
Xah Lee
Works at
Attended DeAnza college
Lives in Mountain View, California, USA
2,053 followers|1,496,722 views


Xah Lee

Shared publicly  - 
for you literarily and linguistically inclined.

Professor Victor Mair and 肏 (F�ck)

#china   #chinese  
Add a comment...

Xah Lee

Shared publicly  - 
today's minor hack.
fun emacs lisp. insert random hex as id

(random t) ; seed it randomly

(defun xah-insert-random-hex (πcount)
  "Insert πcount random hexidecimal digits.
πcount default to 8"
  (interactive "P")
  (let* ((myCharset "0123456789abcdef" )
        (possibleCharsCount (length myCharset)))
    (dotimes (ii (if (numberp πcount) (abs πcount) 8 ))
      (insert (elt myCharset (random possibleCharsCount))) ) ))

Emacs Lisp: Insert Random Number, Random ID, Random Hexadecimal
Add a comment...

Xah Lee

Shared publicly  - 
Jay Dugger's profile photo
Add a comment...

Xah Lee

Shared publicly  - 
Siphon my knowledge into your brain; assimilate my sensibilities to your spine. 
Add a comment...

Xah Lee

Shared publicly  - 
hacked emacs lisp for the past 3 hours. wrote a syntax coloring for css hsl format.
Dan Lentz's profile photoXah Lee's profile photo
Xah Lee
Add a comment...

Xah Lee

Shared publicly  - 
follow +ErgoEmacs for daily emacs tips.
emacs: should you swap Control with Capslock? see comment
Add a comment...
Have him in circles
2,053 people

Xah Lee

Shared publicly  - 
Add a comment...

Xah Lee

Shared publicly  - 
today's hack.
emacs command to syntax color any file that has patterns like #33bb00 or hsl(9,50%,50%)

new, at
refresh page.

here's the interesting emacs lisp code:

(defun xah-syntax-color-hsl ()
  "Syntax color hex color spec such as 「hsl(0,90%,41%)」 in current buffer."
  '(("hsl( *\\([0-9]\\{1,3\\}\\) *, *\\([0-9]\\{1,3\\}\\)% *, *\\([0-9]\\{1,3\\}\\)% *)"
     (0 (put-text-property
         (+ (match-beginning 0) 3)
         (match-end 0)
         'face (list :background
 (concat "#" (mapconcat 'identity
                         (lambda (x) (format "%02x" (round (* x 255))))
                          (/ (string-to-number (match-string-no-properties 1)) 360.0)
                          (/ (string-to-number (match-string-no-properties 2)) 100.0)
                          (/ (string-to-number (match-string-no-properties 3)) 100.0)
                          ) )
                        "" )) ;  "#00aa00"
                      ))))) )

(add-hook 'css-mode-hook 'xah-syntax-color-hsl)
(add-hook 'php-mode-hook 'xah-syntax-color-hsl)
(add-hook 'html-mode-hook 'xah-syntax-color-hsl)
Add a comment...

Xah Lee

Shared publicly  - 
hacked on my CSS mode today.
Xah Lee's profile photoErgoEmacs's profile photo
Xah Lee
PS +Dan Lentz did screenshot for you. :D

the code is in the link there.
Add a comment...

Xah Lee

Shared publicly  - 
(english in the link.)
eXtreme Programing (双基齐撸) 和 Agile (利便大法) 有螺旋易达图。比太极八卦易筋经还厉害。参见 Zed Shaw 的 〈编程,肏你妈〉 和 Yossi Kreinin 〈双基齐撸解说〉和 Steve Yegge 〈好利便,怀大法〉 → 下面.
 ·  Translate
Add a comment...
Have him in circles
2,053 people
    programer, writer, present
  • Netopia inc
    1998 - 2002
  • Wolfram Research
    1995 - 1995
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Mountain View, California, USA
Taipei, Taiwan. - Paraguay. - Vancouver, Canada. - Montreal, Canada. - Champaign, Illinois, USA. - El Salvador.
thy years wants wit, thy wits wants edge and manners.
i will be building a dam, when there is a pussy flood.
for i am a collector of nature, and a lover of its treasure.
i will use my savings, to quench those thirsty, and lubricate those angry,
for i have suffered and suffered; the pain and anguish.
  — Xah Lee, 2002-08-17

… my writing is razor blades in hot buns to grammarians, choking dagger to mouthing moralists, logic bomb to irreflecting morons, eye opener to epochal theorists, immaculate calculus to logicians, euphoric oxygen to English masters, orgasmic honey to poetic chicks. That is to say, when i wanna be on the right occasion, too.

you see, English under me is like a love slave. I say jump and she jumps, I say kiss and she kisses. And when i need to vent, she bends double and pleads cum. Of course, it is not to say my theories are unerring or i'm impeccable or sans foibles and grammatical trespassings. But all things considered…

it is often the case,
that i do contemplate,
the degree of cockiness,
that i should exhibit myself.

if showing-off too much,
i then beget revulsion.
if i show not enough,
then i'm not man enough.

therefore i trounce,
when being pressed,
on the delicate balance,
that i might have trashed.

now you understand,
'tis not my loftiness,
but my frailties,
that you should endorse.

on the other hand,
with regard to the universe,
my name is Xah Lee,
and i'm still matchless.

Am a pro programer and amature mathematician. I write a lot. Am mostly known for my Emacs & Emacs Lisp tutorial and Visual Dictionary of Special Plane Curves

I'll be posting here ~6 times a day. Most will be from my site, both new and selected old articles.

Half of it will be computer programing tutorials and essays. The other half will be letters & humanities, and some random social commentary. The style and tone are often unusual, and sometimes offensive.

For my emacs tips, follow ErgoEmacs.
For programing/code, follow Xah Code.
For {vocabulary, writing, literature, linguistics}, follow Wordy English.
For my political/risque writings, follow Xah Offend Show.
  • DeAnza college
  • Foothill college
Basic Information