git archive --format=tar.gz -o /tmp/my-repo.tar.gz --prefix=my-repo/ master
More detailed version: https://til.simonwillison.net/git/git-archive
// context docs: https://paw.cloud/docs/reference/ExtensionContext | |
// request docs: https://paw.cloud/docs/reference/Request | |
// DynamicString docs: https://paw.cloud/docs/reference/DynamicString | |
// DynamicValue docs: https://paw.cloud/docs/reference/DynamicValue | |
function logRequestVariableInfo(requestVariable) { | |
console.log('Request Variable: ' + requestVariable.name + '\n' + | |
' Request: ' + requestVariable.request.name + '\n' + | |
' Value: ' + requestVariable.value + '\n' + | |
' Description: ' + requestVariable.description + '\n' + |
import PlaygroundSupport | |
import Foundation | |
class Worker { | |
private let queue = DispatchQueue.global(qos: .background) | |
private let serialQueue = DispatchQueue(label: "com.acme.serial") | |
public private(set) var count = 0 | |
func incrementCount() { |
// license: i dunno. pick one that works for you. Apache 2.0? that seems reasonable. Let me know if it doesn't work for some reason. | |
import Foundation | |
import Compression // https://developer.apple.com/library/mac/documentation/Performance/Reference/Compression/ | |
public enum Compression { | |
public enum Algorithm { | |
case LZFSE | |
case LZ4 | |
case LZMA |
# The trick is to link the DeviceSupport folder from the beta to the stable version. | |
# sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :) | |
# Support iOS 15 devices (Xcode 13.0) with Xcode 12.5: | |
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/15.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport | |
# Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions | |
# (A similar approach works for older versions too, just change the version number after DeviceSupport) |
git archive --format=tar.gz -o /tmp/my-repo.tar.gz --prefix=my-repo/ master
More detailed version: https://til.simonwillison.net/git/git-archive
The MIT License (MIT) | |
Copyright (c) 2016 Zev Eisenberg | |
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 furnished to do so, | |
subject to the following conditions: |
erase_sim: | |
./reset_sim.sh 2>/dev/null; true |
/// Observes a run loop to detect any stalling or blocking that occurs. | |
/// | |
/// This class is thread-safe. | |
@interface GHRunLoopWatchdog : NSObject | |
/// Initializes the receiver to watch the specified run loop, using a default | |
/// stalling threshold. | |
- (id)initWithRunLoop:(CFRunLoopRef)runLoop; | |
/// Initializes the receiver to detect when the specified run loop blocks for |
@implementation UIFontDescriptor (DZWDynamicType) | |
+ (instancetype)dzw_preferredFontDescriptorWithTextStyle:(NSString *)style { | |
return [[self preferredFontDescriptorWithTextStyle:style] dzw_fontDescriptorWithMatchingFamily:@"Avenir Next"]; | |
} | |
- (instancetype)dzw_fontDescriptorWithMatchingFamily:(NSString *)family { | |
NSMutableDictionary *attributes = [self.fontAttributes mutableCopy]; | |
[attributes removeObjectForKey:UIFontDescriptorTextStyleAttribute]; | |
UIFontDescriptor *newDesc = (__bridge_transfer UIFontDescriptor *)CTFontDescriptorCreateCopyWithFamily((__bridge CTFontDescriptorRef)self, (__bridge CFStringRef)family); |
// Use in conjunction with e.g. KVO on AVPlayer.externalPlaybackActive | |
AVAudioSessionPortDescription *port = [AVAudioSession sharedInstance].currentRoute.outputs.firstObject; | |
if ([port.portType isEqualToString:AVAudioSessionPortAirPlay]) { | |
NSLog(@"Now playing on '%@'", port.portName); | |
} |