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 / jquery-sel.js
Last active February 14, 2024 04:17
jQuery-like element selector
export const $ = s => s.startsWith("#") && ![".", " ", ">"].some(c => s.includes(c))
? document.getElementById(s.substring(1))
: document.querySelector(s);
export const $$ = s => document.querySelectorAll(s);
@therealFoxster
therealFoxster / DownloadItem.h
Created May 24, 2023 03:40
Some of uYou's header files
#import "uYouItem.h"
@interface DownloadItem : NSObject <NSCoding>
@property (nonatomic, readwrite, strong) NSString *downloadIdentifier;
@property (nonatomic, readwrite, strong) NSString *videoID;
@property (nonatomic, readwrite, strong) NSString *filePath;
@property (nonatomic, readwrite, strong) NSURL *remoteURL;
@property (nonatomic, readwrite, strong) uYouItem *uYouItem;
@property (nonatomic, readwrite, assign) int type;
@property (nonatomic, readwrite, strong) NSURLSessionDownloadTask *downloadTask;
@therealFoxster
therealFoxster / nif.py
Created April 4, 2023 20:35
Newton's Iterative Formula in SageMath
# Function variable x
x = var('x');
# Function f(x)
f(x) = (x-3)*ln(x)-1;
# Derivative f'(x)
df = diff(f,x);
# Newton's Iterative Formula
@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
@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
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 / 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.
@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 / 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 / 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"