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
# https://developer.apple.com/documentation/corefoundation/3684868-cfbundleisarchitectureloadable?language=objc | |
# https://developer.apple.com/documentation/foundation/1495005-mach-o_architecture?language=occ | |
# https://developer.apple.com/documentation/foundation/1495005-mach-o_architecture/nsbundleexecutablearchitecturearm64?language=occ | |
from Foundation import NSBundle | |
import objc | |
CF = NSBundle.bundleWithPath_('/System/Library/Frameworks/CoreFoundation.framework') | |
f = [('CFBundleIsArchitectureLoadable', 'BQ')] | |
objc.loadBundleFunctions(CF, globals(), f) | |
NSBundleExecutableArchitectureARM64 = 0x0100000c |
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
#!/usr/bin/python2.7 | |
# -*- coding: utf-8 -*- | |
''' | |
Defaults Monitor - tool to sniff defaults keys and values using unified log | |
to launch use standard python 2.7, eg python2.7 ./defsmon.py | |
''' | |
import os |
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
How to manually setup flake8 as PyCharm external tool | |
File / Settings / Tools / External Tools / Add | |
Name: Flake8 | |
Program: $PyInterpreterDirectory$/python | |
Parameters: -m flake8 --max-complexity 10 --ignore E501 $FilePath$ | |
Working directory: $ProjectFileDir$ | |
Output Filters / Add | |
Name: Filter 1 |
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
#!/bin/bash | |
# use argument 1 as the version or get it from sw_vers | |
os_ver=${1-:$(sw_vers -productVersion)} | |
# string comparison | |
if [[ "$os_ver" == 10.13.* ]]; then | |
echo "macOS High Sierra" | |
elif [[ "$os_ver" == 10.12.* ]]; then | |
echo "macOS Sierra" |
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
#!/usr/bin/python | |
import os | |
import sys | |
from CoreFoundation import (CFPreferencesAppValueIsForced, | |
CFPreferencesCopyAppValue, | |
CFPreferencesCopyValue, | |
kCFPreferencesAnyUser, | |
kCFPreferencesAnyHost, |