Skip to content

Instantly share code, notes, and snippets.

View Scior's full-sized avatar

Suita Fujino Scior

View GitHub Profile
#if DEBUG
import UIKit
extension UITableViewCell {
@available(*, deprecated, message: "Subviews should be added to the contentView")
open override func addSubview(_ view: UIView) {
super.addSubview(view)
}
}
import Foundation
@propertyWrapper
public struct AlwaysEqual<T> {
public var wrappedValue: T
public init(wrappedValue: T) {
self.wrappedValue = wrappedValue
}
}
import Foundation
@propertyWrapper
public struct DecodeOnly<T: Decodable> {
public var wrappedValue: T
public init(wrappedValue: T) {
self.wrappedValue = wrappedValue
}
}
import Foundation
protocol Animal {
func bark()
}
final class Alpaca: Animal {
func bark() {}
}
import UIKit
extension UIColor {
var rgb: Int {
var red: CGFloat = 0
var green: CGFloat = 0
var blue: CGFloat = 0
var alpha: CGFloat = 0
getRed(&red, green: &green, blue: &blue, alpha: &alpha)
@Scior
Scior / LinnaSample
Last active April 12, 2019 03:21
Linna Sample
a
Здравствуйте!!
@Scior
Scior / pre_push
Created July 16, 2018 13:12
pre push hook
#!/bin/bash
TARGET_BRANCHES="(master|develop)"
while read local_ref local_sha1 remote_ref remote_sha1
do
if [[ "${remote_ref##refs/heads/}" =~ $TARGET_BRANCHES ]]; then
echo "😇😇😇${remote_ref##refs/heads/}にpush奴〜〜〜😇😇😇"
exit 1
fi