Skip to content

Instantly share code, notes, and snippets.

project_cache/Chatto/ChattoAdditions/Source/Chat Items/TextMessages/Views/TextMessageCollectionViewCellDefaultStyle.swift: case let .template(isIncoming: isIncoming, showsTail: showsTail):
project_cache/Chatto/ChattoAdditions/Source/Chat Items/TextMessages/Views/TextMessageCollectionViewCellDefaultStyle.swift: case let .normal(isIncoming: isIncoming, status: status, showsTail: showsTail, isSelected: isSelected):
project_cache/Lark/Sources/CodeGenerator/Generator.swift: case let .list(itemType: itemType): hierarchy.insertEdge((.type(type.name!), .type(itemType)))
project_cache/Lark/Sources/CodeGenerator/WebServiceDescription+verify.swift: case let .list(itemType: itemType): return [Edge(from: from, to: .type(itemType))]
project_cache/ProcedureKit/Sources/ProcedureKit/Repeat.swift: case let .random(minimum: min, maximum: max):
project_cache/ProcedureKit/Sources/ProcedureKit/Repeat.swift: case let .incrementing(initial: initial, increment: increment):
project_cac
project_cache/Chatto/Chatto/Source/ChatController/BaseChatViewController+Changes.swift: case .preservePosition(rectForReferenceIndexPathBeforeUpdate: let oldRect, referenceIndexPathAfterUpdate: let indexPath):
project_cache/Chatto/ChattoAdditions/Source/Chat Items/TextMessages/Views/TextMessageCollectionViewCellDefaultStyle.swift: case let .template(isIncoming: isIncoming, showsTail: showsTail):
project_cache/Chatto/ChattoAdditions/Source/Chat Items/TextMessages/Views/TextMessageCollectionViewCellDefaultStyle.swift: case let .normal(isIncoming: isIncoming, status: status, showsTail: showsTail, isSelected: isSelected):
project_cache/GRDB.swift/GRDB/Core/Database.swift: case .transaction(action: let action):
project_cache/GRDB.swift/GRDB/Core/Database.swift: case .savepoint(name: let name, action: let action):
project_cache/GRDB.swift/GRDB/Core/Database.swift: case .insert(tableName: let tableName): return tableName
project_cache/GRDB.swift/GRDB/Core/Dat
public protocol P {
func foo()
}
public protocol Q: P {
}
extension Q {
final func foo() { … }
}
protocol A {
func foo()
}
extension A {
default func foo() { … } // Dynamically dispatched b/c it’s in the protocol
func bar() { … } // Statically dispatched b/c it’s not in the protocol
}
// Dynamic shadows static
protocol A {
func foo()
}
extension A {
func foo() { print("A foo") }
func bar() { print("A bar") }
}
protocol B: A {
func bar()
}

Suppose we have a country of 10 mutually hostile religious factions. Each is around 10% of the population; the largest group is the Fooists, who are 12%.

Suppose each relgious faction nominates a candidate whose platform is “outlaw all other religions except mine.”

Suppose that there is also an 11th candidate, the tolerant one, whose platform is “allow freedom of religion.”

The country is so balkanized that every citizen’s preferences are as follows:

  1. My religion’s candidate
  2. The tolerant one
alias {stash,branch}=git
touch branch stash
stash add stash branch
branch commit -m stash > branch
branch stash save branch
stash stash save stash > stash
branch stash save stash
branch branch stash
stash stash branch branch
branch checkout -- stash branch

Do away with --enable-autopin and --disable-autopin. The only new package manager commands are pin and unpin.

There are two pinfiles: a private one and a shared one. The shared one is adjacent to Package.swift, as in the existing proposal. The private one is stored in some quasi-hidden location not likely to be checked in, e.g. a dotfile, and is an implementation detail.

swift package pin foo 1.2.3 writes a dependency version to the shared pinfile; swift package unpin foo removes it from the shared one. Running swift package pin foo with no version number copies the entry from the private pinfile to the shared one, with its current version.

swift package update only searches for new versions of packages listed in the private pinfile; --repin is required to update packages in the shared one.

In the shared pinfile, there is a boolean setting that determines whether newly downloaded dependencies are added to the shared pinfile. Both swift package pin --all and swift package pin --new se

@pcantrell
pcantrell / gist:90a2e3b41f7b277f157c18a7a7348c69
Created September 26, 2016 21:09
Siesta logging improvements: after
Siesta:configuration  │ URL pattern ** compiles to regex ^https:\/\/api\.github\.com\/[^:?]*($|\?)
Siesta:configuration  │ Added config 1 [**]
Siesta:configuration  │ URL pattern /search/** compiles to regex ^https:\/\/api\.github\.com\/search\/[^:?]*($|\?)
Siesta:configuration  │ Added config 2 [/search/**]
Siesta:configuration  │ URL pattern /users/* compiles to regex ^https:\/\/api\.github\.com\/users\/[^/:?]*($|\?)
Siesta:configuration  │ Added config 3 [/users/* : JSON → User]
Siesta:configuration  │ URL pattern /users/*/repos compiles to regex ^https:\/\/api\.github\.com\/users\/[^/:?]*\/repos($|\?)
Siesta:configuration  │ Added config 4 [/users/*/repos : JSON → Array<Repository>]
Siesta:configuration  │ URL pattern /search/repositories compiles to regex ^https:\/\/api\.github\.com\/search\/repositories($|\?)
Siesta:configuration  │ Added config 5 [/search/repositories : JSON → Array<Repository>]
@pcantrell
pcantrell / gist:30cf2ddc69df7af729670e15fc8e5b89
Created September 26, 2016 21:09
Siesta logging improvements: before
[Siesta:configuration] URL pattern ** compiles to regex ^https:\/\/api\.github\.com\/[^:?]*($|\?)
[Siesta:configuration] Added config 1 [**]
[Siesta:configuration] URL pattern /search/** compiles to regex ^https:\/\/api\.github\.com\/search\/[^:?]*($|\?)
[Siesta:configuration] Added config 2 [/search/**]
[Siesta:configuration] URL pattern /users/* compiles to regex ^https:\/\/api\.github\.com\/users\/[^/:?]*($|\?)
[Siesta:configuration] Added config 3 [/users/* : JSON → User]
[Siesta:configuration] URL pattern /users/*/repos compiles to regex ^https:\/\/api\.github\.com\/users\/[^/:?]*\/repos($|\?)
[Siesta:configuration] Added config 4 [/users/*/repos : JSON → Array<Repository>]
[Siesta:configuration] URL pattern /search/repositories compiles to regex ^https:\/\/api\.github\.com\/search\/repositories($|\?)
[Siesta:configuration] Added config 5 [/search/repositories : JSON → Array<Repository>]