Skip to content

Instantly share code, notes, and snippets.

@jbclements
jbclements / spf-fail.rkt
Created February 10, 2023 18:19 — forked from otherjoel/spf-fail.rkt
Generate a form email to explain to someone at another company that their SPF is broken
#lang racket/base
;; Generate a form email to let someone know their SPF records are misconfigured for their current email provider.
;;
;; Run (fill-report "domain.com" "1.2.3.4") where the 2nd arg is the sending email server's IP address.
;; It will copy the completed report to the clipboard for you.
;; Only works on Windows for now.
(require net/dns
@jbclements
jbclements / .gitignore
Last active January 4, 2016 03:29 — forked from adamgit/.gitignore
#########################
# .gitignore file for Xcode4 / OS X Source projects
#
# Version 2.0
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
# 2013 updates:
# - fixed the broken "save personal Schemes"
#
# NB: if you are storing "built" products, this WILL NOT WORK,
#lang racket/base
(require test-engine/racket-tests)
(require racket/list)
;; YIKES! you clearly wrote the function before the tests, because what you have below
;; is just nuts. Specifically, you have a table that maps strings to ... tables!
;; Let's rewrite those test cases first:
(check-expect (add-stat (add-stat (hash) '("a" "b" "c")) '("a" "b" "d"))
(hash "a" 2 "b" 2 "c" 1 "d" 1))
@jbclements
jbclements / foo.rkt
Last active December 29, 2015 09:29 — forked from MattS8/gist:7650837
;; TEAM BYTE ME
;; int list -> list
;; takes a list and a number and returns a list with the length of the number
(define (create_list l n)
(cond
[(= n 0) empty ]
[else (cons (first l) (create_list (rest l) (sub1 n)))
]))
;; a note is (make-note note-num frames frames)
(define-struct note (pitch time duration))
;; number -> number
;; converts seconds to frames
(define (s f)
(* 44100 f))
(check-expect (s 10) 441000)
;; Nancy Truong, Mitchell Salles, Dan Stone
;; CPE 123 (3:00 P - 5:00 P)
(define (s sec) (* 44100 sec))
;; a note is (make-note midi-num frames frames)
(define-struct note (pitch time dur))
;; note -> boolean
(require rsound)
;a note is
;(make-note number number number)
(define-struct note (pitch time duration))
;a list-of-notes is one of:
;-empty, or
;-(cons note list-nof-notes)