Skip to content

Instantly share code, notes, and snippets.

# @wapiflapi gqldl early draft.
#
# The goal of this is to manage dataloaders for multiple types while
# at the same time providing an easy integration for relay-compliance.
# - There will be full utility support for the relay spec.
# - Integration with ariadne WILL be easy and documented.
# - Integration with graphene MIGHT be documented.
#
# Feel free to comment, but documentation, tests and a proper release
# are comming soon(tm).
# @wapiflapi gqldl early draft.
#
# The goal of this is to manage dataloaders for multiple types while
# at the same time providing an easy integration for relay-compliance.
# - There will be full utility support for the relay spec.
# - Integration with ariadne WILL be easy and documented.
# - Integration with graphene MIGHT be documented.
#
# Feel free to comment, but documentation, tests and a proper release
# are comming soon(tm).
# @wapiflapi gqldl early draft.
#
# The goal of this is to manage dataloaders for multiple types while
# at the same time providing an easy integration for relay-compliance.
# - There will be full utility support for the relay spec.
# - Integration with ariadne WILL be easy and documented.
# - Integration with graphene MIGHT be documented.
#
# Feel free to comment, but documentation, tests and a proper release
# are comming soon(tm).
@wapiflapi
wapiflapi / decrypt.py
Created October 9, 2019 10:02
@wapiflapi's solution for RektSA from https://qual.rtfm.re 2019
"""
@wapiflapi's solution for RektSA from https://qual.rtfm.re 2019
This simply uses z3 which takes about a second longer than the challenge
timeout: Keeping the connection alive is enough to circumvent the timeout.
~/Projects/ctf/rtfm$ time ./decrypt.py
Congratulations: sigsegv{th1s_1s_4_cr1m3...4_mult1cr1m3!!!}
real 0m2,741s
#!/bin/bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
TEMPLATE_GIT=$SCRIPT_DIR
TEMPLATE_PATH=something/censored/
GIT_DIR=$TEMPLATE_GIT/.git git ls-files $TEMPLATE_PATH |
while read file;
do diff $TEMPLATE_GIT/$file "${file//"$TEMPLATE_PATH"/}";
@wapiflapi
wapiflapi / pydantic_validators_test.py
Created November 7, 2023 15:33
A test showing how to handle empty string == null in different scenarios.
import typing
import pydantic
class TestBaseModel(pydantic.BaseModel):
@pydantic.validator('*', pre=True)
def empty_str_to_none(cls, v):
if v == "":
return None