Skip to content

Instantly share code, notes, and snippets.

View J-Priebe's full-sized avatar

James Priebe J-Priebe

  • GTA, Ontario
View GitHub Profile
### models.py
from django.core.exceptions import PermissionDenied
from django.contrib.auth.models import AbstractUser
from django.db import models
from django.http import HttpResponse, Http404
# your custom user model here
class MyCustomUser(AbstractUser):
is_patient = models.BooleanField()
@J-Priebe
J-Priebe / jwt_middleware.py
Last active January 17, 2024 15:31
Cookie-based JWT Middleware for Django Channels
from django.contrib.auth.models import AnonymousUser
from django.db import close_old_connections
from django.conf import settings
from channels.sessions import CookieMiddleware
from channels.db import database_sync_to_async
from rest_framework_simplejwt.authentication import JWTAuthentication
import logging
logger = logging.getLogger(__name__)
@J-Priebe
J-Priebe / contracts...RepaymentStream.sol
Created October 5, 2021 03:20
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.7.0+commit.9e61f92b.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity >= 0.7.0;
import {
ISuperfluid,
ISuperToken,
ISuperApp,
ISuperAgreement,
SuperAppDefinitions
} from "https://github.com/superfluid-finance/protocol-monorepo/blob/remix-support/packages/ethereum-contracts/contracts/interfaces/superfluid/ISuperfluid.sol";