Skip to content

Instantly share code, notes, and snippets.

@PyDataBlog
PyDataBlog / S&P 500.ipynb
Created September 13, 2017 08:14
A tutorial for scraping information of all the S&P 500 listed companies
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@israelcrux
israelcrux / save-and-restore-contenteditable-selection.js
Last active January 14, 2024 13:58
Save and Restore DOM text selection
function saveSelection() {
if (window.getSelection) {
var sel = window.getSelection();
if (sel.getRangeAt && sel.rangeCount) {
return sel.getRangeAt(0);
}
} else if (document.selection && document.selection.createRange) {
return document.selection.createRange();
}
return null;
@gatlin
gatlin / typed-racket-monads.md
Last active December 30, 2023 01:59
A simple definition and demonstration of monads in Typed Racket

What the fuck is a monad?

Or: functor? I 'ardly know 'er!

Monads are difficult to explain without sounding either patronizing or condescending: I would sound patronizing if I came up with some facile analogy and I would be condescending to describe it categorically.

Instead, I'll frame a problem and piece-by-piece solve the problem with what will turn out to be a monad.