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 / SassMeister-input-HTML.html
Created August 20, 2015 18:33
Generated by SassMeister.com.
<div class="container outline">
<div class="row">
<div class="col-1"><p>col-1</p></div>
<div class="col-1"><p>col-1</p></div>
<div class="col-1"><p>col-1</p></div>
<div class="col-1"><p>col-1</p></div>
<div class="col-1"><p>col-1</p></div>
<div class="col-1"><p>col-1</p></div>
</div>
<div class="row">
@micheltlutz
micheltlutz / SassMeister-input-HTML.html
Created August 20, 2015 19:38
Generated by SassMeister.com.
<!DOCTYPE HTML>
<html lang="pt-BR">
<head>
<title>BootStrap - Bagual</title>
<link href="assets/stylesheets/structure/grid.css" rel="stylesheet">
</head>
<body>
<!--
@micheltlutz
micheltlutz / SassMeister-input-HTML.html
Created August 20, 2015 20:05
Generated by SassMeister.com.
<!DOCTYPE HTML>
<html lang="pt-BR">
<head>
<title>BootStrap - Bagual</title>
<link href="assets/stylesheets/structure/grid.css" rel="stylesheet">
</head>
<body>
<!--
@micheltlutz
micheltlutz / addEventListener-polyfill.js
Created February 12, 2016 17:35 — forked from eirikbacker/addEventListener-polyfill.js
addEventListener polyfill for IE6+
//addEventListener polyfill 1.0 / Eirik Backer / MIT Licence
(function(win, doc){
if(win.addEventListener)return; //No need to polyfill
function docHijack(p){var old = doc[p];doc[p] = function(v){return addListen(old(v))}}
function addEvent(on, fn, self){
return (self = this).attachEvent('on' + on, function(e){
var e = e || win.event;
e.preventDefault = e.preventDefault || function(){e.returnValue = false}
e.stopPropagation = e.stopPropagation || function(){e.cancelBubble = true}
@micheltlutz
micheltlutz / String+Currency.swift
Last active August 10, 2017 20:11
Swift 3 String Extensions
import Foundation
extension String
{
/**
* Return formated currency string by locale with or not round
* @see https://developer.apple.com/documentation/foundation/numberformatter, https://developer.apple.com/documentation/foundation/numberformatter.style
* @return String if problem on format return string ""
*/
func toCurrency(localeItendifier: String = "pt_BR", withRound: Bool = false) -> String{
@micheltlutz
micheltlutz / DoubleExtensions.swift
Created August 10, 2017 14:03
Swift 3 Double Extensions
extension Double
{
/**
* Calc Celcius to Fahrenheit
* @return Double value in Fahrenheit
*/
func celsiusToFahrenheit() -> Double
{
return self * 9 / 5 + 32
}
@micheltlutz
micheltlutz / Picker.swift
Created October 31, 2017 04:18 — forked from loganwright/Picker.swift
Swift Generic UIPickerView
class PickerSource : NSObject, UIPickerViewDelegate, UIPickerViewDataSource {
var data: [[String]] = []
var selectionUpdated: ((component: Int, row: Int) -> Void)?
// MARK: UIPickerViewDataSource
func numberOfComponentsInPickerView(pickerView: UIPickerView) -> Int {
return data.count
}
@micheltlutz
micheltlutz / SimplePickerView.swift
Last active October 31, 2017 04:20 — forked from natecook1000/SimplePickerView.swift
Simple UIPickerView subclass upgrade for swift 4
import UIKit
class SimplePickerView : UIPickerView {
class SimplePickerViewModel : NSObject, UIPickerViewDelegate, UIPickerViewDataSource {
var titles: [String]
var selectionHandler: ((_ pickerView: UIPickerView, _ row: Int, _ title: String) -> ())?
init(titles: [String], selectionHandler: ((_ pickerView: UIPickerView, _ row: Int, _ title: String) -> ())? = nil) {
@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):

@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