This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #lang racket/gui | |
| (require racket/flonum) | |
| (require racket/future) | |
| ;; basic structs ------------------------------------------- | |
| (struct pixel (r g b)) | |
| (struct vec (x y z)) | |
| (struct ray (from dir)) | |
| (struct int-res (int? t p)) | |
| (struct sphere3D (center radius col)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #lang typed/racket | |
| (: f (case-> | |
| (Integer [#:application Integer] [#:context Nothing] -> (List Integer Integer)) | |
| (Integer [#:context Integer] [#:application Nothing] -> (List Integer Integer)))) | |
| (define (f x #:application [a 0] #:context [c 0]) | |
| (list a c)) | |
| (f 1) | |
| (f 1 #:application 5) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #lang at-exp racket | |
| ;; Generate lovely ideas for talks | |
| ;; Ported from Jason Orendorff's python code: | |
| ;; https://gist.github.com/jorendorff/4659406 | |
| (require math) | |
| (define productions | |
| #hash(["tech" . ("HTML5" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // A.js | |
| import y from "B"; | |
| console.log("a"); | |
| export var x; | |
| // B.js | |
| import z from "C"; | |
| console.log("b"); | |
| export var y; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 2htdp 772 | |
| afm 0 | |
| algol60 58 | |
| at-exp 2 | |
| browser 111 | |
| combinator-parser 0 | |
| compatibility 46 | |
| compiler 937 | |
| config 1 | |
| data 193 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <jorendorff> good morning! | |
| I do have a new raft of questions | |
| <samth> ok | |
| fire away | |
| earlier you asked about the fetch callbacks | |
| <jorendorff> yes? | |
| * jorendorff tries to remember what he asked | |
| <samth> first, `skip()` means "someone else is going to fulfill this particular module request" | |
| <jorendorff> samth: 1. Regarding eval(code, {module, url}), what's the module for? | |
| samth: wait but then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default f(1, 2, 3); // anonymous export | |
| export let foo = 5; // named declaration export | |
| export foo // named export of existing identifier | |
| export foo, bar; // named export of multiple existing identifiers | |
| export foo as f; // named aliasing export | |
| export foo as f, bar; // you get the idea | |
| import default glob from "glob"; // anonymous import | |
| import sync from "glob"; // named import | |
| import sync as s from "glob"; // named aliasing import |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #lang racket | |
| (define (palindrome str) | |
| (define lst (string->list (string-downcase str))) | |
| (define slst (remove* '(#\space) lst)) | |
| (equal? (reverse slst) slst)) | |
| (module+ test (require rackunit) | |
| (check-true (palindrome "able was i ere i saw elba"))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [samth@hermes:~/tmp plt] git clone ~/sw/plt/ | |
| [samth@hermes:~/tmp/plt (master) plt] git filter-branch -f --prune-empty --tag-name-filter cat --subdirectory-filter collects/realm/ -- --all | |
| [samth@hermes:~/tmp/plt (master) plt] git filter-branch -f --index-filter 'git ls-files -s | sed "s-\t\"*-&realm/-" | | |
| GIT_INDEX_FILE=$GIT_INDEX_FILE.new \ | |
| git update-index --index-info && | |
| mv "$GIT_INDEX_FILE.new" "$GIT_INDEX_FILE"' HEAD | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #lang racket/base | |
| (require racket/class json net/url racket/port net/base64 racket/match racket/trait) | |
| (provide client%) | |
| (define ua-header "User-Agent: Racket github package; github.com/samth/github.rkt") | |
| (define (do-post token title body url) | |
| (define auth-header (format "Authorization: bearer ~a" token)) |