Skip to content

Instantly share code, notes, and snippets.

View mran3's full-sized avatar

Andres Acevedo mran3

View GitHub Profile
@mran3
mran3 / Key Shortcuts.md
Created February 21, 2024 15:22
My common XCode Shortcuts

Replace in file: Alt + Cmd + F

@mran3
mran3 / PresentationCard.dart
Last active August 3, 2022 17:07
Gentle Introduction to Flutter tutorial for Turtle Techies
import 'package:flutter/material.dart';
void main() {
print('hello world');
runApp(
MaterialApp(
home: PresentationCard(),
debugShowCheckedModeBanner: false,
),
);
@mran3
mran3 / Cards Validator.swift
Created June 28, 2021 22:05
This example shows how to combine Structs and Protocols to make validations of the same kind but with different specific rules.
//
// Cards Validator.swift
//
//
// Created by Andres Acevedo on 28/06/21.
// This example shows how to combine Structs and Protocols to make validations of the same kind but with different specific rules.
import Foundation
/*
@mran3
mran3 / updateSwiftUIFromUIKit.swift
Created May 22, 2020 07:02
updateSwiftUIFromUIKit
import Combine
import SwiftUI
class ObservableSlider: ObservableObject {
@Published public var value: Double = 0.0
}
class YourViewController {
var observableSlider:ObservableSlider = ObservableSlider()
private var cancellables: Set<AnyCancellable> = []
@mran3
mran3 / prisonbreak.swift
Created April 21, 2020 04:54
Prison Break - HackerRank problem
//This can be done in a much simpler and efficient way, but this was my first attempt.
func prison(n: Int, m: Int, h: [Int], v: [Int]) -> Int {
// Write your code here
let row = Array(repeating: 1, count: m + 1)
var matrix : [[Int]] = Array(repeating: row , count: n + 1)
// process h bar removals
for hBar in h {
//hbar la barra que estamos quitando
@mran3
mran3 / iterateChildsInDictionaryLevelByLevel.swift
Last active April 20, 2020 18:01
Iterate thorugh folder structure printing folder names level by level
import Foundation
func traverseFoldersDict(currentFolder:String,
folders:inout [String:[String]],
currentLevel:Int) -> String {
guard let childs = folders[currentFolder] else {
return ""
}
var levelConsolidate = [String]()
var result = ""