- [Working without a nib, Part 1][1]
- [Working without a nib, Part 2: Also Also Wik][2]
- [Working without a nib, Part 5: No, 3!][3]
- [Working without a nib, Part 4: setAppleMenu][4]
- [Working without a nib, Part 5: Open Recent menu][5]
- [Working without a nib, Part 6: Working without a xib][6]
- [Working without a nib, Part 7: The empire strikes back][7]
- [Working without a nib, Part 8: The nib awakens][8]
- [Working without a nib, Part 9: Shipping without a nib][9]
- [Working without a nib, Part 10: Mac Main Menu][10]
This file contains hidden or 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 SwiftUI | |
enum OSDocumentError: Error { | |
case unknownFileFormat | |
} | |
#if canImport(UIKit) | |
import UIKit |
This file contains hidden or 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
#!/usr/bin/env osascript | |
-- Version 2, now with attachments! | |
-- Note, the first couple times you run this script, the Messages app may prompt you to approve a couple things, one of which will be the ability to send SMS messages through your phone | |
-- Run via osascript on the command line like this: | |
-- osascript sendText.scpt --to ########## "this is" "a text message" --attachment "/path/to/image.png" "sent via applescript" | |
-- Where ########## is the phone number to send to | |
-- If you leave out `--to ##########`, it defaults to the value of an environment variable named MYPHONE in your .bashrc file (add the line "export MYPHONE=##########" to ~/.bashrc, entering your default phone number in place of ##########) | |
-- The 3 quoted strings will appear on separate lines and the image will be inserted between the lines "a text message" and "sent via applescript" | |
on run argv |
This file contains hidden or 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
1) Add this code to a new file in Script Editor | |
2) Export the script as "Application" and make sure it's code signed | |
3) Put "Startup.app" in the root folder of the test website (e.g. where index.html is located) | |
4) Make sure that "Startup.app" has Full Disk Access in System Preferences > Security & Privacy > Privacy |
This file contains hidden or 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
command alias objc expression -l objc -O -- | |
command regex swift 's#(.+)#expression -l Swift -O -- defer { CATransaction.flush() }; %1#' | |
breakpoint set -n AppDelegate.application --one-shot true --auto-continue true | |
breakpoint command add | |
swift import Foundation | |
swift import UIKit | |
swift import MyApp_tvOS | |
swift import MyApp_iOS | |
swift func $printSubviews(of view: UIView) { print(view.perform("recursiveDescription")!) } |
This file contains hidden or 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
// Image+Trim.swift | |
// | |
// Copyright © 2020 Christopher Zielinski. | |
// https://gist.github.com/chriszielinski/aec9a2f2ba54745dc715dd55f5718177 | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is |
This file contains hidden or 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
- (UIImage *)dynamicImage | |
{ | |
UITraitCollection *const baseTraitCollection = /* an existing trait collection */; | |
UITraitCollection *const lightTraitCollection = [UITraitCollection traitCollectionWithTraitsFromCollections:@[baseTraitCollection, [UITraitCollection traitCollectionWithUserInterfaceStyle:UIUserInterfaceStyleLight]]]; | |
UITraitCollection *const purelyDarkTraitCollection = [UITraitCollection traitCollectionWithUserInterfaceStyle:UIUserInterfaceStyleDark]; | |
UITraitCollection *const darkTraitCollection = [UITraitCollection traitCollectionWithTraitsFromCollections:@[baseTraitCollection, purelyDarkTraitCollection]]; | |
__block UIImage *lightImage; | |
[lightTraitCollection performAsCurrentTraitCollection:^{ | |
lightImage = /* draw image */; |
This file contains hidden or 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
# Obtained with the code written in next file | |
emoji_grinning_face=😀 | |
emoji_grinning_face_with_big_eyes=😃 | |
emoji_grinning_face_with_smiling_eyes=😄 | |
emoji_beaming_face_with_smiling_eyes=😁 | |
emoji_grinning_squinting_face=😆 | |
emoji_grinning_face_with_sweat=😅 | |
emoji_rolling_on_the_floor_laughing=🤣 | |
emoji_face_with_tears_of_joy=😂 | |
emoji_slightly_smiling_face=🙂 |
- Start vmware
- select guest and "power to firmware"
- in efi menu, enter setup > config boot options > add boot options > select recovery partition > select boot.efi
- at input file description hit and type in label e.g. "recovery" > commit changes and exit
- boot from recovery and be patient
- follow prompt until you see OS X Utilities menu
- At the very top menu select Utilities > Terminal
This guide is targetted at intermediate or expert users who want low-level control over their Python environments.
When you're working on multiple coding projects, you might want a couple different version of Python and/or modules installed. This helps keep each workflow in its own sandbox instead of trying to juggle multiple projects (each with different dependencies) on your system's version of Python. The guide here covers one way to handle multiple Python versions and Python environments on your own (i.e., without a package manager like conda
). See the Using the workflow section to view the end result.
NewerOlder