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 UIKit | |
/// Represents a single `NSLayoutConstraint` | |
enum LayoutAnchor { | |
case constant(attribute: NSLayoutConstraint.Attribute, | |
relation: NSLayoutConstraint.Relation, | |
constant: CGFloat) | |
case relative(attribute: NSLayoutConstraint.Attribute, | |
relation: NSLayoutConstraint.Relation, |
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
// https://github.com/yankouskia/love-triangle | |
module.exports = function getLoveTrianglesCount(preferences = []) { | |
return ( | |
preferences.map((x, i) => getTriangle(preferences, i)).filter(x => x) | |
.length / 3 | |
); | |
}; | |
const getTriangle = (preferences, index) => { | |
if (preferences[index] - 1 == index) { |
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
struct HolidayResponse: Codable { | |
let response: Holidays | |
} | |
struct Holidays: Codable { | |
let holidays: [HolidayDetail] | |
} | |
struct HolidayDetail:Codable { | |
let name: String | |
let date: HolidayDate |