Skip to content

Instantly share code, notes, and snippets.

View jarrodnorwell's full-sized avatar
🏠
Working from home

Jarrod Norwell jarrodnorwell

🏠
Working from home
View GitHub Profile
let virtualControllerView = VirtualControllerView()
virtualControllerView.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(virtualControllerView)
view.addConstraints([
virtualControllerView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
virtualControllerView.bottomAnchor.constraint(equalTo: view.bottomAnchor),
virtualControllerView.trailingAnchor.constraint(equalTo: view.trailingAnchor)
])
virtualControllerView.addAButton { _ in
@jarrodnorwell
jarrodnorwell / VirtualControllerView.swift
Created September 21, 2023 06:49
Virtual Controller used as a replacement for GCVirtualController
//
// VirtualControllerView.swift
// emuThreeDS
//
// Created by Jarrod Norwell on 21/9/2023.
//
import Foundation
import UIKit
@jarrodnorwell
jarrodnorwell / gitpybackup.py
Created October 6, 2023 18:29
Backup `repo_count` of public repositories for username`
#
# main.py
# GitPyBackup
#
# Created by Jarrod Norwell on 07/10/2023.
#
"""
Because the user specified only has 40~ repositories I've made this as basic as possible,
just change the username and repo_count to get started, it'll download all repos into the cwd
@jarrodnorwell
jarrodnorwell / PSX.swift
Created October 10, 2023 07:07
Reads Sony license string from PS1 BIOS file (pain)
class BUS {
var cpu: CPU!
var rom: UnsafeMutablePointer<UInt8>! = nil
init() {
self.cpu = CPU(bus: self)
do {
var data = try Data(contentsOf: Bundle.main.url(forResource: "SCPH9002", withExtension: "BIN")!)
@jarrodnorwell
jarrodnorwell / tmdbyts_scraper_output.json
Created October 11, 2023 18:48
Outputted JSON from my TMDB and YTS scraper
This file has been truncated, but you can view the full file.
{
"adult": false,
"backdrop_path": "/mRGmNnh6pBAGGp6fMBMwI8iTBUO.jpg",
"belongs_to_collection": {
"id": 968052,
"name": "The Nun Collection",
"poster_path": "/d998jmbM0AQ9Ad138Mz0N9CdnOU.jpg",
"backdrop_path": "/bKpqH9y3SjovMM3VqzezBbJtuf7.jpg"
},
"budget": 38500000,
@jarrodnorwell
jarrodnorwell / ABXYButton.swift
Created October 18, 2023 08:19
LMVirtualControllerView is a custom on-screen (virtual) controller replacement for GCVirualController used in emuThreeDS/Limón
//
// ABXYButton.swift
// Limon
//
// Created by Jarrod Norwell on 10/18/23.
//
import Foundation
import UIKit
from re import search
from requests import get
print(search(r"views\":{\"simpleText\":\"(.*?)\"}", get(f"https://www.youtube.com/watch?v={input("Enter YouTube Video ID: ")}").text).group(1))
struct NDSHeader {
struct CCharAddress {
let offset: Int
let size: Int
let title: String
var bytes: UnsafeMutablePointer<UInt8>
func string() -> String? {
guard let string = String(bytesNoCopy: bytes + offset, length: size, encoding: .utf8, freeWhenDone: false) else {
/*
_UISystemBackgroundView is the first subview of a UIButton when initialised with (configuration:)
or (configuration:primaryAction:) and can be used to get the cornerRadius.
Usage:
if let systemBackground = button.subviews.first(where: {
$0.classForCoder == _UISystemBackgroundView.classForCoder() }) as? _UISystemBackgroundView {
// do something with `systemBackground` or `systemBackground.configuration`
}
download_citra() {
# use /jarrodnorwell/citra to include additional platform checks not in /citra-emu/citra
git clone https://github.com/citra-emu/citra citra-src
}
setup_core_dirs() {
mkdir -p Citra/audio_core
mkdir Citra/common
mkdir Citra/core
mkdir Citra/input_common