Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Drew Crampsie drewc

🏠
Working from home
View GitHub Profile
View gist:ee25525a9cb6c380df37436acd14be93
(import (for-syntax :drewc/gsf/glib) :std/foreign
:drewc/gsf/glib :std/srfi/13)
(export read-bytes-from-input input-tell input-seek input-byte-position)
(begin-glib-ffi (read-bytes-from-input input-tell input-seek G_SEEK_SET G_SEEK_CURR G_SEEK_END)
(c-declare #<<END-C
#include <gsf/gsf.h>
View gist:ea277d14144ad0691d10d5d7f18a1f92
(user)> (def (pregexp-match* re str (start 0) (end (string-length str)))
(def (%m start end)
(if (= start end)
'() (let ((first (pregexp-match-positions re str start end)))
(if (not first) '()
(cons (cadr first) (%m (+ 1 start) end))))))
(let ((idxs (delete-duplicates (%m start end) equal?)))
(map (lambda (idx) (substring str (car idx) (cdr idx))) idxs)))
#!void
View gist:4ee85d7e26a364526f8931937b4947aa
defsyntax (define-endpoint stx)
(def (%defvar name match in)
(let ((e (gensym))
(i (gensym))
(c (gensym))
(varname (string->symbol (format "~A::endpoint"
name))))
`(define ,varname
(let ((,e
View gist:250c558bcf0041c5e43fbc3297893ae8
(defun sequence-right-trim (thing sequence)
(let ((last (elt sequence (- (length sequence) 1))))
(if (equalp thing last)
(subseq sequence 0 (1+ (position-if-not (lambda (c) (equalp c thing)) sequence :from-end t)))
sequence)))
View gist:214cc52311fdedd30a3fa08c30689f38
* Install
** libs
#+BEGIN_SRC shell
sudo apt-get install openssl libssl-dev \
sqlite3 libsqlite3-dev build-essential automake zlib1g-dev \
liblmdb-dev libtool libjson-perl
#+END_SRC
** Gambit
View gist:5f260537b7914a2b999c8a539fb48098
━━━━━━━━━━━━━━━━━━━━━━━━━
I LOVE A SLIME'Y SWANK!
Drew Crampsie
━━━━━━━━━━━━━━━━━━━━━━━━━
Table of Contents
─────────────────
@drewc
drewc / gist:4711189368050e510609
Created Oct 27, 2015
Verifying that +drewc is my blockchain ID. https://onename.com/drewc
View gist:4711189368050e510609
Verifying that +drewc is my blockchain ID. https://onename.com/drewc