Firstly install Brew on your MAC
- ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Then install PHP
- brew update
- brew tap homebrew/dupes
- brew tap homebrew/php
- brew install php56
Firstly install Brew on your MAC
Then install PHP
extension String { | |
var isCPF: Bool { | |
let cpf = self.stringByReplacingOccurrencesOfString(".", withString: "").stringByReplacingOccurrencesOfString("-", withString: "") | |
if cpf.characters.count == 11 { | |
let d1 = Int(cpf.substringWithRange(Range(cpf.startIndex.advancedBy(9) ..< cpf.startIndex.advancedBy(10)))) | |
let d2 = Int(cpf.substringWithRange(Range(cpf.startIndex.advancedBy(10) ..< cpf.startIndex.advancedBy(11)))) |
// | |
// WatchSessionManager.swift | |
// WatchConnectivityDemo | |
// | |
// Created by Natasha Murashev on 9/3/15. | |
// Copyright © 2015 NatashaTheRobot. All rights reserved. | |
// | |
import WatchConnectivity |
# remove specific file from git cache | |
git rm --cached filename | |
# remove all files from git cache | |
git rm -r --cached . | |
git add . | |
git commit -m ".gitignore is now working" |
// #!Swift-1.1 | |
import Foundation | |
// MARK: - (1) classes | |
// Solution 1: | |
// - Use classes instead of struct | |
// Issue: Violate the concept of moving model to the value layer | |
// http://realm.io/news/andy-matuschak-controlling-complexity/ |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
package com.sjl.util; | |
import android.app.Activity; | |
import android.app.Application; | |
import android.content.Context; | |
import android.os.Bundle; | |
import android.os.Handler; | |
import android.util.Log; | |
import java.util.List; |