Skip to content

Instantly share code, notes, and snippets.

View danielknell's full-sized avatar

Daniel Knell danielknell

View GitHub Profile
@danielknell
danielknell / README.md
Last active May 30, 2022 14:46
Fix Poetry Wheels

🚨 🚨 this script is not suitable for published wheels 🚨 🚨

fix_poetry_wheels.py

assuming dependencies such as the following:

[tool.poetry.dependencies]
mydep = { path = "../mydep/", develop = false }
@danielknell
danielknell / example.tsx
Last active November 25, 2020 11:03
Config based routing in react.
import React from "react";
import { BrowserRouter as Router } from "react-router-dom";
import { Routes, Link, RouteDefinition } from "./router";
const Home: React.FC<{}> = () => {
return (
<>
<h1>Home</h1>
<p><Link name="hello" params={{name: "World"}}>Hello World</Link></p>
<p><Link name="hello" params={{name: "Bob"}}>Hello Bob</Link></p>
@danielknell
danielknell / README.md
Last active February 2, 2018 16:13
SQLAlchemy Enum Bug

There is a problem with how SQLAlchemy stores Python Enum types when native enums are disabled and said Enum contains aliases.

class Country(enum.Enum):
    GB = 'gb'
    FR = 'fr'
    UK = 'gb' # alias the GB item

foo = Table(
 'foo',
from flask import Flask, Response
from werkzeug.exceptions import HTTPException, NotFound
app = Flask('test')
def handler(e):
return Response('error')
app.register_error_handler(HTTPException, handler)

Keybase proof

I hereby claim:

  • I am danielknell on github.
  • I am danielknell (https://keybase.io/danielknell) on keybase.
  • I have a public key whose fingerprint is 4527 8AA4 71CF ADED 0CBB 9055 C879 47BF CB16 4668

To claim this, I am signing this object:

Ook. Ook. Ook. Ook! Ook! Ook? Ook! Ook. Ook. Ook! Ook? Ook!