Skip to content

Instantly share code, notes, and snippets.

View MichaelMKenny's full-sized avatar

Michael Kenny MichaelMKenny

View GitHub Profile
@PoomSmart
PoomSmart / RemoveDeviceChallenge.xm
Created August 21, 2022 12:10
Allow sideloaded iOS YouTube app to sign in by removing device_challenge_request from the sign in payload.
// Credit: https://github.com/qnblackcat/uYouPlus/pull/398
%hook SSOService
+ (id)fetcherWithRequest:(NSMutableURLRequest *)request configuration:(id)configuration {
if ([request isKindOfClass:[NSMutableURLRequest class]] && request.HTTPBody) {
NSError *error = nil;
NSMutableDictionary *body = [NSJSONSerialization JSONObjectWithData:request.HTTPBody options:NSJSONReadingMutableContainers error:&error];
if (!error && [body isKindOfClass:[NSMutableDictionary class]]) {
[body removeObjectForKey:@"device_challenge_request"];
@craysiii
craysiii / README.md
Created April 20, 2022 03:07
Setting Up Chiaki for Direct Launch on Steam Deck / Steam ROM Manager

Hello everyone,

I was really annoyed with the default setup of Chiaki through the guides I have used to get it running on my Steam Deck. I was having issues with the UI being very glitchy when starting in Gaming Mode and it failing to disappear when I woke up / selected my PS5. It would also sometimes fail to read button presses from L4, which would break the functionality of pressing the PS button. I thought that there had to be another way, and now I've figured it out and thought I would share in case it wasn't done already.

These are the steps I took:

  1. Download or build a custom AppImage that enables the additional CLI options for Chiaki.
    1. You can either download the version that I built here: Chiaki.AppImage
    2. Or, if you don't trust the AppImage (I don't blame you), you can build it by doing the following:
  2. On a linux machine with docker installed and running, as well as SELinux/AppL
@steventroughtonsmith
steventroughtonsmith / MRDMenuView.h
Created March 1, 2020 17:21
Simplified iOS menu view wired up to UIMenuBuilder
//
// MRDMenuView.h
// MobileRadio
//
// Created by Steven Troughton-Smith on 29/02/2020.
// Copyright © 2020 High Caffeine Content. All rights reserved.
//
#import <UIKit/UIKit.h>
@timothycosta
timothycosta / UIViewController+SwiftUI.swift
Last active April 28, 2023 07:00
Using UIViewController via the SwiftUI Environment
struct ViewControllerHolder {
weak var value: UIViewController?
init(_ value: UIViewController?) {
self.value = value
}
}
struct ViewControllerKey: EnvironmentKey {
static var defaultValue: ViewControllerHolder { return ViewControllerHolder(UIApplication.shared.windows.first?.rootViewController ) }
@wozuo
wozuo / SidebarViewController.swift
Created July 19, 2018 14:31
Programmatically create NSTableView in Swift 4.1
import Cocoa
class SidebarViewController: NSViewController, NSTableViewDelegate, NSTableViewDataSource {
var initialized = false
let scrollView = NSScrollView()
let tableView = NSTableView()
override func loadView() {
self.view = NSView()
@nathanfjohnson
nathanfjohnson / String+HTML.swift
Last active November 23, 2021 15:09 — forked from mwaterfall/StringExtensionHTML.swift
Decoding HTML Entities in Swift 4
// Swift 4
// Check out the history for contributions and acknowledgements.
extension String {
/// Returns a new string made by replacing all HTML character entity references with the corresponding character.
///
/// - Returns: decoded string
func decodingHTMLEntities() -> String {
var result = String()
var position = startIndex
@gdurastanti
gdurastanti / parallels-reset.sh
Created August 9, 2017 14:00
Reset Parallels' trial
#!/bin/sh
# Reset Parallels Desktop's trial and generate a casual email address to register a new user
rm /private/var/root/Library/Preferences/com.parallels.desktop.plist /Library/Preferences/Parallels/licenses.xml
jot -w pdu%d@gmail.com -r 1
@dfrib
dfrib / DictionaryKeyPath.swift
Last active April 14, 2023 12:45
Swift: Reading and writing to (possible) nested dictionaries for a given key path, using a recursive approach
// For details, see
// http://stackoverflow.com/questions/40261857/remove-nested-key-from-dictionary
import Foundation
extension Dictionary {
subscript(keyPath keyPath: String) -> Any? {
get {
guard let keyPath = Dictionary.keyPathKeys(forKeyPath: keyPath)
else { return nil }
return getValue(forKeyPath: keyPath)
@camdenfullmer
camdenfullmer / CMFWallpaper.m
Last active February 18, 2024 03:05
Set the wallpaper (lock and/or home screen) on iOS using Apple's private API. Please be aware that including this code in an App Store submission will result in a rejection. This has only been tested on iOS 9.2.
@implementation CMFWallpaper
+ (void)setImage:(UIImage *)image {
NSAssert([PHPhotoLibrary authorizationStatus] == PHAuthorizationStatusAuthorized, @"access to photos is needed to set the wallpaper");
NSString *path;
#if TARGET_OS_SIMULATOR
path = @"/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibrary.framework";
#else
path = @"/System/Library/PrivateFrameworks/PhotoLibrary.framework";
@zeroseis
zeroseis / disable-auto-android-file-transfer.md
Created September 14, 2015 17:28
Disable auto start for Android File Transfer
  • Close Android File Transfer
  • Open Activity Monitor and kill “Android File Transfer Agent”
  • Go to where you installed “Android File Transfer.app” (I have it under /Applications)
  • Ctrl+click –> “Show package contents”
  • Go to Contents/Resources
  • Rename “Android File Transfer Agent” to e.g. “Android File Transfer Agent_DISABLED”
  • Then go to “/Users/username/Library/Application Support/Google/Android File Transfer” and again rename the Agent app.