Skip to content

Instantly share code, notes, and snippets.

@eu90h
eu90h / rand.rkt
Last active September 17, 2015 02:07
OS-based rng access
#lang racket/base
(require racket/contract/base "unix_rand.rkt" "windows_rand.rkt" (only-in file/sha1 bytes->hex-string))
(provide (contract-out [crypto-random-bytes (-> exact-positive-integer? (or/c bytes? string?))]
[crypto-random (-> exact-positive-integer? exact-positive-integer?)]))
(define bytes->number (compose (lambda (s) (string->number s 16)) bytes->hex-string))
; (: crypto-random-bytes (-> Positive-Integer Bytes))
; returns n random bytes from the os.
(define (crypto-random-bytes n)
#!/bin/bash
set -e
(raco pkg show $1 | grep clone) || (raco pkg remove $1 && raco pkg install --no-setup --clone $1)
cd $1
hub fork || echo "fork already exists"
hub checkout -b auto-fix-deps || hub checkout auto-fix-deps
hub reset --hard origin/master
raco setup --fix-pkg-deps || echo "fixed"
@takikawa
takikawa / gist:6253646
Created August 16, 2013 21:28
Internal definition context stages of grief
<samth> my experience is that the internal definition context stages of grief are:
<samth> (1) what are these int-def-ctx arguments?
<samth> (2) this stuff makes no sense
<samth> (3) why is it so imperative?
<samth> (4) i can't think of a better way
<samth> (5) i am ryan culpepper