Skip to content

Instantly share code, notes, and snippets.

🎧

Michel Anderson Lütz Teixeira micheltlutz

🎧
Block or report user

Report or block micheltlutz

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
@micheltlutz
micheltlutz / gist:dec1130f2d33686d468329126cdb685a
Created Apr 1, 2020 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup
View gist:dec1130f2d33686d468329126cdb685a

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@micheltlutz
micheltlutz / pre-commit
Created Mar 24, 2020 — forked from milankamilya/pre-commit
pre-commit git hook for iOS projects
View pre-commit
#----------------------------------------------------------------
# PREVENT YOUR CODEBASE GETTING SPOILED BY DEVELOPERS
# - YOU NEED TO THIS pre-commit file (without any extension)
# at ".git/hooks/" folder.
# - THEN TRY TO PUT WRONG STYLED/LINT CODE
#----------------------------------------------------------------
branch="$(git rev-parse --abbrev-ref HEAD)"
#----------------------------------------------------------------
@micheltlutz
micheltlutz / MyreplacingOccurrences.swift
Created Apr 16, 2019
Replacing Multiple Occurrences
View MyreplacingOccurrences.swift
import Foundation
let texto = "Bem-[sexo:vindo,vinda] à aventura de viver a vida sendo você [sexo:mesmo,mesma], a partir de um espaço de liberdade, de escolhas e de possibilidades!"
protocol FilterTagProtocol {
var pattern: String { get }
}
struct FilterTagManager {
enum FiltersTexts: String, CaseIterable, FilterTagProtocol {
case gender = "\\[sexo:([^]]*)\\]"
case name = "\\[nome\\]"
@micheltlutz
micheltlutz / Border in TableView Sections
Last active Mar 28, 2020
Apply border around tableView Sections
View Border in TableView Sections
/**
Extension for UITableViewController or UIViewController as you prefer
*/
extension UITableViewController {
func colorSection(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
let cornerRadius: CGFloat = 0.0
cell.backgroundColor = UIColor.clear
let layer: CAShapeLayer = CAShapeLayer()
let pathRef: CGMutablePath = CGMutablePath()
//dx leading an trailing margins
@micheltlutz
micheltlutz / Gradient_border_button.md
Created Nov 20, 2018 — forked from nguyentruongky/Gradient_border_button.md
A library to create gradient border button
View Gradient_border_button.md

How to draw a gradient border button?

My Problem

Last week, my partner showed me his design for our application. Everything is great, easily implemented with some custom controls. But wait, something is not in my knowledge.

A button with gradient border. Never try it before. Up to now, I just created gradient background views 2 times in previous projects. Googled and found some good results.

View git-tag-delete-local-and-remote.sh
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@micheltlutz
micheltlutz / TimeStampToDate.swift
Created Sep 3, 2018
Create Date from TimeStemp String
View TimeStampToDate.swift
func formatterDate(stringDate: String) -> Date? {
let formatter = DateFormatter()
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSSxxxxx"
formatter.timeZone = Calendar.current.timeZone
formatter.locale = Calendar.current.locale
guard let newDate = formatter.date(from: stringDate) else { return nil }
return newDate
}
let stringDate = formatterDate(stringDate: "2018-08-30T15:26:27.357902-03:00")
print(stringDate)
View StringDynamicParameterVariable.swift
var str = "Hello %@, welcome to playground"
let tvar = String(format: NSLocalizedString(str, comment: "%@"), "Mike")
print(tvar)
@micheltlutz
micheltlutz / SorteioDeNomes
Created Aug 31, 2018
Sorteador criado durante a CocoaHeads POA Agosto 2018 para sortear brindes.
View SorteioDeNomes
var convidados: [String] = []
convidados.append("Michel")
convidados.append("Karen")
convidados.append("Simba")
convidados.append("Oliver")
convidados.append("Thales")
convidados.append("Ricardo")
var randomNum = arc4random_uniform(UInt32(convidados.count))
print("Sorteio CocoaHeads POA Agosto 2018 \n\n")
var str = "O(A) Vencedor(a) é >> \(convidados[Int(randomNum)]) <<"
@micheltlutz
micheltlutz / UIControl+ListenBlock.swift
Created May 18, 2018 — forked from PEZ/UIControl+ListenBlock.swift
Swift3 UIControl extension for adding block event listeners. Adapted from: https://stackoverflow.com/a/44917661/44639
View UIControl+ListenBlock.swift
import Foundation
import UIKit
extension UIControl {
func listen(_ action: @escaping () -> (), for controlEvents: UIControlEvents) -> AnyObject {
let sleeve = ClosureSleeve(attachTo: self, closure: action, controlEvents: controlEvents)
addTarget(sleeve, action: #selector(ClosureSleeve.invoke), for: controlEvents)
return sleeve
}
You can’t perform that action at this time.