Skip to content

Instantly share code, notes, and snippets.

View xavdid's full-sized avatar
🏠
Working from home

David Brownman xavdid

🏠
Working from home
View GitHub Profile
@xavdid
xavdid / battleships.ts
Created October 29, 2020 05:18
I don't remember the context in which I wrote this, but I did! Finished it Jan 2017
interface Boat {
size: number
direction: 'horizontal'|'vertical'
start: Point
}
interface Point {
x: number,
y: number
}
@xavdid
xavdid / travis-env-keys.py
Last active September 19, 2021 03:40
Python script to find ENV_VAR keys on your travis projects
import argparse
import os
from math import ceil
from typing import List
try:
import requests
from requests import HTTPError
except ImportError:
print("This script uses the `requests` package")
@xavdid
xavdid / ALU.py
Last active February 12, 2022 08:02
A first attempt at AOC 2021 Day 24
# requires Python@3.10
from dataclasses import dataclass, field
from operator import add, floordiv, mod, mul
from typing import Dict, Generator, List
@dataclass
class ALU:
instructions: List[str] = field(repr=False)
inputs: str = field(repr=False)
@xavdid
xavdid / custom.css
Created April 23, 2023 06:20
Obsidian CSS Customizations
/* set my own variables */
.theme-dark {
/* ==highlights== */
--text-highlight-bg: darkorchid;
/* vertical lines in lists */
--indentation-guide-color: cyan;
/* active sidebar item */
--nav-item-background-active: #e67e00;
/* don't make code smaller than normal text */
@xavdid
xavdid / saved_ordering.py
Created June 28, 2023 06:08
Get the ordering of your saved items
import json
import sys
from urllib.parse import parse_qs, urlparse
import requests
# find your feed url on https://www.reddit.com/prefs/feeds/
# EDIT THIS!!
FEED_URL = "https://www.reddit.com/user/USERNAME/saved.json?feed=abc123&user=USERNAME"