This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""Bacon Graph Brute-Force Solver | |
By [email protected] | |
Synposis: python brute.py [filename] | |
where filename is a valid bacon graph file | |
Reference: http://proggitquiz.com/challenge/4/ | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' Word filter for speeding up hamming-distance-of-1 searches. | |
Narrows down the search space by filtering out words that | |
can't possibly match because their 'total' is out of | |
the range +/- 26 from the origin word. Should reduce your | |
search space by at least half (depending on the word list). | |
Part of a solution for Proggit quiz #5: http://proggitquiz.com/challenge/5/ | |
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP FUNCTION IF EXISTS synapse_clean_redacted_messages(); | |
CREATE FUNCTION synapse_clean_redacted_messages() | |
RETURNS void AS $$ | |
DECLARE | |
BEGIN | |
UPDATE events SET content = '{}' FROM redactions AS rdc | |
WHERE events.event_id = rdc.redacts | |
AND (events.type = 'm.room.encrypted' OR events.type = 'm.room.message'); | |
END; | |
$$ LANGUAGE 'plpgsql'; |