Skip to content

Instantly share code, notes, and snippets.

A woman has two children, (at least) one of whom is a boy. What's the probability that she has two boys?

       B    B-B   1/4
      /
     /
    B
   / \
  /   \
 /     G    B-G   1/4

/

@sstephenson
sstephenson / Simple Encryption.md
Created April 11, 2013 23:48
Simple file/stream encryption using OpenSSL

Simple file/stream encryption using OpenSSL

Create and store a 512-byte random encryption key named secret:

$ mkkey secret

Encrypt the contents of file with the secret key and write it to file.enc:

$ encrypt secret < file > file.enc
@74hc595
74hc595 / units.swift
Created June 11, 2014 04:09
Experimenting with type-safe unit calculations in Swift
// Playground - noun: a place where people can play
import Cocoa
protocol UnitBase {
class var unitLabel:String { get }
}
// T: the unit
// U: its inverse
@mveytsman
mveytsman / Dockerfile
Created July 5, 2021 16:55
Dockerfile for postgis on fly.io
ARG PG_VERSION=12.5
ARG VERSION=dev
FROM golang:1.16 as flyutil
ARG VERSION
WORKDIR /go/src/github.com/fly-examples/postgres-ha
COPY . .