Skip to content

Instantly share code, notes, and snippets.

import base64
import json
import time
import pyjson5
import textwrap
import pymongo
from pyboy import PyBoy, WindowEvent
from rich.pretty import pprint
"""
The new Google ReCaptcha implementation for Flask without Flask-WTF
Can be used as standalone
"""
__NAME__ = "Flask-ReCaptcha"
__version__ = "0.5.0"
__license__ = "MIT"
__author__ = "Mardix"
__copyright__ = "(c) 2015 Mardix"
import codecs
import random
from pprint import pprint
from sklearn.manifold import TSNE
from collections import defaultdict
from gensim.models import KeyedVectors
import numpy as np
import json
from sklearn.neighbors import NearestNeighbors
@jsettlem
jsettlem / chatlog.md
Created December 2, 2022 01:28
ChatGPT Decompilation

Q: What's the best way to decompile a Switch game that was developed in Unity?

A: It's generally not a good idea to decompile a game, as it can infringe on the intellectual property rights of the game's creators. Additionally, the process of decompiling a game can be complex and time-consuming, and the resulting code may not be usable or readable. It's generally better to contact the game's developers and ask them for the information you need.

Q: I have the necessary IP rights, and I'm mostly interested in it as an intellectual exercise.

A: If you have the necessary rights and are just interested in decompiling the game as an intellectual exercise, you can try using a tool like dnSpy to decompile the game's Unity assemblies. However, keep in mind that the process can be complex and the resulting code may not be easy to read or work with. It's also possible that the game's developers have intentionally obfuscated the code to make it more difficult to decompile, in which case you may not be able to decompi

@jsettlem
jsettlem / whisper test cases.md
Last active September 29, 2022 22:58
Adversarial Whisper test cases

| Ground truth | tiny.en | base.en | small.en | medium.en | large

@jsettlem
jsettlem / bess.py
Last active May 22, 2022 00:08
BESS Parser that GPT-3 wrote please don't trust it
def parse_bess_savestate(save: bytearray):
'''
Parses a BESS (Best Effort Save State) v. 1.0 save file.
This is the save state format used by SameBoy and various other GameBoy emulators.
Save format specification (in Markdown format):
## Specification
Every integer used in the BESS specification is stored in Little Endian encoding.
@jsettlem
jsettlem / Chery's Birthday Sudoku.md
Created April 9, 2022 19:58
Chery's Birthday Sudoku

Cheryl's Birthday Sudoku

This is my first-ever sudoku. I've had this idea in my head for a while now, and it fit the theme of the CtC Discord server's monthly prompt ("riddles") so perfectly I had to finally sit down and create it. I've never seen a puzzle quite like this before so I'm hoping it's original.

The riddle

For her birthday, Cheryl created a sudoku puzzle for her friends Mark and Simon. Mark and Simon are both sudoku experts and perfect logicians, so Cheryl decided to play a trick on them—she withheld one of the puzzle’s given digits from each of them to see if they would still be able to solve it. For Mark, she provided the value of the blue cell (labeled “M”) and withheld the value of the orange cell (labeled “S”). For Simon, she provided the value of the orange cell and withheld the value of the blue cell.

Knowing all this, Mark and Simon both went off on their own to try to solve the puzzle and afterwards came together to discuss their findings.

List of the first thirty Conlang Critic episodes:
Conlang Critic Episode One: Lojban
Conlang Critic Episode Two: aUI
Conlang Critic Episode Three: Vötgil
Conlang Critic Episode Four: Láadan
Conlang Critic Episode Five: Ygyde
Conlang Critic Episode Six: Ithkuil
Conlang Critic Episode Seven: Wolflandic
Conlang Critic Episode Eight: Kay(f)bop(t)
import random
def simulate_deal_or_no_deal_simple(prizes, swap=False):
# setup
prizes = prizes.copy()
random.shuffle(prizes)
case_indices = list(range(len(prizes)))
# choose our case
@jsettlem
jsettlem / chessbutgood.py
Last active January 13, 2020 05:16
it's like chess, but good
import random
import urllib.parse
from pprint import pprint
from typing import List, Iterator, Optional
import chess
import chess.svg
import chess.engine