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
// swift-tools-version:5.5 | |
// The swift-tools-version declares the minimum version of Swift required to build this package. | |
import PackageDescription | |
let package = Package( | |
name: "App", | |
products: [ | |
// ... | |
], |
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 | |
import Dispatch | |
extension View { | |
// Warning: This will affect the layout of the view that's wrapped! :( | |
public func editing(_ isEditing: Binding<Bool>) -> some View { | |
EditingProxy(rootView: self, isEditing: isEditing) | |
} | |
} |
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
//<Optional> Enable install from USB | |
//Backup the info.plist | |
sudo cp /Applications/Utilities/Boot\ Camp\ Assistant.app/Contents/Info.plist Desktop/Info.plist.bak | |
//Edit plist | |
sudo nano /Applications/Utilities/Boot\ Camp\ Assistant.app/Contents/Info.plist | |
//Add your Boot ROM Version: MBP41.00C1.B03 to | |
//DARequiredROMVersions | |
//Rename PreUSBBootSupportedModels to USBBootSupportedModels | |
//And add your Model Identifier: MacBookPro4,1 there. | |
//Save ^X, Y, Return |
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
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; | |
NSMutableArray *recents = [defaults objectForKey:RECENT_PHOTO_KEY]; | |
if (!recents) recents = [NSMutableArray array]; | |
if ([recents containsObject:clickedPhoto]) [recents removeObject:clickedPhoto]; //deleting object if we have one to keep the array of unique objects | |
[recents insertObject:clickedPhoto atIndex:0]; //inserting clicked photo to the beginning of the mutable array | |
[defaults setObject:recents forKey:RECENT_PHOTO_KEY]; //saving defaults | |
[defaults synchronize]; |
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
on idle | |
tell application "System Events" | |
tell current location of network preferences | |
set myConnection to the service "VPN" #rename as your VPN connection called | |
if myConnection is not null then | |
if current configuration of myConnection is not connected then | |
connect myConnection | |
end if | |
end if | |
end tell |