Skip to content

Instantly share code, notes, and snippets.

@smithdc1
smithdc1 / bench_cached_property_decorator.py
Last active March 11, 2021 11:44
Benchmark of Django and Python's cached_property decorators
import pyperf
from django.utils.functional import cached_property as dj_cached_property
from functools import cached_property as py_cached_property
class TestClass:
@dj_cached_property
def dj_cached(self):
return "Test"
@aunyks
aunyks / snakecoin-server-full-code.py
Last active March 31, 2025 17:45
The code in this gist isn't as succinct as I'd like it to be. Please bare with me and ask plenty of questions that you may have about it.
from flask import Flask
from flask import request
import json
import requests
import hashlib as hasher
import datetime as date
node = Flask(__name__)
# Define what a Snakecoin block is
class Block: