Skip to content

Instantly share code, notes, and snippets.

View erkin's full-sized avatar

Lulu Cathrinus Grimalkin erkin

View GitHub Profile
#lang racket/base
(define-syntax-rule (assert expr)
(unless expr
(raise-user-error "Assertion failed: " (quote expr))))
(define (factorial n)
(if (zero? n)
1
(* n (factorial (sub1 n)))))
@erkin
erkin / gopher.rkt
Last active June 2, 2020 11:50
Minimal gopher client in Racket
#lang racket
(define (gopher host (port "70") (path "/"))
(define-values (in out) (tcp-connect host (string->number port)))
(display (string-append path "\r\n") out)
(flush-output out)
(for-each displayln (port->lines in #:line-mode 'return-linefeed))
(close-output-port out))
(module+ main

Keybase proof

I hereby claim:

  • I am erkin on github.
  • I am erkinb (https://keybase.io/erkinb) on keybase.
  • I have a public key ASAc4RSCeufWknLV_H9Cmb6bYPis3q4Pab6z7vRxfvBX8go

To claim this, I am signing this object:

@erkin
erkin / issue
Created December 8, 2018 07:51

This is \l on \n, running \s on \m,
with kernel \r.
\\ /
-->*<--
/o\\
/_\\_\\
/_/_0_\\
/_o_\\_\\_\\
/_/_/_/_/o\\