Some notes, tools, and techniques for reverse engineering macOS binaries.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func animation(from notification: Notification) -> Animation? { | |
guard | |
let info = notification.userInfo, | |
let duration = info[UIResponder.keyboardAnimationDurationUserInfoKey] as? Double, | |
let curveValue = info[UIResponder.keyboardAnimationCurveUserInfoKey] as? Int, | |
let uiKitCurve = UIView.AnimationCurve(rawValue: curveValue) | |
else { | |
return nil | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
extension UIFont { | |
/// Watch [WWDC Session](https://developer.apple.com/videos/play/wwdc2015/804/). | |
/// [Font Feature Registry](https://developer.apple.com/fonts/TrueType-Reference-Manual/RM09/AppendixF.html) | |
/// - Parameters: | |
/// - size: The size (in points) to which the font is scaled. This value must be greater than 0.0. | |
/// - weight: The weight of the font, specified as a font weight constant. | |
/// - features: Font features supported by SFPro |
A quick guide on how to setup X11 forwarding on macOS when using docker containers requiring a DISPLAY. Works on both Intel and M1 macs!
This guide was tested on:
- macOS Catalina 10.15.4
- docker desktop 2.2.0.5 (43884) - stable release
- XQuartz 2.7.11 (xorg-server 1.18.4)
- Macbook Pro (Intel)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// SVGPath.swift | |
// SVGPath | |
// | |
// Created by Tim Wood on 1/21/15. | |
// Updated by Vitaly Domnikov 10/6/2015 | |
// Updated by Jason Rodriguez 08/29/2017 | |
// Copyright (c) 2015 Tim Wood, Vitaly Domnikov, Jason Rodriguez. All rights reserved. | |
import Foundation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import PlaygroundSupport | |
func degree2radian(a:CGFloat)->CGFloat { | |
let b = CGFloat(Double.pi) * a/180 | |
return b | |
} | |
func polygonPointArray(sides:Int,x:CGFloat,y:CGFloat,radius:CGFloat,adjustment:CGFloat=0)->[CGPoint] { | |
let angle = degree2radian(a: 360/CGFloat(sides)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
/// High precedence | |
precedencegroup HighPrecedence { higherThan: BitwiseShiftPrecedence } | |
/// Exponentiation operator | |
infix operator **: HighPrecedence | |
extension CGFloat { | |
/// Returns base ^^ exp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Taken from ACBRadialMenuView Project | |
// BSD 3-Clause License | |
// Copyright (c) 2017, akhilcb (https://github.com/akhilcb) | |
extension CGPoint { | |
static func pointOnCircle(center: CGPoint, radius: CGFloat, angle: CGFloat) -> CGPoint { | |
let x = center.x + radius * cos(angle) | |
let y = center.y + radius * sin(angle) | |
NewerOlder