Skip to content

Instantly share code, notes, and snippets.

View Perlkonig's full-sized avatar

Aaron Dalton Perlkonig

View GitHub Profile
@Perlkonig
Perlkonig / cone-fold.ts
Last active June 2, 2024 23:10
A TypeScript implementation of Castux's code for generating conical projections of hexagonal rhombus boards (https://gist.github.com/Castux/ee792e2631716ec0041aa2732d142a4b)
type Vertex = [number,number];
type Hex = Vertex[];
const narrow = true; // Change this to toggle between the base and narrow versions
const size = 14; // board height; width = height - 1
const baseHex: Hex = [];
const s32 = Math.sqrt(3) / 2;
const rad = 1 / Math.sqrt(3);
for (let i = 0; i < 6; i++) {
@Perlkonig
Perlkonig / bridge-scoring-drills.html
Created July 23, 2018 20:07
Practice scoring duplicate bridge contracts as per ACBL rules
<html lang="en">
<head>
<title>Brdige Scoring Drills</title>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<style type="text/css">
.hidden {
display: none;
}
@Perlkonig
Perlkonig / scancss.js
Last active October 28, 2016 13:57
This is a method for scanning an open page for class declarations that don't exist in any loaded CSS. This only works for CSS files that are hosted on the same domain as the open page! I tested this code in Chrome. Just load the page you're interested in, open the console, paste in the code, then type `scan()`.
function classExists(className, root = null) {
var pattern = new RegExp('\\.' + className + '\\b'), found = false
var sheets = root;
if (root === null) {
sheets = document.styleSheets;
}
try {
for (var i=0; i<sheets.length; i++) {
var ss = sheets[i];