Skip to content

Instantly share code, notes, and snippets.

View mihaelamj's full-sized avatar

Mihaela Mihaljevic mihaelamj

View GitHub Profile
//------------------------------------------------------------------------
// The SwiftUI Lab: Advanced SwiftUI Animations
// https://swiftui-lab.com/swiftui-animations-part1 (Animating Paths)
// https://swiftui-lab.com/swiftui-animations-part2 (GeometryEffect)
// https://swiftui-lab.com/swiftui-animations-part3 (AnimatableModifier)
//------------------------------------------------------------------------
import SwiftUI
struct ContentView: View {
import OpenAPIKitCore
import Foundation
extension JSONSchema {
public typealias RefOrSelf = Either<JSONReference<JSONSchema>, JSONSchema>
public typealias RefOrSelf_Array = [JSONSchema.RefOrSelf]
}
extension OpenAPI.Header {
public typealias RefOrSelf = Either<JSONReference<OpenAPI.Header>, OpenAPI.Header>
@mihaelamj
mihaelamj / failingTestWebhook_assertJSONEquivalent.swift
Created March 19, 2021 15:51
Failing test when comparing JSONs (OpenAPiKit)
// This is a failing test:
func test_webhooks_encode() throws {
let op = OpenAPI.Operation(responses: [:])
let document = OpenAPI.Document(
info: .init(title: "API", version: "1.0"),
servers: [],
paths: [:],
webhooks: [
"webhook-test": .init(get: op, put: op, post: op, options: op, head: op, patch: op, trace: op)
],
@mihaelamj
mihaelamj / StoryboardParser.swift
Last active June 7, 2020 02:52
Utility to make a CSV report on a storyboard, uses `IBDecodable` swift package
//
// StoryboardParser.swift
// StoryboardReader
//
// Created by Mihaela Mihaljevic Jakic on 07/06/2020.
// Copyright © 2020 Mihaela Mihaljevic Jakic. All rights reserved.
//
import Foundation
import IBDecodable
@mihaelamj
mihaelamj / UIView+Caar.swift
Created October 23, 2018 09:20
caar UIVIew extension for loading .caar files. great with Kite Compositor
import UIKit
//Example from:
//https://github.com/kitecomp/archive-example
//wrapped into a small UIView category
//https://gist.github.com/mihaelamj/79878ba7b7881a12f1652c113adcf5d8
public extension UIView {
public func loadCAARAnimation(named: String, scale : CGFloat = 1.0) -> CALayer? {
@mihaelamj
mihaelamj / GenericDecoders.swift
Last active May 31, 2018 17:23
Are you getting you collections for the backend in an unexpected way? Sometimes as an array and other times as dictionary? This gist tries to solve that.
extension String : CodingKey {
public var stringValue: String {
return self
}
public init?(stringValue: String) {
self.init(stringLiteral: stringValue)
}
public var intValue: Int? {
return nil
}