This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uses html ;; imports html tags | |
define text-processor "markdown" ;; filters all text literals through markdown | |
;; Defines some abstract blocks for DRY | |
block site-header | |
title "Elegance" | |
subtitle "makes writing webpages less painful" | |
when rendered |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var multiline_str = "some \ | |
string \ | |
spanning \ | |
across \ | |
lots \ | |
of \ | |
lines" | |
var multiline_str2 = "some " | |
+ "string " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
do slow_loop = -> | |
(setTimeout slow_loop, 1000) | |
do -> | |
(setTimeout arguments.callee, 1000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
do slow_loop = -> | |
setTimeout slow_loop, 500 unless confirm 'Stop looping?' | |
# | |
# Is compiled to | |
# \/ | |
` | |
(function() { | |
var slow_loop; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
listener ((x) -> (do_stuff x)) | |
, ((y) -> (do_stuff y)) | |
, ((z) -> (do_stuff z)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function try_me (str) { | |
switch (str) { | |
case "foo": console.log("buu~"); break | |
case "bar": console.log("baz~"); break | |
default: console.log("bad, bad argument, no cookies for you.") } | |
} | |
try_me("foo") // "buu~" | |
try_me("bar") // "baz~" | |
try_me("nou") // "bad, bad argument, no cookies for you." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Pair stepper generator | |
(defun pair_stepper: (seq) -> | |
(letb (slen = (len seq)) -> | |
(stepper seq, (idx) -> | |
(if idx + 1 >= slen | |
((list idx, $break)) | |
else | |
(list idx + 1, (nth idx, seq, 2)))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stuff = -> | |
## I instinctively skip those when I'm reading the code | |
surround_left = -> .59 * surround + .525 * (1 - surround) | |
surround_right = -> .69 * (surround - 1) + .59 * (2 - surround) | |
## And go straight here | |
c = if surround < 1 then surround_left else surround_right |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################### | |
# Compares a list using the given function. # | |
# # | |
# This is a general comparison function, that takes a sequence as the first # | |
# argument and a function as the second. # | |
# # | |
# The sequence is iterated using `all`. For each pair of items in the # | |
# sequence the callback function is called and expected to return whether the # | |
# comparison for the given pair succeeds or fails. # | |
# # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ emacs24 | |
Warning: arch-dependent data dir (/usr/local/libexec/emacs/24.0.50/i686-pc-linux-gnu/) does not exist. | |
Warning: Lisp directory `/usr/local/share/emacs/24.0.50/site-lisp' does not exist. | |
Warning: Lisp directory `/usr/local/share/emacs/24.0.50/lisp' does not exist. | |
Warning: Lisp directory `/usr/local/share/emacs/24.0.50/leim' does not exist. | |
Warning: Could not find simple.el nor simple.elc |