Skip to content

Instantly share code, notes, and snippets.

View spdegabrielle's full-sized avatar

Stephen De Gabrielle spdegabrielle

View GitHub Profile
@tonyg
tonyg / draw-partly-rounded-shape.rkt
Created June 27, 2016 22:01
Drawing partly-rounded-rectangles using Racket's path support
#lang send-exp racket
(require racket/draw)
(define-syntax-rule (build-path (p) body ...)
(let ((p (new dc-path%)))
body ...
p))
(define (quarter-circle p cx cy quarter radius)
@amyjko
amyjko / cer.md
Last active December 16, 2020 19:14
@spdegabrielle
spdegabrielle / index.html
Created March 21, 2016 13:16 — forked from diethardsteiner/index.html
Simple D3JS Dashboard
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Testing Pie Chart</title>
<!--<script type="text/javascript" src="d3/d3.v2.js"></script>-->
<script src="http://d3js.org/d3.v2.js"></script>
<!-- Note: I made good use of the sample code provided by the D3JS community and extended it to fit my needs to create this simple dashboard -->
<style type="text/css">
#lang s-exp syntax/module-reader
(submod "daylang.rkt" semantics)
#:read my-read
#:read-syntax my-read-syntax
(define (my-read in) (syntax->datum (my-read-syntax #f in)))
(define (my-read-syntax src in)
(define line (read-line in))
(if (eof-object? line)
#lang s-exp syntax/module-reader
(submod "daylang.rkt" semantics)
#:read my-read
#:read-syntax my-read-syntax
(define (my-read in) (syntax->datum (my-read-syntax #f in)))
(define (my-read-syntax src in)
(define line (read-line in))
(if (eof-object? line)
@jackfirth
jackfirth / package-count.rkt
Created November 4, 2015 04:27
Counts the number of packages at pkgs.racket-lang.org
#lang racket
(require request
fancy-app)
(define (read-from-string s) (read (open-input-string s)))
(define read-response-requester (wrap-requester-response read-from-string _))
(define (header-requester key value requester)
(add-requester-headers (list (format "~a:~a" key value)) requester))
@msgodf
msgodf / kiczales-oopsla94-black-boxes-reuse.md
Last active March 28, 2022 22:23
Gregor Kiczales "Why are black boxes so hard to reuse?"

This talk was given by Gregor Kiczales of Xerox PARC at OOPSLA ’94, 10/26/94. © 1994, University Video Communications. A transcript, with point- and-click retrieval of the slides, is available at http:/www.xerox.com/PARC/spl/eca/oi/gregor-invite/gregor- transcript.html

Why are black boxes so hard to reuse?

I think our field will go through a revolution. We will fundamentally change the way we think about and use abstraction in the engineering of software.

The goal of this talk is to summarize the need for and the basic nature of this abstraction framework.

The change is not new problems or new systems, but a new way of thinking about existing problems and existing systems.

module type CELL = sig
type 'a cell
type 'a exp
val return : 'a -> 'a exp
val (>>=) : 'a exp -> ('a -> 'b exp) -> 'b exp
val cell : 'a exp -> 'a cell exp
val get : 'a cell -> 'a exp
@jkominek
jkominek / ami.rkt
Created June 15, 2015 23:20
Asterisk Manager Interface for Racket
#lang racket/base
(require racket/tcp racket/async-channel racket/match racket/function)
(define-struct ami [input-port
output-port thread
request-channel
response-channel
event-channel
[dead? #:mutable]]
@setupminimal
setupminimal / rpn.rkt
Created May 31, 2015 16:42
Racket RPN Transformation
#lang racket
(require syntax/strip-context)
; A '#lang reader' language must provide read and read-syntax, which return a module form
; The idea is that "3 4 +:2 7 eq?:2" gets turned into '(module anything racket (eq? (+ 3 4) 7))
(provide (rename-out [rpn-read read]
[rpn-read-syntax read-syntax]))