Skip to content

Instantly share code, notes, and snippets.

@teryror
teryror / mulligans-and-mana-bases.md
Last active January 28, 2026 20:39
An updated and expanded guide on building mana bases in Magic: the Gathering

Mulligans and Mana Bases

For my previous post on how many colored sources you should put in your mana bases, I adapted Frank Karsten's simulation code to the London Mulligan rules change, and to make recommendations based on how many lands you want to play. In doing so, I made two errors: first, the tables for Commander decks do not take into account the free mulligan, or the turn one draw. Second, I changed the assumed mulligan strategy to be more aggressive; the effect of this change dominated over the effect of the London Mulligan, invalidating my comment on the matter.

@gene1wood
gene1wood / analyze_pypi_package_names.py
Last active February 6, 2026 00:29
Analysis of PyPi package names and the use of dashes underscores upper and lower case
try:
import xmlrpclib
except ImportError:
import xmlrpc.client as xmlrpclib
client = xmlrpclib.ServerProxy('https://pypi.python.org/pypi')
packages = client.list_packages()
total = len(packages)
dashes = len([x for x in packages if '-' in x])
@rogerhub
rogerhub / edmonds.py
Created January 9, 2014 22:16
An implementation of Edmond's Blossom Algorithm.
#!/usr/bin/env python
class Vertex:
def __init__(self, value):
self.value = value
self.edges = {}
def degree(self):
return len(self.edges)
def __str__(self):
return str(self.value)
@lemoinem
lemoinem / parser-data-attribute.js
Last active October 31, 2016 09:04
tablesorter parser using data-tablesorter-value to sort and filter
/*! data attribute parser
* This parser will use the data-tablesorter-value to extract the cell's value
* Written by Mathieu Lemoine :https://github.com/lemoinem
*/
/*global jQuery: false */
;(function($){
"use strict";
$.tablesorter.addParser({
id : 'data-attribute',
@welldan97
welldan97 / system-wide-clipboard.zsh
Created March 10, 2013 09:51
Zsh copy & paste system wide for OS X, like in emacs
pb-kill-line () {
zle kill-line
echo -n $CUTBUFFER | pbcopy
}
pb-kill-whole-line () {
zle kill-whole-line
echo -n $CUTBUFFER | pbcopy
}
@spara
spara / qgis_script_template.py
Created September 29, 2011 15:35
QGIS standalone python script template for OSX
# To run the script you must set PYTHONPATH and path to QGIS binaries
#
# on Linux: export PYTHONPATH=/qgispath/share/qgis/python
# on Windows: set PYTHONPATH=c:\qgispath\python
# on OSX: export PYTHONPATH=/Applications/QGIS.app/Contents/Resources/python
# export PATH="/Applications/QGIS.app/Contents/MacOS/bin:$PATH"
from qgis.core import *
import sys
import os