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
// | |
// TimingFunction.swift | |
// | |
// Created by tcldr on 04/11/2018. | |
// https://github.com/tcldr | |
// Copyright © 2018 tcldr. | |
// | |
// Permission is hereby granted, free of charge, | |
// to any person obtaining a copy of this software and | |
// associated documentation files (the "Software"), to |
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
/* | |
Copyright (c) 2018 Kazume Koze | |
Released under the MIT license | |
https://opensource.org/licenses/mit-license.php | |
*/ | |
// | |
// CaseIterable+Index.swift | |
// | |
// |
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
extension Error { | |
public var legibleDescription: String { | |
switch errorType { | |
case .swiftError(.enum?): | |
return "\(type(of: self)).\(self)" | |
case .swiftError: | |
return String(describing: self) | |
case .swiftLocalizedError(let msg): | |
return msg | |
case .nsError(_, "kCLErrorDomain", 0): |
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
/************************************************** | |
* 양음력 계산 라이브러리 -- Library file for Korean Lunar Calendar | |
* by Senarin | |
**************************************************/ | |
var DAY0000=1721424.5; // 0000/12/31 | |
var SOLAR_EPOCH=1721425.5; // 0001/1/1 | |
var YEAR_MIN=1583; // Min. Year | |
var YEAR_MAX=2100; // Max. Year | |
var LUNAR_EPOCH=2299261.5; | |
var LOWER_LIMIT=LUNAR_EPOCH; |
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
@objc func _needsDoubleUpdateConstraintsPass() -> Bool { | |
return true | |
} | |
override var intrinsicContentSize: CGSize { | |
return attributedText?.size(forWidth: (engineBounds ?? bounds).width) ?? .zero | |
} | |
var engineBounds: CGRect? { | |
let objcSelector = "_nsis_compatibleBoundsInEngine:") |
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
@objc func _prepareForSecondIntrinsicContentSizeCalculation(withLayoutEngineBounds bounds: CGRect) { | |
print(bounds) | |
} |
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
// MIT License | |
// | |
// Copyright (c) 2017 Dariusz Rybicki Darrarski | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
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
/// Generates array form a tuple. Given tuple's elements must have homogenous type. | |
/// | |
/// - Parameter tuple: a (homogenous) tuple | |
/// - Returns: array of tuple elements | |
func makeArray<Tuple, Value>(from tuple: Tuple) -> [Value] { | |
let tupleMirror = Mirror(reflecting: tuple) | |
assert(tupleMirror.displayStyle == .tuple, "Given argument is no tuple") | |
assert(tupleMirror.superclassMirror == nil, "Given tuple argument must not have a superclass (is: \(tupleMirror.superclassMirror!)") | |
assert(!tupleMirror.children.isEmpty, "Given tuple argument has no value elements") | |
func convert(child: Mirror.Child) -> Value? { |
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
const net = require('net') | |
net.createServer(socket => { | |
socket.on('data', function(data){ | |
console.log('Echoing: %s', data.toString()) | |
socket.write(data.toString()) | |
}) | |
}).listen(8001) |