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
module Jekyll | |
class PageVariationsGenerator < Generator | |
safe true | |
def generate(site) | |
pagesCopy = site.pages.dup | |
site.config['pagevariations'].each_entry do |variation| | |
pagesCopy.each_entry do |page| | |
pageCopy = page.dup | |
oldPermalink = pageCopy.data['permalink'] |
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
class OriginalClass { | |
var fooProp: Int = 15 | |
func sayHello(_ string: String) { | |
print("Hello \(string) \(fooProp)") | |
} | |
} | |
protocol MockProtocol { | |
var fooProp: Int { get } |
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
class Observer: Subscription { | |
public func unsubscribe() { | |
... | |
} | |
public func request(_ demand: Subscribers.Demand) { | |
// We only inform on changes. | |
print("Demand for \(demand) received.") | |
} | |
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
import Foundation | |
extension Array where Array.Element == String { | |
func parseKeyValue(prefix: String = "--", suffix: String = "", valueSeparator: String = "=", removePrefix: Bool = true, removeSuffix: Bool = true, separateArguments: Bool = true, endIndicator: String = "--") -> Dictionary<String, String> { | |
var unlabeled = [String]() | |
return parseKeyValue(prefix: prefix, suffix: suffix, valueSeparator: valueSeparator, removePrefix: removePrefix, removeSuffix: removeSuffix, separateArguments: separateArguments, endIndicator: endIndicator, unlabeled: &unlabeled) | |
} | |
func parseKeyValue(prefix: String = "--", suffix: String = "", valueSeparator: String = "=", removePrefix: Bool = true, removeSuffix: Bool = true, separateArguments: Bool = true, endIndicator: String = "--", unlabeled: inout [String]) -> Dictionary<String, String> { | |
var result = Dictionary<String, String>() |
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
Names: | |
1: __func__ | |
2: __FUNCTION__ | |
3: __PRETTY_FUNCTION__ | |
4: @509 | |
5: L_OBJC_SELECTOR_REFERENCES_0 | |
6: @512 | |
7: L_OBJC_SELECTOR_REFERENCES_1 | |
8: -[NSEvent initWithMacEvent:window:] |
OlderNewer