Skip to content

Instantly share code, notes, and snippets.

@baconator
baconator / main.py
Created October 27, 2017 03:11
A script for repricing GURPS Character Sheet eqp files per 'After the End' (and some house rules). Mostly I was just proud of the regex.
import xml.etree.ElementTree as etree
import re
from fractions import Fraction
from math import floor
import sys
tree = etree.parse(sys.argv[1])
output_filename = sys.argv[2]
root = tree.getroot()
@baconator
baconator / Main.kt
Created October 9, 2016 17:25
Minimal Kotlin + Dagger 2 in IntelliJ Example
import dagger.Component
import dagger.Module
import dagger.Provides
import javax.inject.Inject
fun main(args: Array<String>) {
val shop = DaggerCoffeeShop.builder().dripCoffeeModule(DripCoffeeModule()).build()
shop.maker().makeCoffee()
}
@baconator
baconator / validWords.py
Created February 22, 2015 22:50
Word Combinations
import sys, argparse
from itertools import product, compress, combinations
from collections import defaultdict
'''
So a (valid) word combination is made up of
1. a series of words that max out at the target length
that for every masked result:
2. do _not_ match a previous masked result
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="http://d3js.org/d3.v3.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<label for="wordInput"><span>Input String</span></label>