Skip to content

Instantly share code, notes, and snippets.

@larsenv
larsenv / dispisg.py
Last active August 17, 2023 17:18
Use pisg with Discord! This script will take a Discord message log created with DiscordChatExporter and convert it into the "mbot" format so that it can be used to generate a webpage of statistics with pisg.
import datetime
import sys
messages = ""
if len(sys.argv) != 3:
print("Usage: dispisg.py <input> <output>")
sys.exit(1)
with open(sys.argv[1], "r") as f:
@larsenv
larsenv / wii-remote-date.py
Last active December 18, 2018 01:29
Wii Remotes have a date engraved in them if you open the battery cover. Type in the 7-character code engraved (or just the first 3 characters) and it'll tell you what the date is.
import sys
if len(sys.argv) != 2:
print("Usage: python wii-remote-date.py <date string>")
sys.exit(1)
if len(sys.argv[1]) < 3:
print("Invalid string")
sys.exit(1)
@larsenv
larsenv / worst_code_ever.py
Last active December 8, 2020 14:39
This used to be the code for the RiiConnect24 News Channel. This is why it took me forever to make it. I think I've learned from my mistake tremendously. Kids, stay in school, or else your code will look like this when trying to work on a big project.
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import subprocess
import shutil
import urllib2
import time
import re
import platform

Keybase proof

I hereby claim:

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

To claim this, I am signing this object: