Skip to content

Instantly share code, notes, and snippets.

Avatar
💻

Thatchapon Unprasert PoomSmart

💻
View GitHub Profile
@PoomSmart
PoomSmart / ReadEntitlements.x
Last active Aug 19, 2021
Read the entitlements of iOS application at run-time
View ReadEntitlements.x
#import <substrate.h>
#import <HBLog.h>
typedef struct __CFRuntimeBase {
uintptr_t _cfisa;
uint8_t _cfinfo[4];
#ifdef __LP64__
uint32_t _rc;
#endif
} CFRuntimeBase;
@PoomSmart
PoomSmart / ActionSheet.m
Created Jul 13, 2021
YouTube action sheet and notification things
View ActionSheet.m
@interface YTUIUtils : NSObject
+ (UIViewController *)topViewControllerForPresenting;
@end
@interface YTUIResources : NSObject
+ (UIImage *)iconCheckTemplateImage;
+ (UIImage *)actionsheetDefaultImage;
@end
@interface YTActionSheetAction : NSObject
@PoomSmart
PoomSmart / enable-text-recognition.sh
Last active Aug 19, 2021
Enable Live Text Recognition on Intel-based Mac running macOS Monterey (12.0b1)
View enable-text-recognition.sh
#!/bin/bash
APP_TARGETS=(com.apple.Photos com.apple.Preview com.apple.quicklook.QuickLookUIService com.apple.Safari)
for APP_TARGET in "${APP_TARGETS[@]}"
do
defaults write /Users/$USER/Library/Containers/$APP_TARGET/Data/Library/Preferences/com.apple.VisionKit.InternalSettings com.apple.VisionKit.InternalSettings.overrideDeviceAvailability -bool yes
done
@PoomSmart
PoomSmart / sort3.asm
Created Dec 28, 2018
Shortest Code to Sort 3 Numbers known to man?
View sort3.asm
%include "asm_io.inc"
extern _printf
segment data align=4 class=data use32
EnterOne db "Enter number 1: ", 0
EnterTwo db "Enter number 2: ", 0
EnterThree db "Enter number 3: ", 0
FormattedAnswer db "%d %d %d", 0
@PoomSmart
PoomSmart / commands.sh
Created Jul 8, 2018 — forked from JohnCoates/commands.sh
THEOS on Windows 10 with Linux subsystem
View commands.sh
# Turn on Developer Mode
# Open Settings -> Update and Security -> For developers
# Don't reboot yet
# Run in powershell administrator:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
# accept reboot
## Install Ubuntu
# run in powershell administrator:
@PoomSmart
PoomSmart / MyCourses-RemoveAnnoyances.js
Created Mar 4, 2018
Remove most annoyances from My Courses.
View MyCourses-RemoveAnnoyances.js
// ==UserScript==
// @name MyCourses-NoAnnoyance
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Remove most annoyances from My Courses
// @author Thatchapon
// @match https://mycourses.ict.mahidol.ac.th/*
// @require http://code.jquery.com/jquery-3.3.1.min.js
// @grant none
// ==/UserScript==
@PoomSmart
PoomSmart / MyCourses-BulkDownload.js
Last active Jan 7, 2021
Adding a button to bulk download all the lecture slides of each course (Use Tampermonkey).
View MyCourses-BulkDownload.js
// ==UserScript==
// @name MyCourses-BulkDownload
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://mycourses.ict.mahidol.ac.th/course/view.php?id=*
// @require https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.5/jszip.min.js
// @require https://cdnjs.cloudflare.com/ajax/libs/jszip-utils/0.0.2/jszip-utils.min.js
// @require https://fastcdn.org/FileSaver.js/1.1.20151003/FileSaver.min.js
@PoomSmart
PoomSmart / MyCourses-RemovePastEvents.js
Last active Feb 18, 2018
Remove all no longer significant past events from the calendar.
View MyCourses-RemovePastEvents.js
$(function() {
if (top.location.hostname === "mycourses.ict.mahidol.ac.th") {
var _today = $(".today > .day")[0];
if (typeof _today == 'undefined')
return;
var today = parseInt(_today.innerText);
var otherDays = $(".nottoday");
$.each(otherDays, function() {
var otherDay = parseInt(this.firstChild.innerText);
if (otherDay < today) {
@PoomSmart
PoomSmart / MyCourses-autoLogin.js
Last active Feb 16, 2018
Automatic authentication at every session timeout of MUICT My Courses.
View MyCourses-autoLogin.js
$(function() {
if (top.location.hostname === "mycourses.ict.mahidol.ac.th") {
var username = document.getElementById("username");
var password = document.getElementById("password");
if (username != null && password != null) {
username.value = "uxx88yyy";
password.value = "password";
document.forms["login"].submit();
}
}
@PoomSmart
PoomSmart / MyCourses-RecoloredCancelClassesEvents.js
Last active Feb 16, 2018
My Courses recolored cancel classes.
View MyCourses-RecoloredCancelClassesEvents.js
$(function() {
if (top.location.hostname === "mycourses.ict.mahidol.ac.th") {
var events = $(".calendar_event_group");
var eventLinks = $(".calendar_event_group > a");
$.each(events, function() {
var link = this.childNodes[0];
if (typeof link.text != 'undefined' && link.text.startsWith("Cancel")) {
this.style.backgroundColor = this.style.borderColor = "#ffb3b3";
var day = this.parentElement.parentElement.childNodes[0].childNodes[0].text;
$.each(eventLinks, function() {