Skip to content

Instantly share code, notes, and snippets.

@felipecrv
felipecrv / btree.js
Created April 1, 2018 13:32
In-memory B+ Tree implemented in Javascript with Flow type annotations
/* @flow */
const KEY_KIND_STRING = 1;
const KEY_KIND_NUMBER = 2;
const KEY_KIND_BOOL = 3;
const KEY_KIND_RECORD = 4;
type KeyKind = 1 | 2 | 3 | 4;
class KeyValue<K, V> {
key: ?K;
@evancz
evancz / Focus.md
Last active March 3, 2017 14:58
Potential outline of a simple and useful lens library for Elm

Focus

A Focus is a way to work with particular parts of a large chunk of data. On the most basic level, it lets you get and set fields of a record in a simple and composable way. This means you could avoid writing special record update syntax and use something that composes much more elegantly.

This API is inspired by the concept of Bidirectional Lenses as described by Nate Foster and seen in a modified form in Haskell as "lenses" and in ClojureScript as "cursors". My personal opinions and understanding comes from this talk by Simon Peyton Jones, discussions with @seliopou, and a basic understanding of Nate Foster's PhD thesis on bidirectional lenses. I chose the name "Focus" for this outline because it is sort of like a lens that only lets you see in one direction.

Here's the pseudocode that describes the basic API:

modul
@jezhumble
jezhumble / coc.md
Last active November 9, 2019 05:19
Some notes on codes of conduct from a conference organizer's perspective

Some notes on codes of conduct from a conference organizer's perspective

  1. The customers of a Code of Conduct are the people whom it is protecting. For tech conferences, that means marginalized people.
  2. The Code of Conduct is a promise to its customers from the conference organizers that they will be in a safe space, and that they will be protected and given the benefit of the doubt in the event of something bad happening.
  3. Thus the wording of a code of conduct should be decided by its customers. The Geek Feminism wiki hosts an example code of conduct: http://geekfeminism.wikia.com/wiki/Anti-harassment_policy_resources
  4. The legal basis of a code of conduct is my right, as an event organizer, to kick anybody out of my private event for any reason, even if they have paid. This happens all the time, often with the most flimsy excuses: http://www.hannahettinger.com/guest-post-by-clare/

If you, as a non-customer of the CoC, are not