Skip to content

Instantly share code, notes, and snippets.

View leoMehlig's full-sized avatar

Leo Mehlig leoMehlig

View GitHub Profile
@leoMehlig
leoMehlig / Keyframes.swift
Created October 17, 2019 16:00
Keyframe animations in SwiftUI
//
// Keyframes.swift
// Watch Extension
//
// Created by Leo Mehlig on 17.10.19.
// Copyright © 2019 Asana Rebel GmbH. All rights reserved.
//
import SwiftUI
@leoMehlig
leoMehlig / AnyJSON.swift
Created October 18, 2017 21:13
This is a workaround to parse an generic subelement of a json object. It just parses anything it finds. Currently supports Dictionary, Array, String, Int, Double, Bool.
/// This is a workaround to parse an generic subelement of a json object. It just parses anything it finds. Currently supports Dictionary, Array, String, Int, Double, Bool.struct AnyJSON: Decodable {
enum Error: Swift.Error {
case noContainter
case noSingleValue
}
struct CodingKeys: CodingKey {
var stringValue: String
init?(stringValue: String) {
self.stringValue = stringValue
}
@leoMehlig
leoMehlig / carthage_uin.rb
Last active June 2, 2016 17:48
A ruby script that updates Carthage dependencies and only builds new ones
#!/usr/bin/env ruby
require 'pathname'
require 'fileutils'
if ARGV.first && ARGV.first.length > 0
path = Pathname.new(ARGV.first).realpath()
args = ARGV.drop(1).join(" ")
else
path = Pathname.pwd()
args = ARGV.join(" ")