Skip to content

Instantly share code, notes, and snippets.

View ThomasHintz's full-sized avatar

Thomas Hintz ThomasHintz

View GitHub Profile
(require-extension ansi-escape-sequences srfi-19 srfi-1 srfi-13 posix)
(define (reload-config) (load "~/.hiss"))
(define-syntax install (syntax-rules () ((sudo arg1 ...) (_raw sudo apt-get install arg1 ...))))
(define-syntax ! (syntax-rules () ((! arg1 ...) (_raw arg1 ...))))
(define-syntax apt-search (syntax-rules () ((apt-search arg1 ...) (_raw aptitude search arg1 ...))))
(define ++ string-append)
@ThomasHintz
ThomasHintz / gist:6025759
Last active December 19, 2015 22:09
Idea for amazon-s3 api improvement
(define (put-options #!key canned-acl metadata content-type expires storage-class)
(when (and canned-acl
(not (member canned-acl '(private full-control public read authenticated-read))))
(error "invalid canned-acl specified"))
(filter (cut cdr <>)
`((canned-acl . ,canned-acl) (metadata . ,metadata) (content-type . ,content-type)
(expires . ,expires) (storage-class . ,storage-class))))
(define (put-object! bucket key object-thunk object-length object-type . options)
(perform-aws-request bucket: bucket path: key verb: "PUT" content-type: object-type body: object-thunk
@ThomasHintz
ThomasHintz / hintz-shellrc-example
Created May 28, 2011 02:36
Hintz Chicken Scheme Shell Config Example
(teejay@teejays-eee)-(/home/teejay/thomas/programming/scheme/shell)-(22:29:31)
$ (ls)
shell shell.scm shell.scm~
(teejay@teejays-eee)-(/home/teejay/thomas/programming/scheme/shell)-(22:30:00)
$ (+ 1 2)
3
(teejay@teejays-eee)-(/home/teejay/thomas/programming/scheme/shell)-(22:30:07)
$ (ls -A)
@ThomasHintz
ThomasHintz / hintz-shell-example
Created May 28, 2011 02:32
Hintz Chicken Scheme Shell Example
$ (ls)
shell shell.scm shell.scm~
$ (+ 1 2)
3
$ (ls -A)
.git shell shell.scm shell.scm~
@ThomasHintz
ThomasHintz / hintz-shellrc.scm
Created May 28, 2011 02:26
Hintz Chicken Scheme Shell Config File
(require-extension ansi-escape-sequences srfi-19)
(repl-prompt
(lambda ()
(let ((is-root? (lambda (user) (string=? user "root")))
(user (car (user-information (current-user-id)))))
(string-append "("
(set-text (if (is-root? user) '(fg-red) '(fg-green))
(string-append user "@" (or (get-host-name) "")))
")-("