How to implement subclass-based plugin architecture? How to handle polymorphism from persisted data?
This file contains hidden or 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
/* This is bad. Reaaly bad. It's a really, really bad hack. If you're an employee of | |
* Intertrode Communication, then I'm really, really sorry that you have to maintain | |
* this. I was honestly planning on removing this tomorrow, but I've been known to | |
* forget things like this. It happens. | |
* | |
* So here's the thing. I can't seem to figure out why the AccountId variable isn't | |
* set. I've looked and looked, but I gotta leave now. Anyway, I've found that I can | |
* just grab the AccountID from the debugging logs. I suppose that to fix it, you'd | |
* have to locate where it's clearing out the ID. | |
* |
This file contains hidden or 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 operator import itemgetter | |
import pytest | |
from django.urls import reverse | |
from django.contrib.auth.models import User | |
from rest_framework import status | |
def assert_response_userlist_equals(response, users): |
This file contains hidden or 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 requests | |
from os import environ | |
key_vault_name = "<key-vault-name-here>" | |
secret_name = "<secret-name-here>" | |
token_params = {"resource": "https://vault.azure.net", "api-version": "2019-08-01"} | |
token_response = requests.get( | |
environ["IDENTITY_ENDPOINT"], | |
params=token_params, |
This file contains hidden or 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
{ | |
"info": { | |
"_postman_id": "ef0a1444-9fe4-4798-91ce-5febefd02bba", | |
"name": "Loop Over Data File", | |
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", | |
"_exporter_id": "7243476" | |
}, | |
"item": [ | |
{ | |
"name": "Do Post", |
This file contains hidden or 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
''' | |
# Smallest window to sort kata | |
## Kata | |
Given an array of integers that are out of order, determine the bounds of the smallest | |
window that must be sorted in order for the entire array to be sorted. For example, | |
given `[ 3 , 7 , 5 , 6 , 9]` , you should return `( 1 , 3 )` . | |
## Test cases: |
This file contains hidden or 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
""" | |
Synopsis | |
--------- | |
```python | |
scheme = ( | |
Scheme() | |
.add_permission(Permission("canteen.eat.fruit")) |
This file contains hidden or 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 time | |
def print_fib(number: int) -> None: | |
def fib(n: int) -> int: | |
if n == 1: | |
return 1 | |
if n == 2: | |
return 1 | |
return fib(n-1) + fib(n-2) | |
print(f'fib({number}) is {fib(number)}') |
NewerOlder