- Download Ubuntu 18.04 LTS
- Download Balena Etcher
- Launch Etcher and burn image to SD card.
- After burning, remove and reinsert the SD card so macOS mounts it. A
system-boot
partition will appear. - In Terminal:
touch /Volumes/system-boot/ssh
to enable SSH access. - Safely eject the volume, remove the SD card, insert into Raspberry Pi.
- Connect Raspberry Pi to power and ethernet.
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
#!/bin/sh | |
# | |
# Generate self-signed certificates for local development | |
# /www/keys/LocalRootCA.crt will need to be imported into Keychain Access | |
# and set to "Always Trust" | |
# | |
BASE_PATH="/www/keys" | |
ROOT_PATH="$BASE_PATH/LocalRootCA" |
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
// This is a quick example of how to use the CoreAudio API and the new Tapping | |
// API to create a tap on the default audio device. You need macOS 14.2 or | |
// later. | |
// Build command: | |
// clang -framework Foundation -framework CoreAudio main.m -o tapping | |
// License: You're welcome to do whatever you want with this code. If you do | |
// something cool please tell me though. I would love to hear about it! |
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
# iPhone with home button | |
xcrun simctl status_bar booted clear | |
xcrun simctl status_bar booted override \ | |
--time "9:41 AM" \ | |
--wifiBars 3 --cellularBars 4 --operatorName "" | |
xcrun simctl spawn booted defaults write com.apple.springboard SBShowBatteryPercentage 1 | |
# iPhone X | |
xcrun simctl status_bar booted clear | |
xcrun simctl status_bar booted override --time "9:41" --wifiBars 3 --cellularBars 4 |
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
- (NSArray<NSURL *> *) parsePasteboard:(NSPasteboard *)pasteboard | |
{ | |
NSMutableDictionary *trackIDToMetadataMap = [NSMutableDictionary dictionary]; | |
NSMutableArray *orderedTrackIDs = [NSMutableArray array]; | |
NSMutableArray *metadataFileURLs = [NSMutableArray array]; | |
NSMutableArray *otherFileURLs = [NSMutableArray array]; | |
auto parsePlaylist = ^(NSDictionary *playlist) { | |
if (![playlist isKindOfClass:[NSDictionary class]]) { |
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
static void sOpenScreenRecordingPreferences() | |
{ | |
CFDataRef passThruData = CFBridgingRetain([@"Privacy_ScreenCapture" dataUsingEncoding:NSUTF8StringEncoding]); | |
CFArrayRef itemURLs = CFBridgingRetain(@[ [NSURL fileURLWithPath:@"/System/Library/PreferencePanes/Security.prefPane"] ]); | |
OSStatus err = noErr; | |
AEDesc passThruDesc = {0}; | |
BOOL needsDispose = NO; |
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
/* | |
During Dark Mode migration for macOS, I found it helpful to have a global hotkey | |
which toggled between Light/Dark Mode. | |
This hack attempts to do something similar for iOS. | |
1) Add your main window in -applicationDidFinishLaunching: | |
2) Triple tap the window (I tend to do this near the title bar) to flip between light and dark. | |
*/ |
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 Default.exec | |
ExistingCommandMap = { } | |
class build_python3(Default.exec.ExecCommand): | |
def run(self, cmd=None, kill=False, **kwargs): | |
file = cmd | |
if file in ExistingCommandMap: | |
existing = ExistingCommandMap[file] |
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
class Envelope { | |
constructor(type, strength, fromValue, toValue, sampleCount) | |
{ | |
this._generate(type, strength, fromValue, toValue, sampleCount); | |
} |
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
Note: | |
1) These may change in future versions of macOS. | |
2) Apple may also add more appearances or control accent colors in the future. | |
3) You probably don't want to hardcode color values. | |
4) Watch: | |
https://developer.apple.com/videos/play/wwdc2018/210 | |
https://developer.apple.com/videos/play/wwdc2018/218 | |
All colors specified in the sRGB color space. |
NewerOlder