Skip to content

Instantly share code, notes, and snippets.

@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];
@depperm
depperm / package.json
Created August 3, 2023 16:27
package.json variables
{
"name": "project_name",
"version": "1.0.0",
"config": {
"my_label": "TESTING"
},
"author": "me",
"scripts": {
"build": "build_script $npm_package_config_my_label:$npm_package_version"
}