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
View perfect_app_store_screenshot.sh
# The right time
xcrun simctl status_bar booted override --time 09:41
# WiFi & Cellular network
xcrun simctl status_bar booted override --dataNetwork wifi
xcrun simctl status_bar booted override --wifiBars 3
xcrun simctl status_bar booted override --cellularBars 4
# 100% battery level
xcrun simctl status_bar booted override --batteryLevel 100
View frozen_struct.swift
@frozen public struct Castillo
{
/// La propietaria del castillo
public var moradora: Princesa
/// La superficie (habitable) del castillo
public var metrosCuadrados: Int
/**
Nuevo castillo para la princesa del universo Frozen
*/
View frozen_test_with_attribute.swift
let index = Int.random(in: 0 ..< Princesa.allCases.count)
switch Princesa.allCases[index]
{
case .elsa:
print("Elsa")
case .anna:
print("Anna")
}
View frozen_enum_with_attribute.swift
@frozen public enum Princesa: CaseIterable
{
case elsa
case anna
}
View frozen_princesa_extended.swift
public enum Princesa: CaseIterable
{
case elsa
case anna
case olivia
case valeria
}
View frozen_client_1.swift
let index = Int.random(in: 0 ..< Princesa.allCases.count)
switch Princesa.allCases[index]
{
case .elsa:
print("Elsa")
case .anna:
print("Anna")
@unknown default:
print("Por si hacen Frozen 3 y aparece una nueva princesa")
@fitomad
fitomad / SwiftUI_async_image_loading.swift
Last active Aug 1, 2019
A SwiftUI example about async image loading.
View SwiftUI_async_image_loading.swift
//
// ImageLoader.swift
// DubDubKit
//
// Created by Adolfo Vera Blasco on 27/06/2019.
// Copyright © 2019 Adolfo Vera Blasco. All rights reserved.
//
#if os(macOS)
import AppKit
@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 Oct 19, 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
You can’t perform that action at this time.