Skip to content

Instantly share code, notes, and snippets.

View therealFoxster's full-sized avatar
⚠️
Uncaught TypeError: Cannot read property 'status' of undefined

Huy therealFoxster

⚠️
Uncaught TypeError: Cannot read property 'status' of undefined
View GitHub Profile
@therealFoxster
therealFoxster / AppleEsqueViewController.swift
Last active September 2, 2022 01:58
Create Apple-esque views with UIKit
import UIKit
import IQKeyboardManagerSwift
class AppleEsqueViewController: UIViewController, UIScrollViewDelegate {
// Strings & values
private var titleText: String = "Title Text",
primaryButtonText: String = "Continue",
secondaryButtonText: String = "Skip"
import Foundation
import UIKit
import Photos
class HBTools {
static let appName = Bundle.main.object(forInfoDictionaryKey: "CFBundleName") as? String ?? "String_appName"
enum Orientation {
case portrait
@therealFoxster
therealFoxster / macos13_pmfix.sh
Created August 11, 2022 09:44
A fix for SendLaterDelivery causing high CPU usage (powerd) on macOS 13.0 beta. Tested on 13.0b5.
#!/bin/bash
while true; do
idle=10 #minutes
echo -n "${WBOL}[$(date +'%H:%M')]${WDEF} checking pm schedules; "
sched=$(pmset -g sched)
if [[ $sched != "" ]]; then
echo -n "found schedule(s); cancelling all; "
if pmset schedule cancelall; then
echo -n "cancelled all schedules; "
else
@therealFoxster
therealFoxster / sim_941.sh
Created August 18, 2022 09:25
Set the time of booted simulator device(s) to 9:41
#!/bin/bash
xcrun simctl status_bar booted override --time "9:41"
@therealFoxster
therealFoxster / YTSideloadSignInFix.md
Last active November 24, 2022 03:30
Workaround for blocked sign-ins on sideloaded YouTube apps on iOS (last tested on YouTube v17.36.3 on Sep 11, 2022)

Update 2 (Nov 23, 2022)

YTSideloadSignInFix no longer works. This guide might still work but I'm not quite sure.

Update 1 (Sep 21, 2022)

This workaround may no longer be needed; inject YTSideloadSignInFix to be able to sign in to your tweaked YouTube app. This guide will still be here future reference if need be.

YTSideloadSignInFix

Workaround for blocked sign-ins on sideloaded YouTube apps on iOS (last tested on YouTube v17.36.3 on Sep 11, 2022)

@therealFoxster
therealFoxster / GitHubFilterPublicRepo.js
Last active September 21, 2022 18:41
UserScript to filter public repositories by default on github.com
// ==UserScript==
// @name GitHub Filter Public Repositories
// @version 1.0.0
// @description Show public repositories by default
// @author Foxster
// @match *://github.com/*
// @compatible safari
// @grant GM.xmlHttpRequest
// @run-at document-start
// ==/UserScript==
@therealFoxster
therealFoxster / formspree-logo.svg
Last active September 23, 2022 22:45
Not sure where I got this from but I found it in an old project and no longer needed it so I figured I should keep it somewhere for future reference
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
async function getJSON(url, callback) {
try {
const response = await fetch(url, {
method: 'GET',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
}
});
const json = await response.json();
@therealFoxster
therealFoxster / StartupManagerRenameExternalVolumes.md
Created November 25, 2022 01:05
Rename external volumes shown in Startup Manager

Rename external volumes shown in Startup Manager

The following guide describes the process I went through to change the name shown in Startup Manager for the Boot Camp and macOS installations that I have on my external drive. The steps below might not work for your setup (for example, if you have Boot Camp installed on your internal drive). Proceed with caution, as you might not be able to reverse the changes (at least not easily).

Rename Boot Camp (Windows) volume

  1. Open Terminal. Run the following command to list all external disks. Enter an administrator password if/when prompted.
sudo diskutil list external
@therealFoxster
therealFoxster / msautoupdate_fix.sh
Created January 22, 2023 01:25
Fix for Microsoft AutoUpdate "Updates are temporarily unavailable, please try again in a few minutes."
#!/bin/bash
# https://answers.microsoft.com/en-us/msoffice/forum/all/microsoft-autoupdate-not-working/112beb19-3f68-49f4-a48b-00859ae900e3?page=3
launchctl stop /Library/LaunchAgents/com.microsoft.update.agent.plist
launchctl unload -w /Library/LaunchAgents/com.microsoft.update.agent.plist
launchctl load -w /Library/LaunchAgents/com.microsoft.update.agent.plist