Skip to content

Instantly share code, notes, and snippets.

🌱
making my way downtown, walking fast

vgmoose vgmoose

View GitHub Profile
@vgmoose
vgmoose / .sh
Created Nov 27, 2018
BZLA LUA recursive file extractor (such as those extracted from BEA files in super mario party)
View .sh
# run within an extracted mini game directory (one of the mg* files)
# recursively snips header from .lua files (.lua.ex) then runs unluac on them to be readable (.lua.ex.txt)
# replace /path/to/unluac.jar to an absolute path where yours is (can be built from here https://github.com/HansWessels/unluac )
find . -name "*.lua" -exec sh -c 'tail -c +21 "$1" > "$1.ex"; java -jar /path/to/unluac.jar "$1.ex" > "$1.ex.txt"' x {} \;
@vgmoose
vgmoose / movetofront.py
Last active Nov 7, 2018
WARNING: will overwrite the default local Anki DB, unless PATH is changed
View movetofront.py
import anki
from anki.storage import Collection
from anki.sync import Syncer, FullSyncer, RemoteServer, HttpSyncer
from pathlib import Path
# git clone git@github.com:dae/anki.git
# cd anki
# pip3 install -r requirements.txt
# python3 demo.py
@vgmoose
vgmoose / kanjiextract.py
Last active Nov 5, 2018
python3 kanjiextract.py
View kanjiextract.py
#/usr/bin/python3
# -*- coding: utf-8 -*-
import re
# regex for hiragana+katakana and a few more characters
blacklist = r'[ぁ-ゟ゠-ヿ「」。、 ?\n]'
# can be copied and pasted from the PDF including linebreaks between the two sets of """
text = u"""いる
今日私は一日中家にいる。
@vgmoose
vgmoose / count.py
Last active Sep 24, 2018
wget https://pastebin.com/raw/vs5UfDF3; cat vs5UfDF3 | python3 count.py
View count.py
from urllib.request import urlopen
from urllib.parse import urlencode
import json
print("Enter list of titles separted by a new line (or pipe into this program)")
while True:
try:
TITLE = input().rstrip()
except:
View fetch_img.sh
URL="https://dl.google.com/dl/android/aosp/ryu-opm4.171019.021.n1-factory-1f31fdce.zip"
TMP="tmp.zip"
OUT="output.zip"
# fetch the important "PK" region from the remote zip by specifying offsets*
curl --header "Range: bytes=1842-3820027" -k $URL > $TMP
# restore "corrupted" zip data (answer yes to question it prompts)
echo y | zip -FF $TMP --out $OUT
View zipzag.py
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def zigzagLevelOrder(self, root):
# evil test case
View out6.txt
あい
あう
あか
あし
あせ
あち
あっ
あつ
あと
あな
View search.py
import urllib2
import json
"""search for homebrew on either app store"""
def search(query):
response = urllib2.urlopen("http://switchbru.com/appstore/repo.json")
contents = str(response.read())
packages = json.loads(contents)["packages"]
query = query.lower()
View shadowtriad.txt
# This is an edited version of File 1194 in B2W2's a/0/5/6 narchive
# It can be converted into the 6_1194 to be injected into the narc by using:
# https://github.com/vgmoose/pypokescript and running it on this .txt file
# (the output must be pasted into a hex editor at this time)
# ((no I don't know if it works on other script files, but hopefully the project will grow with time))
# actor variables
Cilan = 0001
Chili = 0000
Cress = 0002
You can’t perform that action at this time.