Skip to content

Instantly share code, notes, and snippets.

Avatar

Travis Hinkelman hinkelman

View GitHub Profile
View bracket.rkt
#lang racket
(require pict
rackunit)
; left and right are (or/c choice? team?)
; winner is (or/c #f team?)
(struct choice (left right winner) #:transparent)
(struct team (name strength) #:transparent)
@thisisnic
thisisnic / back_button_confirm.js
Last active Aug 21, 2019
Confirm "back" browser button click in Shiny
View back_button_confirm.js
history.pushState(null, null, null);
window.addEventListener('popstate', function () {
const endProgress = confirm('This will end your session, are you sure you want to go back?');
if (endProgress) {
window.onpopstate = null;
history.back();
} else {