- Create or find a gist that you own.
- Clone your gist (replace
<hash>
with your gist's hash):# with ssh git clone [email protected]:<hash>.git mygist # with https
git clone https://gist.github.com/.git mygist
<!-- Place in /Library/LaunchDaemons/com.github.edwardsmatt.noatime.plist --> | |
<!-- execute: sudo chown root:wheel /Library/LaunchDaemons/com.github.edwardsmatt.noatime.plist --> | |
<!-- Restart --> | |
<!-- Verify: mount | grep " / " --> | |
<!-- you should see noatime in the parentheses --> | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" | |
"http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> |
// Taken from http://PSPDFKit.com. This snippet is under public domain. | |
#define UIKitVersionNumber_iOS_7_0 0xB57 | |
BOOL PSPDFIsUIKitFlatMode(void) { | |
static BOOL isUIKitFlatMode = NO; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
// We get the modern UIKit if system is running >= iOS 7 and we were linked with >= SDK 7. | |
if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_7_0) { | |
isUIKitFlatMode = (NSVersionOfLinkTimeLibrary("UIKit") >> 16) >= UIKitVersionNumber_iOS_7_0; | |
} |
#ifndef NS_DESIGNATED_INITIALIZER | |
#if __has_attribute(objc_designated_initializer) | |
#define NS_DESIGNATED_INITIALIZER __attribute((objc_designated_initializer)) | |
#else | |
#define NS_DESIGNATED_INITIALIZER | |
#endif | |
#endif |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>downloadables</key> | |
<array> | |
<dict> | |
<key>dependencies</key> | |
<array/> | |
<key>fileSize</key> |
<hash>
with your gist's hash):
# with ssh
git clone [email protected]:<hash>.git mygist
# with https
git clone https://gist.github.com/.git mygist
import Foundation | |
func withCStrings(_ strings: [String], scoped: ([UnsafeMutablePointer<CChar>?]) throws -> Void) rethrows { | |
let cStrings = strings.map { strdup($0) } | |
try scoped(cStrings + [nil]) | |
cStrings.forEach { free($0) } | |
} | |
enum RunCommandError: Error { | |
case WaitPIDError |
// Spec http://www.ecma-international.org/ecma-262/6.0/#sec-json.stringify | |
const replacer = (key, value) => | |
value instanceof Object && !(value instanceof Array) ? | |
Object.keys(value) | |
.sort() | |
.reduce((sorted, key) => { | |
sorted[key] = value[key]; | |
return sorted | |
}, {}) : | |
value; |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>method</key> | |
<string>app-store</string> | |
<key>teamID</key> | |
<string>XXXXXXXXXX</string> | |
<key>uploadBitcode</key> | |
<true/> |
addmedia | |
addphoto | |
addvideo | |
appinfo | |
boot | |
bootstatus | |
clone | |
create | |
darwinup | |
delete |
#!/bin/zsh | |
#Credit: Original idea and script disable.sh by pwnsdx https://gist.github.com/pwnsdx/d87b034c4c0210b988040ad2f85a68d3 | |
#Disabling unwanted services on macOS 11 Big Sur (11) and macOS Monterey (12) | |
#Disabling SIP is required ("csrutil disable" from Terminal in Recovery) | |
#Modifications are written in /private/var/db/com.apple.xpc.launchd/ disabled.plist and disabled.501.plist | |
# user | |
TODISABLE=() |