Skip to content

Instantly share code, notes, and snippets.

_key value
0 False
1 True
@waxlamp
waxlamp / landlubbers.nix
Last active August 6, 2020 04:01
Nix expression for packaging Landlubbers
let
pkgs = import <nixpkgs> {};
in pkgs.stdenv.mkDerivation rec {
name = "landlubbers-${version}";
version = "0.2";
src = pkgs.fetchzip {
url = "https://www.landlubbersgame.com/Linux%20(${version})%20-%20Landlubbers%20Episode%201.zip";
stripRoot = false;
sha256 = "0dx8kl46n6n7m7hp2m3klpa11q9chy5v2pznbayc9y3mkq2hn7sn";
};
@waxlamp
waxlamp / performance.py
Created June 23, 2019 22:35
Die roll averager for performance earnings (D&D 5e)
def die_avg(n, d, mod=0):
return n * (d + 1) / 2 + mod
def die_pct(low, high, d=20):
return (high - low + 1) / 20
print("Base skill (no nat 1)")
print(die_pct(1, 9) * die_avg(1, 4, -1)
index class alcohol malic acid ash alkalinity of ash magnesium total phenols flavonoids nonflavonoid phenols proanthocyanins color intensity hue OD280/OD315 of diluted wines proline
0 1 14.23 1.71 2.43 15.6 127 2.8 3.06 .28 2.29 5.64 1.04 3.92 1065
1 1 13.2 1.78 2.14 11.2 100 2.65 2.76 .26 1.28 4.38 1.05 3.4 1050
2 1 13.16 2.36 2.67 18.6 101 2.8 3.24 .3 2.81 5.68 1.03 3.17 1185
3 1 14.37 1.95 2.5 16.8 113 3.85 3.49 .24 2.18 7.8 .86 3.45 1480
4 1 13.24 2.59 2.87 21 118 2.8 2.69 .39 1.82 4.32 1.04 2.93 735
5 1 14.2 1.76 2.45 15.2 112 3.27 3.39 .34 1.97 6.75 1.05 2.85 1450
6 1 14.39 1.87 2.45 14.6 96 2.5 2.52 .3 1.98 5.25 1.02 3.58 1290
7 1 14.06 2.15 2.61 17.6 121 2.6 2.51 .31 1.25 5.05 1.06 3.58 1295
8 1 14.83 1.64 2.17 14 97 2.8 2.98 .29 1.98 5.2 1.08 2.85 1045

Keybase proof

I hereby claim:

  • I am waxlamp on github.
  • I am roni (https://keybase.io/roni) on keybase.
  • I have a public key whose fingerprint is A489 C53B 86B4 42A5 5426 C256 1AE3 B6A2 32AF C31D

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am ronichoudhury on github.
  • I am roni (https://keybase.io/roni) on keybase.
  • I have a public key whose fingerprint is A489 C53B 86B4 42A5 5426 C256 1AE3 B6A2 32AF C31D

To claim this, I am signing this object:

@waxlamp
waxlamp / arith.pegjs
Last active June 30, 2016 16:23
PEGjs grammar for a simple expression language
start
= sum
sum
= left:mult _ "+" _ right:sum { return function (vars) { return left(vars) + right(vars); } }
/ left:mult _ "-" _ right:sum { return function (vars) { return left(vars) - right(vars); } }
/ mult
mult
= left:atom _ "*" _ right:mult { return function (vars) { return left(vars) * right(vars); } }
@waxlamp
waxlamp / index.js
Last active October 23, 2015 21:01
index.js file for clique tutorial (step 3)
d3.text("facebook-sample-data.txt", function (text) {
var data,
nll,
nodeTable,
adapter,
graph,
cmap,
view,
oldNodeEnter;
@waxlamp
waxlamp / index.js
Last active October 23, 2015 16:06
index.js file for clique tutorial (step 2)
d3.text("facebook-links.txt", function (text) {
var data;
console.log("Loading data...");
data = d3.tsv.parseRows(text, function (row) {
return [Number(row[0]), Number(row[1])];
});
console.log("done");
// Construct a node link list.
@waxlamp
waxlamp / index.js
Last active October 23, 2015 15:47
index.js file for clique tutorial (step 1)
$(function () {
"use strict";
d3.text("facebook-sample-data.txt", function (text) {
console.log(text);
});
});