Skip to content

Instantly share code, notes, and snippets.

View 0xdade's full-sized avatar

dade 0xdade

View GitHub Profile
@0xdade
0xdade / secure_file_submit_share.txt
Last active April 30, 2021 07:07
Some design thoughts on building an open source solution for solving the "simple secure file submission" and "simple secure file share" problems
User Experience:
Workflow:
(Optional) Click pre-authenticated upload url, if provided
(Optional) Sign in, if required
Drag and drop a file
interface shows the file name (and maybe some additional metadata, not sure if we get any metadata at this point though)
Set of checkboxes for the following (if they are not enforced to a specific value by the server operator):
Save Encryption Key
Burn After Reading
Expiration Duration
@0xdade
0xdade / tags.py
Created April 9, 2022 23:01
Some really awful ways to build html elements in python. attributes with - in them not supported. Self-closing tags not supported. Comments not supported. Doctype strings not supported. attribute validation on tags not supported.
# First approach, just make a function manually for every tag
# Then feed them all back to the same core html_element function for rendering
import inspect
import sys
def html_element(*args, **kwargs):
tag = inspect.stack()[1][3]
attrs = [f"{kwarg}=\"{kwargs.get(kwarg)}\"" for kwarg in kwargs]
children = "\n".join([f"{child}" for child in args])
return f'<{tag}{" " if attrs else ""}{" ".join(attrs)}>{children}</{tag}>'