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
#!/usr/bin/python | |
from CoreFoundation import CFPreferencesCopyValue, CFPreferencesSetValue, kCFPreferencesCurrentUser, \ | |
kCFPreferencesAnyHost, CFPreferencesSynchronize | |
# Reading a preferences value | |
v = CFPreferencesCopyValue('NSNavLastRootDirectory', 'com.apple.Finder', kCFPreferencesCurrentUser, kCFPreferencesAnyHost) | |
print(v) | |
# Writing a preferences value |
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
# Tested on 10.11 | |
# Assumes your network is in a state to actually do the discovery and that you have | |
# automatic timezone discovery enabled in Date & Time and Location services enabled | |
# (Generally this means wifi enabled on your device and network stack is up) | |
# For enabling location services and auto, check Allister's work here: | |
# https://gist.github.com/arubdesu/b72585771a9f606ad800 | |
#import <Foundation> |
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
from ctypes import CDLL, Structure, POINTER, c_char_p, c_size_t, c_void_p, c_uint32, pointer, byref | |
Security = CDLL('/System/Library/Frameworks/Security.framework/Versions/Current/Security') | |
class OpaqueType(Structure): | |
pass | |
OpaqueTypeRef = POINTER(OpaqueType) | |
AuthorizationRef = OpaqueTypeRef |
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
The code under the headings should be inserted for the abbreviation stated. Trying to find a better way to export this. | |
yattr | |
----- | |
/** | |
* ${cursor} | |
* | |
* @attribute ${name} | |
* @type ${type} |