Skip to content

Instantly share code, notes, and snippets.

View jesboat's full-sized avatar

Jade Sailor jesboat

  • Boston, MA
View GitHub Profile
@jesboat
jesboat / utils.rkt
Created May 25, 2011 22:38
type-case and list-case for typed/racket
(define-syntax (type-case stx)
(define (add-huh s)
(datum->syntax stx (string->symbol (string-append (symbol->string (syntax-e s)) "?"))))
(syntax-case stx ()
[(_ val
[(ty field ...) body]
...)
(with-syntax ([(p ...) (map add-huh (syntax-e #'(ty ...)))])
#'(let ([v val])
(cond
@jesboat
jesboat / find-in-ash.noemptydirs.sh
Created November 29, 2011 23:04
Roughly equivalent to "find .", only in less-than-POSIX ash
#!/system/bin/sh
stat() {
local lsout="$(ls -ld "$1" 2>/dev/null)"
case "$lsout" in
"") nex=1; fil= ; dir= ;;
d*) nex= ; fil= ; dir=1 ;;
*) nex= ; fil=1; dir= ;;
esac
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Timing multiple value return techniques
running automated test.
noMultipleValues time 431
noMultipleValues time 419
noMultipleValues time 427
noMultipleValues time 429
noMultipleValues time 421
Timing multiple value return techniques
running automated test.
noMultipleValues time 433
noMultipleValues time 426
noMultipleValues time 412
noMultipleValues time 412
noMultipleValues time 417
noMultipleValues time 416
Timing multiple value return techniques
running automated test.
noMultipleValues time 4131
noMultipleValues time 4133
noMultipleValues time 4128
noMultipleValues time 4204
noMultipleValues time 4122
noMultipleValues time 4121
#define EXIT_STATUS EXIT_FAILURE
#include "true.c"
<svg width="30cm" height="9cm" viewBox="0 0 1000 300" version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- show outline of canvas -->
<rect x="1" y="1" width="998" height="298"
fill="none" stroke="red" stroke-width="2"/>
<path d="M 0 150 L 1000 150" stroke="red" stroke-width="1"/>
<path d="M 500 0 L 500 300" stroke="red" stroke-width="1"/>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
.^
' |
|
|
--+--