Skip to content

Instantly share code, notes, and snippets.

// moodle2md
var md = '';
document.querySelectorAll('#responseform > div > div.que').forEach(q => {
if (q.classList.contains('description')) {
return;
}
md += '## ' + q.querySelector('.info > h3').innerText.trim() + '\n';
if (q.classList.contains('multichoice')) {
@pspaul
pspaul / calc_back.py
Last active January 27, 2019 18:57
My solution for the PyProt3ct challenge of the Codegate 2019 Preliminary CTF.
#!/usr/bin/env python
from struct import pack
# start with the expected value
total = 0xd274a5ce60ef2dca
# do the loop in reverse
for i in range(127):
tmp_2 = total >> 57

Keybase proof

I hereby claim:

  • I am pspaul on github.
  • I am pspaul (https://keybase.io/pspaul) on keybase.
  • I have a public key ASC1HB55AzH9aj9S0nR59FajMS62SB1L83WX0QyLrX6xwwo

To claim this, I am signing this object:

@pspaul
pspaul / shorten.py
Last active September 20, 2019 15:34
Unicode URL Shortener
#!/usr/bin/env python3
import re
import sys
import requests
from urllib.parse import quote
def download_table():
r = requests.get('http://www.unicode.org/Public/idna/latest/IdnaMappingTable.txt')
@pspaul
pspaul / yoink-slack-emojis.js
Last active June 24, 2020 15:27
Slack custom emoji download script generator
// Usage:
// 1. Open Slack
// 2. Open the emoji picker
// 3. Scroll to the custom emojis
// 4. Open the developer tools (press F12)
// 5. Paste and run this script
// 6. Save the output as yoink.sh
// 7. Execute it
// 8. Wait a moment
// 9. Enjoy all your downloaded custom emojis!
@pspaul
pspaul / h-magic.js
Last active October 1, 2019 10:19
rainbow-stage6-trampoline
const payload = decodeURIComponent(location.hash.slice(1));
const blobUrl = URL.createObjectURL(new Blob([payload], { type: 'application/javascript' }));
const script = document.createElement('script');
script.src = blobUrl;
homepage.appendChild(script);