Skip to content

Instantly share code, notes, and snippets.

View micheltlutz's full-sized avatar
🎧

Michel Anderson Lütz Teixeira micheltlutz

🎧
View GitHub Profile
@micheltlutz
micheltlutz / Gradient_border_button.md
Created November 20, 2018 20:45 — forked from nguyentruongky/Gradient_border_button.md
A library to create gradient border button

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.

@micheltlutz
micheltlutz / git-tag-delete-local-and-remote.sh
Created November 1, 2018 16:46 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
# 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 September 3, 2018 17:17
Create Date from TimeStemp String
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)
@micheltlutz
micheltlutz / StringDynamicParameterVariable.swift
Created September 3, 2018 11:50
String Dynamic Parameter variable
var str = "Hello %@, welcome to playground"
let tvar = String(format: NSLocalizedString(str, comment: "%@"), "Mike")
print(tvar)
@micheltlutz
micheltlutz / SorteioDeNomes
Created August 31, 2018 11:25
Sorteador criado durante a CocoaHeads POA Agosto 2018 para sortear brindes.
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 17:15 — forked from PEZ/UIControl+ListenBlock.swift
Swift3 UIControl extension for adding block event listeners. Adapted from: https://stackoverflow.com/a/44917661/44639
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
}
@micheltlutz
micheltlutz / Rename.go
Last active March 28, 2018 12:20
Renomear arquivos removendo acento e espaço - GO
package main
import (
"fmt"
"io/ioutil"
"log"
"os"
"unicode"
"golang.org/x/text/transform"
@micheltlutz
micheltlutz / gist:db0116041c48d3d0d3643c7f046fa061
Created February 26, 2018 17:18 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@micheltlutz
micheltlutz / install-multiple-jdk-on-macos-high-sierra.md
Last active January 30, 2018 17:25 — forked from ntamvl/install-multiple-jdk-on-macos-high-sierra.md
Install Multiple Java Versions on macOS High Sierra

Install Multiple Java Versions on macOS High Sierra

Install Homebrew Cask

On Mac, Homebrew is the de-facto package manager, and Homebrew Cask is the app manager. I’m going to use Cask to install Java 7 and 9.

Install Homebrew Cask first if you haven’t:

brew update
brew tap caskroom/cask
@micheltlutz
micheltlutz / macosx-install-php-oracle-oci8-pdo_oci.md
Created January 30, 2018 11:50 — forked from krisanalfa/macosx-install-php-oracle-oci8-pdo_oci.md
Install OCI8 and / or PDO_OCI on OSX via Brew

Installation

This procedure is tested on Mac OS X 10.10.5 with Developpers tools installed (xCode).

PHP 5.6 installed with Homebrew.

Preparation

Download the following files from Oracle website (yes, you need to create an account and accept terms):