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 / 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"
@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 / 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 / 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 / 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
}

Keybase proof

I hereby claim:

  • I am xavdid on github.
  • I am xavdid (https://keybase.io/xavdid) on keybase.
  • I have a public key whose fingerprint is BA72 F26F 7A12 08FD EA39 C3CE 8E6C 0A2E 2B26 98E9

To claim this, I am signing this object:

@xavdid
xavdid / fast.rb
Last active May 29, 2019 19:33
Fast and the Furious Movie Name Generator - https://repl.it/repls/ArcticPettyConstant
# run it here: https://repl.it/repls/ArcticPettyConstant
# fast and furious naming conventions are silly
print "Enter a two-word movie title base phrase: "
title = gets.chomp
parts = title.split(' ')
if parts.size > 2
puts "NO ONLY TWO WORDS"
exit
@xavdid
xavdid / extractor.js
Created April 4, 2018 23:16
Extracting Items from Timeline
var items = $(".tl-slider-item-container")
.children()
.slice(1); // ignore the first item, it's a title card
var result = $.map(items, j => {
const el = $(j);
return {
year: el.find(".tl-headline-date")[0].innerText,
title: el.find(".tl-headline")[0].innerText,
content: el.find(".tl-text-content")[0].innerText
@xavdid
xavdid / test.js
Created September 28, 2017 19:15
jsfuck practice
[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((+(!+[]+!+[]+!+[]+[!+[]+!+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(+![]