Skip to content

Instantly share code, notes, and snippets.

Avatar

Daniel Kvasnička dkvasnicka

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am dkvasnicka on github.
  • I am dkvasnicka (https://keybase.io/dkvasnicka) on keybase.
  • I have a public key ASCzKqMENpeKa_hmnrf1upvL9TxL_a3TpGVvUTY7f7aAkgo

To claim this, I am signing this object:

@dkvasnicka
dkvasnicka / Dockerfile
Last active Feb 26, 2021
Racket Jupyter kernel setup for Deepnote.com
View Dockerfile
FROM gcr.io/deepnote-200602/templates/deepnote
RUN sudo apt-get update && \
sudo apt-get install -y libzmq5
# Derived from https://github.com/jackfirth/racket-docker which is
# licensed under the MIT license.
ENV RACKET_INSTALLER_URL=http://mirror.racket-lang.org/installers/7.8/racket-7.8-x86_64-linux-natipkg.sh
ENV RACKET_VERSION=7.8
View dot.clj
(let [rng (doall (range 1000000))]
(time (reduce + (map * rng rng))))
View gist:5908493
(module
(extern nanotime () -> u64)
(define (main)
(let ((v1 (iota 1000)) (v2 (iota 1000)))
(let ((start (nanotime))
(result
(reduce +
(kernel ((x v1) (y v2))
@dkvasnicka
dkvasnicka / gist:5692932
Last active Dec 17, 2015
Currying in CL
View gist:5692932
(defun curryplus (x)
(lambda (y) (+ x y)))
(funcall (curryplus 2) 3) ; = 5
@dkvasnicka
dkvasnicka / gist:5691519
Created Jun 1, 2013
Currying in Racket
View gist:5691519
#lang racket
(define (curryplus x)
(lambda (y) (+ x y)))
((curryplus 2) 3) ; = 5
@dkvasnicka
dkvasnicka / gist:5691514
Created Jun 1, 2013
Currying in Clojure
View gist:5691514
(defn curryplus [x]
#(+ x %))
((curryplus 2) 3) ; = 5
@dkvasnicka
dkvasnicka / app.rkt
Created May 26, 2013
Primitive RESTful hello world in Racket. Run racket (racket -il xrepl) and load the file (,rr app.rkt). Browse to http://localhost:8000/hello/whatever Uses Spin https://github.com/dmacdougall/spin No buildfile needed or anything... Racket requires the library from disk or downloads it from the central repo (PLaneT) if needed. Übercool.
View app.rkt
#lang racket
(require (planet dmac/spin))
(get "/hello/:name" (lambda (req) (string-append "Hello, " (params req 'name))))
(run)