Skip to content

Instantly share code, notes, and snippets.

Avatar
👋
henlo break pls

Avery nullableVoidPtr

👋
henlo break pls
View GitHub Profile
@nullableVoidPtr
nullableVoidPtr / SelfWealthDarkMode.css
Last active Jan 28, 2021
Unofficial darkmode for SelfWealth, inject this using Stylus
View SelfWealthDarkMode.css
nav.left-nav {
background-color: var(--brand-grey);
}
nav.left-nav ul.nav-section li a:hover {
background-color: var(--gray-dark);
color: var(--white);
}
body,
.heading,
h1,
@nullableVoidPtr
nullableVoidPtr / extract_commbank.py
Last active Jan 8, 2021
Generate transactions CSV from Commonwealth Bank of Australia PDF statements
View extract_commbank.py
#!/usr/bin/env python
# SPDX-License-Identifier: MIT
# Copyright nullableVoidPtr
import sys
import PyPDF2
import re
from decimal import Decimal
from datetime import datetime
from typing import Iterable, Tuple, Optional
@nullableVoidPtr
nullableVoidPtr / cursed64.js
Last active Oct 2, 2020
'functional' {a,b}to{b,a} implementation with no named functions or loops
View cursed64.js
const btoa = input =>
(output =>
(length =>
length % 3 ?
output.slice(0, (length % 3) - 3) + "=".repeat(3 - (length % 3)) :
output
)(input.length)
)(input.replace(/.{1,3}/g, chunk =>
(f =>
(x =>
View abc171_C.c
#include <stdio.h>
#include <stdlib.h>
int main(void) {
char s[12] = {0};
int i = 12;
long long N;
for (scanf("%lld", &N); N; s[--i] = 'a' + (--N % 26), N /= 26);
printf("%s\n", &s[i]);
}
View atcoder-async.py
#!/usr/bin/python3
import asyncio
import aiohttp
import aiofiles
from pathlib import Path
import datetime
import os
import time
from sys import argv
from bs4 import BeautifulSoup, SoupStrainer
View codeforces.py
#!/usr/bin/python3
import re
from pathlib import Path
import datetime
import requests
import os
import time
from sys import argv
from bs4 import BeautifulSoup
View minesweeper.js
const BOMB = -1;
const BLANK = 0;
function generateMap(width, height, bombCount)
{
const map = Array.from(new Array(height), () => Array.from(new Array(width), () => 0));
for(let i = 0; i < bombCount; ) {
const posX = Math.floor(Math.random() * width);
const posY = Math.floor(Math.random() * height);
View gcd256.c
#include <stdio.h>
unsigned char gcd256(unsigned char a) {
for (int i = 0; i < 8; i++) if ((a >> i) & 1) return 1 << i;
}
int main() {
for (int i = 0; i < 256; i++) printf("%d\n", gcd256(i));
}
View dump_djgpp.py
#!/usr/bin/python
from sys import argv
from struct import unpack
def dump_coff(input_buffer):
header = dict(zip(['signature', 'bytes_in_last_block', 'blocks_in_file',
'num_relocs', 'header_paragraphs', 'min_extra_paragraphs',
'max_extra_paragraphs', 'ss', 'sp', 'checksum', 'ip', 'cs',
'reloc_table_offset', 'overlay_number'], unpack("<HHHHHHHHHHHHHH", input_buffer[:28])))
if header['signature'] != 0x5A4D:
View decodeScrapeshieldEmails.py
def decodeScrapeshieldEmail(s):
retval = ""
key = int(s[:2], 16)
for char in [int(s[i:i+2], 16) for i in range(2, len(s), 2)]:
retval += chr(char ^ key)
return retval
#return "".join([chr(c^int(s[:2],2))for c in [int(s[i:i+2],16)for i in range(2,len(s),2))]])