Skip to content

Instantly share code, notes, and snippets.

View zats's full-sized avatar

Sash Zats zats

View GitHub Profile
@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 November 26, 2023 17:59
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",
@zats
zats / emojis.swift
Created September 17, 2017 18:24
All emojis available in iOS 11.0 including lookup categories for gender and skin-tone dependent
let emojis: [String: [String]] = [
// +[EMFEmojiCategory TravelAndPlacesEmoji]
"travel": ["🚗", "🚕", "🚙", "🚌", "🚎", "🏎", "🚓", "🚑", "🚒", "🚐", "🚚", "🚛", "🚜", "🛴", "🚲", "🛵", "🏍", "🚨", "🚔", "🚍", "🚘", "🚖", "🚡", "🚠", "🚟", "🚃", "🚋", "🚞", "🚝", "🚄", "🚅", "🚈", "🚂", "🚆", "🚇", "🚊", "🚉", "🚁", "🛩", "✈️", "🛫", "🛬", "🚀", "🛰", "💺", "🛶", "⛵️", "🛥", "🚤", "🛳", "⛴", "🚢", "⚓️", "🚧", "⛽️", "🚏", "🚦", "🚥", "🗺", "🗿", "🗽", "⛲️", "🗼", "🏰", "🏯", "🏟", "🎡", "🎢", "🎠", "⛱", "🏖", "🏝", "⛰", "🏔", "🗻", "🌋", "🏜", "🏕", "⛺️", "🛤", "🛣", "🏗", "🏭", "🏠", "🏡", "🏘", "🏚", "🏢", "🏬", "🏣", "🏤", "🏥", "🏦", "🏨", "🏪", "🏫", "🏩", "💒", "🏛", "⛪️", "🕌", "🕍", "🕋", "⛩", "🗾", "🎑", "🏞", "🌅", "🌄", "🌠", "🎇", "🎆", "🌇", "🌆", "🏙", "🌃", "🌌", "🌉", "🌁"],
// +[EMFEmojiCategory NatureEmoji]
"nature": ["🐶", "🐱", "🐭", "🐹", "🐰", "🦊", "🐻", "🐼", "🐨", "🐯", "🦁", "🐮", "🐷", "🐽", "🐸", "🐵", "🙈", "🙉", "🙊", "🐒", "🐔", "🐧", "🐦", "🐤", "🐣", "🐥", "🦆", "🦅", "🦉", "🦇", "🐺", "🐗", "🐴", "🦄", "🐝", "🐛", "🦋", "🐌", "🐚", "🐞", "🐜", "🕷", "🕸", "🐢", "🐍", "🦎", "🦂", "🦀", "🦑", "🐙", "🦐", "🐠", "🐟", "🐡", "🐬", "🦈
@zats
zats / File.swift
Last active January 9, 2017 05:11
Kill compiler with this one weird trick
import UIKit
class ViewController: UIViewController {
private var a1: Int!
private var a2: Int!
private var a3: Int!
private var a4: Int!
private var a5: Int!
private var a6: Int!
@zats
zats / Models.swift
Last active August 10, 2017 19:49 — forked from JaviSoto/SampleViewController.swift
Init based Storyboard View Controller Instantiation
import Foundation
// Some clearly non-NSObject-based models:
enum Coconut: String {
case small, medium, large
}
struct Tomato {
static var red = Tomato(color: #colorLiteral(red: 0.7490196078, green: 0.09803921569, blue: 0.02352941176, alpha: 1))