Skip to content

Instantly share code, notes, and snippets.

@canadianveggie
canadianveggie / airplane_seats.py
Last active February 21, 2016 03:49
Monte Carlo simulation of FiveThirtyEight's Riddler problem for February 19, 2016
# http://fivethirtyeight.com/features/will-someone-be-sitting-in-your-seat-on-the-plane/
import random
from collections import defaultdict
n_seats = 100
results_correct_seats=defaultdict(int)
results_by_boarding_order=defaultdict(int)
iterations = 1000000
@canadianveggie
canadianveggie / hs_legendary.py
Created November 6, 2016 16:38
Hearthstone Legendary
import random
n_runs = 100000
stars_needed_from_25_to_legendary = 10+15+20+25+25
stars_above_which_no_bonus_is_awarded = stars_needed_from_25_to_legendary-25
max_games = 20000
def stars_to_rank(stars):
ranks_gained = 0
// ==UserScript==
// @name CollabCenterImprovements
// @namespace https://canadianveggie.com/
// @version 0.6
// @match https://bcres.paragonrels.com/CollabCenter/*
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
// @grant GM_addStyle
// @grant GM.openInTab
// ==/UserScript==
@canadianveggie
canadianveggie / adriancrook.jpg
Last active October 16, 2021 19:23
Vancouver Housing Platforms 2018
adriancrook.jpg