This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from datetime import date | |
import beancount | |
from beancount.core import data | |
from beancount.core import flags | |
from beancount.core import (account, amount, number) | |
from beancount.ingest import importer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
import decimal | |
import re | |
from dataclasses import dataclass | |
from datetime import date, datetime, timedelta | |
import beancount | |
from beancount.core.data import EMPTY_SET, Posting, Transaction, new_metadata, Balance | |
from beancount.core import flags, amount, number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include QMK_KEYBOARD_H | |
// Defines the keycodes used by our macros in process_record_user | |
#define _QWERTY 0 | |
#define _LOWER 1 | |
#define _RAISE 2 | |
#define _ADJUST 16 | |
enum custom_keycodes { | |
QWERTY = SAFE_RANGE, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from time import sleep | |
from time import time | |
from psycopg2 import OperationalError | |
from django.test.runner import DiscoverRunner | |
import django.db.backends.postgresql_psycopg2.base | |
from unittest.runner import TextTestRunner | |
from unittest.runner import TextTestResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Python version of the Nearmap.com technical test | |
https://github.com/izevaka/nearmap-test | |
The test is set in C#. I suggested that was a bit silly for a Python candidate, and they agreed. So I translated it into a Python test for them. | |
They were intrigued by this solution, but, after much internal discussion, ultimately concluded they didn't like it. The primary objection was "why didn't you just use a conventional lock?". The question successfully exposed that I was completely unaware of what convention dictated. Nonetheless, I defend this solution, because, and I didn't enunciate it eloquently at the time, it does not create the bottleneck that a conventional lock would; in a typical lock/release solution all threads must pass through a common gate, creating a potential bottleneck. | |
This solution implements no gate and no bottleneck. Threads seeking known keys can get on with their life without queuing for a lock. Threads seeking unknown keys sleep until, the single thread that is fetching the valu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Paypal API and python/django |