Skip to content

Instantly share code, notes, and snippets.

View anettodev's full-sized avatar
👨‍💻

Antonio Netto anettodev

👨‍💻
View GitHub Profile
@anettodev
anettodev / wwdc16_Announcements_list.txt
Last active July 5, 2016 20:24
WWDC16 - List of iOS Sessions
// ---------------------------------------------------
// List of iOS announcements at WWDC'16
// ---------------------------------------------------
[New APIs]
217 - Introducing SiriKit
237 - Getting Started with CareKit
509 - Speech Recognition API
707 - Introduction to Notifications
guerra da criptografia - década de 90 até 2000
http://g1.globo.com/tecnologia/blog/seguranca-digital/post/fbi-x-apple-nova-guerra-da-criptografia-chega-aos-tribunais.html
caso iPhone do atirador Syed Rizwan Farook
Carta publica apple
Antes das revelações de Edward Snowden, a Apple cooperava com o governo
O FBI quer que a Apple retire o limite de tentativas de senha
FBI tenta convencer o Congresso norte-americano a mudar a legislação e exigir que fabricantes de celulares coloquem uma "porta dos fundos"
"Os ataques sempre ficam mais fáceis. A tecnologia amplia as capacidades e o que era difícil ontem torna-se fácil amanhã. Os programas ultrassecretos da Agência Nacional de Segurança dos Estados Unidos (NSA) são as teses de doutorado de amanhã e ferramentas de hackers no dia seguinte" - Bruce Schneier
"é bem provável que o iPhone do atirador não tenha nenhuma evidência nova" - Jonathan Zdziarski
@anettodev
anettodev / SumInt.swift
Last active April 8, 2019 17:10
simple integers sum() function in swift
// Sum 2 Int elements
func sum(x: Int, y: Int) -> Int {
return x + y
}
// Sum 2 Numeric elements
func sum<T: Numeric>(x: T, y: T) -> T {
return x + y
}
sum(3, 4.5) // result 7.5
// Custom Protocol
protocol CustomAddable {
static func +(lhs: Self, rhs: Self) -> Self
}
// Sum 2 Numeric elements
func sum<T: CustomAddable>(x: T, y: T) -> T {
return x + y
}
// extending to work with the Custom Protocol
extension Int: CustomAddable {}
// Orders Protocol
protocol Orders {
associatedtype Item
func enqueue(item:Item)
func dequeue() -> Item?
func showCurrentQueue() -> [Item]
}
// RestaurantOrders class
class RestaurantOrders<Item>: Orders {
var items : [Item] = [Item]()
enum SimpleMenu {
case fries
case burger
case xBurger
case hotdog
}
let ordersQueue = RestaurantOrders<SimpleMenu>()// This instance only accept SimpleMenu Items
ordersQueue.enqueue(item: .hotdog)
ordersQueue.enqueue(item: .fries)
ordersQueue.enqueue(item: .xBurger)
enum ItalianMenu {
case penne
case ravioli
case lasagna
}
let italianOrdersQueue = RestaurantOrders<ItalianMenu>()// instance with ItalianMenu Items
italianOrdersQueue.enqueue(item: .penne)
italianOrdersQueue.enqueue(item: .lasagna)
print(italianOrdersQueue.showCurrentQueue()) // [.penne, .lasagna]
@anettodev
anettodev / HTTPStatusCode.swift
Created July 29, 2019 18:42 — forked from ollieatkinson/HTTPStatusCode.swift
HTTP status codes as a Swift enum.
/// This is a list of Hypertext Transfer Protocol (HTTP) response status codes.
/// It includes codes from IETF internet standards, other IETF RFCs, other specifications, and some additional commonly used codes.
/// The first digit of the status code specifies one of five classes of response; an HTTP client must recognise these five classes at a minimum.
enum HTTPStatusCode: Int, Error {
/// The response class representation of status codes, these get grouped by their first digit.
enum ResponseType {
/// - informational: This class of status code indicates a provisional response, consisting only of the Status-Line and optional headers, and is terminated by an empty line.
case informational
[user]
name = Antonio Netto
email = tonis.04@gmail.com
[core]
excludesfile = /Users/anetto/.gitignore_global
editor = atom
ignorecase = false
[web]
browser = google-chrome
[color]