Skip to content

Instantly share code, notes, and snippets.

:octocat:
Swift + Machine Learning + Big Data

Adolfo fitomad

:octocat:
Swift + Machine Learning + Big Data
Block or report user

Report or block fitomad

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@fitomad
fitomad / urlsession+combine_delay_retry.swift
Created Jun 21, 2019
Beta version of an URLSession + Combine that detected a 429 HTTP error (rate limit) then delay N seconds and retry.
View urlsession+combine_delay_retry.swift
/**
URL HTTP request to a server with a
3 request per 10 seconds rate limit.
Thanks to combine it's super easy detected
rate limit and retry after N seconds.
This is a *beta* version.
Things TO-DO...
@fitomad
fitomad / SwiftUI-flip-animation.swift
Last active Jun 20, 2019
A SwiftUI animation that represents a flip view to show Q&A cards.
View SwiftUI-flip-animation.swift
//: A UIKit based Playground for presenting SwiftUI based user interface
// by @fitomad
import UIKit
import SwiftUI
import PlaygroundSupport
// MARK: - Contenedor Principal -
public struct Container: View
@fitomad
fitomad / swiftui_shadow_and_border.swift
Last active Jun 24, 2019
Testing SwiftUI. Adding shadow and corner radius to a View. Strange behavior depending on View background color
View swiftui_shadow_and_border.swift
//: A UIKit based Playground for playing with SwiftUI
// @fitomad
import UIKit
import SwiftUI
import PlaygroundSupport
struct RoundedShadowView: View
{
var body: some View
View collection_isFilled.swift
extension Collection
{
/// Ask in a *positive way *
/// if a collection is **not** empty
var isFilled: Bool
{
return !self.isEmpty
}
}
@fitomad
fitomad / URL+QR.swift
Created Mar 29, 2019
URL extension to generate a QR code from the URL itself. Ready for Swift 5
View URL+QR.swift
//
// URL+QR.swift
// URL extension to generate QR code from an URL
//
// Created by Adolfo Vera Blasco on 29/03/2019.
// Copyright © 2019 Adolfo Vera Blasco. All rights reserved.
//
import UIKit
import CoreImage
View turicreate_web.config.xml
<!-- web.config ASP.NET // IIS -->
<configuration>
<system.webServer>
<directoryBrowse enabled="true" />
<staticContent>
<clear />
<mimeMap fileExtension="*" mimeType="application/octet-stream" />
</staticContent>
</system.webServer>
</configuration>
View generic-codable-decoder.swift
import Foundation
//
// MODEL
//
public struct Show: Codable
{
public var name: String
public var network: String
View ultimate_interview_code_review_never_and_ever.swift
import Foundation // Always import Foundation, no matter what you're developing
public struct Interview // Use structs, Apple loves structs, then me too. Why? Cause Apple love structs.
{
// ¡Oh fortuna! ¿por qué eres tan esquiva conmigo? (Yes, spanish too)
private var result: Bool
/// Human readable result.
public var resultMessage: String
{
View queue-playground.swift
import Foundation
public struct Queue<Element>
{
private var storage: [Element]
public init()
{
self.storage = [Element]()
@fitomad
fitomad / stack-playground.swift
Created May 17, 2018
Swift Stack Data Structure
View stack-playground.swift
import Foundation
public struct Stack<Element>
{
private var storage: [Element]
public init()
{
self.storage = [Element]()
}
You can’t perform that action at this time.