Keybase proof
I hereby claim:
- I am soffes on github.
- I am soffes (https://keybase.io/soffes) on keybase.
- I have a public key ASCysfuxJROh3gB1FpEjcPIZmgCaOnFECNl8mGu3r0ozYQo
To claim this, I am signing this object:
// From my answer https://stackoverflow.com/a/69905152/118631 | |
import UIKit | |
public extension UIDevice { | |
enum PushEnvironment: String { | |
case unknown | |
case development | |
case production | |
} |
def this(_); end | |
def is(_); end | |
def fine; puts 'chaos' end | |
this is fine |
I hereby claim:
To claim this, I am signing this object:
import UIKit | |
extension UIFont { | |
public func withMonospacedNumbers() -> Self { | |
let monospacedFeature: [UIFontDescriptor.FeatureKey: Any] | |
if #available(iOS 15.0, *) { | |
monospacedFeature = [ | |
.type: kNumberSpacingType, | |
.selector: kMonospacedNumbersSelector |
override func viewDidLoad() { | |
super.viewDidLoad() | |
let keyboardGuide = KeyboardLayoutGuide() | |
view.addLayoutGuide(keyboardGuide) | |
NSLayoutConstraint.activate([ | |
someTextField.bottomAnchor.constraint(lessThanOrEqualTo: view.safeAreaLayoutGuide.bottom, constant: -8), | |
someTextField.bottomAnchor.constraint(lessThanOrEqualTo: keyboardGuide.topAnchor, constant: -8), | |
]) |
# frozen_string_literal: true | |
source 'https://rubygems.org' | |
ruby '3.0.0' | |
# Instead of depending on `rails`, I just add the gems I need below | |
rails_version = '>= 6.1.0' | |
# Active Record from Rails |
class TestCase < ActiveSupport::TestCase | |
def setup | |
super | |
DatabaseCleaner.start | |
@queries = [] | |
ActiveSupport::Notifications.subscribe('sql.active_record') do |_, _, _, _, payload| | |
@queries << payload[:sql] unless payload[:name].in? %w[CACHE SCHEMA] | |
end | |
end |
# From this delightful video https://www.youtube.com/watch?v=ghxQA3vvhsk | |
PHI = (1 + Math.sqrt(5)) / 2 | |
def fib(n) | |
(((PHI**n) - ((-1 / PHI)**n)) / Math.sqrt(5)).to_i | |
end | |
(1...10).map { |n| fib(n) } | |
# => [1, 1, 2, 3, 5, 8, 13, 21, 34] |
import Foundation | |
// Inspired by https://gist.github.com/loudmouth/332e8d89d8de2c1eaf81875cfcd22e24 | |
private struct JSONCodingKeys: CodingKey { | |
var stringValue: String | |
init?(stringValue: String) { | |
self.stringValue = stringValue | |
} |
import UIKit | |
final class SafariActivity: UIActivity { | |
// MARK: - Properties | |
var url: URL? | |
// MARK: - UIActivity |