Skip to content

Instantly share code, notes, and snippets.

@depperm
depperm / PaCK.html
Last active June 24, 2024 17:46
PaCK System
<html>
<style>
table {
line-height: 120%;
font-family: Consolas, monaco, monospace;
/*72pt:1in*/
font-size: 9pt;
}
.good {
background: greenyellow;
@depperm
depperm / tictactoe.c
Last active February 13, 2024 11:44
TicTacToe refactor
/*
* tictactoe.c
*
* Copyright 2024 Reslashd https://github.com/Reslashd/tictactoe/blob/main/tictactoe.c
*
* Review: https://codereview.stackexchange.com/posts/289272
*
*/
#include <stdbool.h>
@depperm
depperm / advent.nim
Last active December 9, 2023 18:07
AoC 2023 day 5
# nim compile --run day#/advent.nim demo 1
# nim compile --run day#/advent.nim demo 2
# nim compile --run day#/advent.nim one
# nim compile --run day#/advent.nim two
import os
import strutils
import sequtils
import sets
proc challenge(file: string, challenge: int): void =
@depperm
depperm / ISO3166
Last active December 2, 2023 10:16
ISO3166 Countries
// https://www.iso.org/iso-3166-country-codes.html > click Online Browsing Platform > 300 results per page
// copy-paste below in console
var table = document.evaluate("/html/body/div[1]/div/div[2]/div/div/div[2]/div/div/div[2]/div/div/div/div/div/div[2]/div/div[2]/div/div/div[2]/div/div[2]/div[2]/div[3]/table", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
var countries=[];
for (var i = 1; i<table.rows.length; i++) {
var row = table.rows[i];
var country={};
for (var j = 0; j<row.cells.length; j++) {
var col=row.cells[j];