View Rename.go
package main
import (

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 8.

Install Homebrew Cask first if you haven’t:

brew update
brew tap caskroom/cask
View ChainResponsibility.playground.swift
import UIKit
class AppDelegate {
var window: UIWindow?
//Chain of Resposability: Handler
protocol ErrorHandler {
var errorHandlerSuccessor: ErrorHandler? {get}
func handleError(error: Error)
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

Async/Await for Swift


Modern Cocoa development involves a lot of asynchronous programming using closures and completion handlers, but these APIs are hard to use. This gets particularly problematic when many asynchronous operations are used, error handling is required, or control flow between asynchronous calls gets complicated. This proposal describes a language extension to make this a lot more natural and less error prone.

This paper introduces a first class Coroutine model to Swift. Functions can opt into to being async, allowing the programmer to compose complex logic involving asynchronous operations, leaving the compiler in charge of producing the necessary closures and state machines to implement that logic.

View RemoveAcentos.php
function removerAcentos( $string ) {
$mapaAcentosHex = array(
'a'=> '/[\xE0-\xE6]/',
'A'=> '/[\xE0-\xE6]/',
'e'=> '/[\xE8-\xEB]/',
'E'=> '/[\xE8-\xEB]/',
'i'=> '/[\xEC-\xEF]/',
View ios_locale_identifiers_feb2017.csv
localeIdentifier Description
eu Basque
hr_BA Croatian (Bosnia & Herzegovina)
en_CM English (Cameroon)
en_BI English (Burundi)
rw_RW Kinyarwanda (Rwanda)
ast Asturian
en_SZ English (Swaziland)
he_IL Hebrew (Israel)
ar Arabic
View emoji-console.swift
// set custom level strings to add color
let console = ConsoleDestination()
console.levelString.Verbose = "💜 VERBOSE"
console.levelString.Debug = "💚 DEBUG"
console.levelString.Info = "💙 INFO"
console.levelString.Warning = "💛 WARNING"
console.levelString.Error = "❤️ ERROR"
View stack.swift
lazy var v1:UIView = {
let v = UIView()
v.backgroundColor = .blueColor()
return v
lazy var v2:UIView = {
let v = UIView()
v.backgroundColor = .blueColor()
return v