Skip to content

Instantly share code, notes, and snippets.

🐞
collecting the low hanging fruit

Stephen De Gabrielle spdegabrielle

🐞
collecting the low hanging fruit
View GitHub Profile
@spdegabrielle
spdegabrielle / breakout.rkt
Created Jul 6, 2020
adding breakout to DrRacket
View breakout.rkt
#lang racket/base
(require quickscript
racket/gui)
;;;
;;; BREAKOUT
;;;
; Jens Axel Søgaard, Feb 2014
View listbox.rkt
#lang racket/gui
(define things
'(["cat" "cat command"]
["cow" "moo"]
["sheep" "baa"]
["dog" "woof"]
["bunny" "..."]
["cat" "cat command"]
["cow" "moo"]
View url.rkt
#lang racket/base
(provide match-url)
(define (match-url str)
(regexp-match-positions* #px"https?\\://\\S+" str))
@spdegabrielle
spdegabrielle / NOTES.md
Created Jun 19, 2020
open-terminal quickscript (not working)
View NOTES.md

tried to test with from user scripts folder but it fails. with an error

(system (string-append osascriptdir "open-terminal.scpt" "\"cd /Applications/Racket v7.7/bin/\"")

View transparent.rkt
#lang racket/gui
(require ffi/unsafe
ffi/unsafe/objc
pict pict/face)
;; Create the frame:
(define f (new frame%
[label "Example"]
[width 400]
[height 400]))
@spdegabrielle
spdegabrielle / racket-logo-plot.rkt
Created Sep 3, 2019 — forked from Metaxal/racket-logo-plot.rkt
Lambda logo with Racket's plot
View racket-logo-plot.rkt
#lang racket
(require plot)
(let ([blue '(0 0 164)] [red '(164 0 0)])
(parameterize ([plot-decorations? #f])
(plot3d
(list
(surface3d (λ(x y)(/ x 10)) 0 5 0 1 #:color red #:line-color red)
(surface3d (λ(x y)(- 1 (/ (+ 1 (exp (- 5 x)))))) 0 10 0 1 #:color blue #:line-color blue))
@spdegabrielle
spdegabrielle / standard-lightbulb.rkt
Created Sep 3, 2019 — forked from LiberalArtist/default-lightbulb.png
A Racket lightbulb for the Standard Fish Summer Competition 2019
View standard-lightbulb.rkt
#lang racket/base
;; License: Apache-2.0
(require racket/draw
pict
racket/class
racket/math
racket/list
racket/contract)
@spdegabrielle
spdegabrielle / world-map.rkt
Created Aug 20, 2019 — forked from alex-hhh/world-map.rkt
World Map, standard-fish competition 2019
View world-map.rkt
#lang racket
(require json racket/draw math/base)
(define (lat-lon->map-point coordinates)
(match-define (list lon lat _ ...) coordinates)
(define-values (x y) (values (degrees->radians lon) (asinh (tan (degrees->radians lat)))))
(list (/ (+ 1 (/ x pi)) 2) (/ (- 1 (/ y pi)) 2)))
(define (draw-polygon dc polygons)
(define path
@spdegabrielle
spdegabrielle / fizzbuzz.rkt
Created Aug 7, 2019 — forked from nilp0inter/fizzbuzz.rkt
The first beautiful implementation of FizzBuzz?
View fizzbuzz.rkt
#lang 2d racket
(require 2d/match)
(define (fizz? n)
(= 0 (modulo n 5)))
(define (buzz? n)
(= 0 (modulo n 3)))
@spdegabrielle
spdegabrielle / standard-cat.rkt
Created Jul 20, 2019 — forked from deeglaze/standard-cat.rkt
working out the definition of Racket's to-be standard-cat
View standard-cat.rkt
#lang racket
(require pict/color)
(provide
(contract-out
[cat-silhouette
(->i ([width positive?] [height positive?])
(#:left-ear-extent [left-ear-extent (>=/c 0)]
#:left-ear-arc [left-ear-arc (real-in 0 (* 2 pi))]
#:left-ear-angle [left-ear-angle (real-in 0 (* 2 pi))]
You can’t perform that action at this time.