Skip to content

Instantly share code, notes, and snippets.

View ctolsen's full-sized avatar

Christoffer Torris Olsen ctolsen

View GitHub Profile

Keybase proof

I hereby claim:

  • I am ctolsen on github.
  • I am ctolsen (https://keybase.io/ctolsen) on keybase.
  • I have a public key whose fingerprint is 8CA3 5114 80AB 300F C831 01B9 4824 26F8 7AD0 1CB3

To claim this, I am signing this object:

@ctolsen
ctolsen / curl_to_ab.py
Last active May 15, 2022 16:19
"Copy to cURL" in Chrome to Apache Bench command
#!/usr/bin/env python3
import sys
import os
def curl_to_ab(curl_cmd: list, num: int=200, cur: int=4) -> str:
"""
Translate a cURL command created by Chrome's developer tools into a
command for ``ab``, the ApacheBench HTTP benchmarking tool.
@ctolsen
ctolsen / testcase.py
Last active October 22, 2015 11:25
primaryjoin with bindparam test case
from sqlalchemy import Column, Integer, ForeignKey, bindparam, and_, create_engine
from sqlalchemy.orm import relationship, sessionmaker
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
def get_age():
"""Method that would get some data from a Flask request context, although
the behaviour is the same regardless."""