Skip to content

Instantly share code, notes, and snippets.

View zats's full-sized avatar

Sash Zats zats

View GitHub Profile
@zats
zats / EnableVoiceOver.m
Last active September 24, 2023 16:46
Set voice over enabled with private API - not for AppStore
static void _setVoiceOver(BOOL enabled) {
NSString* const accessibilityUtilitiesPath = [[NSBundle bundleForClass:UIApplication.class]
.bundleURL
.URLByDeletingLastPathComponent
.URLByDeletingLastPathComponent
URLByAppendingPathComponent:@"PrivateFrameworks/AccessibilityUtilities.framework/AccessibilityUtilities"]
.relativePath;
void* handler = dlopen([accessibilityUtilitiesPath cStringUsingEncoding:NSUTF8StringEncoding], RTLD_NOW);
if (!handler) {
return;
@zats
zats / REMAP_M1_KEYS.MD
Last active July 15, 2025 05:54
Apple M1 MacBook Do Not Disturb Key remapping

Following is a sample of LaungAgent that remaps do not disturb key to Siri (I am using Type to Siri)

This is a lightweight solution not relying on external apps.

Setting up

  1. Create ~/Library/LaunchAgents/com.local.KeyRemapping.plist
  2. Edit it to have following content
@zats
zats / EmojiTokensLoader.m
Last active November 22, 2023 15:52
[WIP] Emoji tokens - word matching with emojis as of macOS 12.1. So far only found a list of tokens, gotta find a mapping to the emojis
[[NSBundle bundleWithPath:@"/System/Library/PrivateFrameworks/EmojiFoundation.framework"] load];
EMFDefaultAutocompleteCandidateProvider *provider = [[EMFDefaultAutocompleteCandidateProvider alloc] initWithBundle:bundle];
[provider tokens]; // returns all the tokens recognized as emojis
@zats
zats / ApplePodcastToOMPL.js
Last active December 6, 2021 01:20
Export OPML from Apple Podcasts app on macOS
#!/usr/bin/env node
const { exit } = require('process');
const PREDEFINED_PATH = "~/Library/Group Containers/243LU875E5.groups.com.apple.podcasts/Documents/MTLibrary.sqlite";
const XML_TEMPLATE = `<?xml version="1.0"?>
<!-- example OPML file -->
<opml version="1.0">
<head>
<title>Overcast Podcast Subscriptions</title>
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSInteger, DBGInterfaceStyleOverride) {
DBGInterfaceStyleOverrideNone = 0,
DBGInterfaceStyleOverrideLight,
DBGInterfaceStyleOverrideDark,
};
#ifdef __cplusplus
extern "C" {
@zats
zats / presenting.md
Last active July 6, 2018 13:02
Takeaways from "Presenting Design Work" - WWDC sessions 2018 https://developer.apple.com/videos/play/wwdc2018/811/

The presenter

Clarify your objectives

  • Establish your goals
  • Identify the questions you need answered
  • Understand the objective of your audiences
  • Don't dive into details before clarifying bigger picture

Embrace feedback

  • Take all feedback seriously even if disagree
  • Clarify the problems identified by the audience - separate problems highlighted from (potentially) invalid solutions suggested
  • Be willing to change your position
@zats
zats / rich-reminders.swift
Created April 7, 2018 21:08
This is a sample of how to add actionable button for Reminders (private API); demo video: https://youtu.be/q7LrO3VhI64
import PlaygroundSupport
PlaygroundPage.current.needsIndefiniteExecution = true
let reminderListName = "Test"
import EventKit
extension EKCalendarItem {
var hack_action: AnyObject? {
set {
@zats
zats / ↔️.js
Created February 11, 2018 22:00
Bookmarklets for fullscreen, entering picture-in-picture, switching between fast and normal playback
javascript:document.getElementsByTagName('video')%5B0%5D.webkitEnterFullscreen()
@zats
zats / 0_usage.mm
Last active September 16, 2019 16:19
Load private framework, core service, app, etc
void *handler = loadPrivate(@"ChatKit", TypePrivateFramework);
const Class CKGradientViewCls = NSClassFromString(@"CKGradientView");
UIView *const gradientView = [(UIView *)[CKGradientViewCls alloc] initWithFrame:{0, 0, 300, 200}];
@zats
zats / FindReplace.json
Last active May 5, 2025 17:54
Alternative spellings for some emojis according to /System/Library/PrivateFrameworks/CoreEmoji.framework/Versions/A/Resources/en.lproj/FindReplace.strings
{
"💍":"diamond | engagement ring | diamond ring | diamond rings | diamonds | engagement rings",
"🆎":"blood type AB",
"❣":"heart",
"🇱🇨":"Saint Lucia | Saint Lucian flag",
"🇮🇪":"Ireland | Irish flag",
"🇨🇮":"Côte d’Ivoire | Ivory Coast | Ivorian flag",
"💎":"diamond | gem | gemstone | jewel | diamonds | gems | gemstones | jewels",
"☠️":"skull and crossbones | poison | poisonous",
"👩‍💻":"technology worker | tech worker | technologist | techie | IT worker | Apple genius | woman in technology | woman tech worker | woman technologist | woman IT worker | woman in IT | woman Apple genius",