This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node --use-strict --harmony | |
if ('function' === typeof Map) { | |
console.log("ES6 Console Sucess!"); | |
} else { | |
throw new Error("ES6 is required; add --harmony"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import CoreTelephony | |
var phoneInfo = CTTelephonyNetworkInfo() | |
var phoneCarrier = phoneInfo.subscriberCellularProvider | |
println(phoneCarrier) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol ExcutableQueue { | |
var queue: dispatch_queue_t { get } | |
} | |
extension ExcutableQueue { | |
func execute(closure: () -> Void) { | |
dispatch_async(queue, closure) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func generateHigherInteger(number:Int) -> Int { | |
let siblingsStr = String(number).characters.map { String($0) } | |
let bigSibling = siblingsStr.sort(>).reduce("", combine:+) | |
return Int(bigSibling) ?? number | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// CURLDebug.swift | |
// | |
// Created by apple on 02/06/16. | |
// Copyright © 2016 Rodrigo Reis. All rights reserved. | |
// | |
import Foundation | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: Playground - noun: a place where people can play | |
import UIKit | |
import XCPlayground | |
enum CellData<A, B, C> { | |
case Number(A) | |
case Name(B) | |
case Money(C) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Include this in AppDelegate | |
if let window = window where NSProcessInfo.processInfo().arguments.contains("UITestRun") { | |
FlowTestRouter.selectRoute(window, routes: NSProcessInfo.processInfo().arguments) | |
return true | |
} | |
import UIKit | |
class FlowTestRouter { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
until $(curl -v --header "SessionToken: 16676855" https://chat-esd-dev.appls.cmpn.paas.gsnetcloud.corp/chat/reasons/0001/permissions\?app\=00); do | |
osascript -e 'display notification "Não funcionou o serviço"' | |
printf 'Waiting 240 seconds ....................................... ' | |
sleep 240 | |
done | |
osascript -e 'display notification "Funcionou o serviço"' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CircularQueue<T> : IteratorProtocol, RandomAccessCollection { | |
typealias Element = T | |
public typealias Index = Int | |
public typealias Indices = CountableRange<Int> | |
var position = 0 | |
let items : [T] | |
init(items:[T]){ | |
self.items = items |
OlderNewer