Skip to content

Instantly share code, notes, and snippets.

Avatar

Christoffer Torris Olsen ctolsen

View GitHub Profile
@ctolsen
ctolsen / testcase.py
Last active Oct 22, 2015
primaryjoin with bindparam test case
View testcase.py
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."""
@ctolsen
ctolsen / curl_to_ab.py
Last active Nov 19, 2020
"Copy to cURL" in Chrome to Apache Bench command
View curl_to_ab.py
#!/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.
View keybase.md

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:

You can’t perform that action at this time.