A script to fix EDID problems on external monitors in macOS.
-
Connect only the problem display.
-
Create this directory structure (if it doesn't already exist):
#!/usr/bin/python | |
# | |
# Reads plist from standard input and writes it back to standard output | |
# sorted by key. | |
from plistlib import readPlist, writePlist | |
from sys import stdin, stdout | |
plist = readPlist(stdin) | |
writePlist(plist, stdout) |
Country | CountryCode | Currency | Code | |
---|---|---|---|---|
New Zealand | NZ | New Zealand Dollars | NZD | |
Cook Islands | CK | New Zealand Dollars | NZD | |
Niue | NU | New Zealand Dollars | NZD | |
Pitcairn | PN | New Zealand Dollars | NZD | |
Tokelau | TK | New Zealand Dollars | NZD | |
Australian | AU | Australian Dollars | AUD | |
Christmas Island | CX | Australian Dollars | AUD | |
Cocos (Keeling) Islands | CC | Australian Dollars | AUD | |
Heard and Mc Donald Islands | HM | Australian Dollars | AUD |
Conversion Process from Objective-C syntax to Swift The most important first step is to run Apple's "Convert to Modern Objective-C Syntax" refactoring, so that you're using array/dictionary literals and bracket-accesses; these will then be usable in Swift. Note also that I'm a beginner in Swift, so my apologies for any mistakes or incompleteness here.
When you see this pattern | Replace with this |
---|---|
Module | |
@interface *newType* : *superType* <*protocol1*, *protocol2*> |
class *newType* : *superType*, *protocol1*, *protocol2* |
@implementation OR @synthesize OR @end |
Delete |
Properties |
import Foundation | |
/// An abstract class that makes building simple asynchronous operations easy. | |
/// Subclasses must implement `execute()` to perform any work and call | |
/// `finish()` when they are done. All `NSOperation` work will be handled | |
/// automatically. | |
open class AsynchronousOperation: Operation { | |
// MARK: - Properties |
1. Open Terminal | |
2. cd to your Xcode project | |
3. Execute the following when inside your target project: | |
find . -name "*.swift" -print0 | xargs -0 wc -l |
//: Playground - noun: a place where people can play | |
// Value Type | |
struct StructA { | |
var field1: String = "Default Struct Value" | |
let field2: Int = 1 | |
} | |
let constantStruct = StructA() |
The libdispatch is one of the most misused API due to the way it was presented to us when it was introduced and for many years after that, and due to the confusing documentation and API. This page is a compilation of important things to know if you're going to use this library. Many references are available at the end of this document pointing to comments from Apple's very own libdispatch maintainer (Pierre Habouzit).
My take-aways are:
You should create very few, long-lived, well-defined queues. These queues should be seen as execution contexts in your program (gui, background work, ...) that benefit from executing in parallel. An important thing to note is that if these queues are all active at once, you will get as many threads running. In most apps, you probably do not need to create more than 3 or 4 queues.
Go serial first, and as you find performance bottle necks, measure why, and if concurrency helps, apply with care, always validating under system pressure. Reuse
disabled_rules: # rule identifiers to exclude from running | |
# Number of function parameters should be low. | |
- function_parameter_count | |
# Type bodies should not span too many lines. | |
- type_body_length | |
# Complexity of function bodies should be limited. | |
- cyclomatic_complexity |
- Make sure you have configured git tools: see configuring tools.
- Make sure you have updated git aliases: see GIT ALIAS.
Performing a daily rebase is good, in order to be up-to-date with the changes in the integration branch.