Skip to content

Instantly share code, notes, and snippets.

View luizdias's full-sized avatar
🎯
Focusing

Luiz Fernando Dias luizdias

🎯
Focusing
View GitHub Profile
@luizdias
luizdias / launch.json
Created October 7, 2020 23:16
Launch for debugging Deno project using VSCode
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Deno",
"type": "pwa-node",
"request": "launch",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "deno",
"runtimeArgs": [
// First create a dic with attributes you want to customize,
// then set text attributes to segmented control.
NSDictionary *attributes = @{ NSFontAttributeName : [UIFont fontWithName:@"HelveticaNeue-Light" size:17] };
[segmentedControl setTitleTextAttributes:attributes forState:UIControlStateNormal];
@luizdias
luizdias / JSONEncoding.swift
Created November 25, 2019 17:26
JSONEncoding in swift
//
// JSONEncoding.swift
//
// Created by Luiz Fernando Aquino Dias on 13/04/19.
// Copyright © 2019 Luiz Fernando Aquino Dias. All rights reserved.
//
import Foundation
public struct JSONParameterEncoder: ParameterEncoder {
@luizdias
luizdias / URLEncoding.swift
Created November 25, 2019 17:25
URLEncoding in swift
//
// URLEncoding.swift
//
// Created by Luiz Fernando Aquino Dias on 13/04/19.
// Copyright © 2019 Luiz Fernando Aquino Dias. All rights reserved.
//
import Foundation
public struct URLParameterEncoder: ParameterEncoder {
@luizdias
luizdias / ParameterEncoding.swift
Created November 25, 2019 17:25
ParameterEncoding in swift
//
// ParameterEncoding.swift
//
// Created by Luiz Fernando Aquino Dias on 13/04/19.
// Copyright © 2019 Luiz Fernando Aquino Dias. All rights reserved.
//
import Foundation
public typealias Parameters = [String:Any]
@luizdias
luizdias / EndPointType.swift
Created November 25, 2019 17:24
EndPoint type in swift
//
// EndPointType.swift
//
// Created by Luiz Fernando Aquino Dias on 13/04/19.
// Copyright © 2019 Luiz Fernando Aquino Dias. All rights reserved.
//
import Foundation
protocol EndPointType {
@luizdias
luizdias / Router.swift
Created November 25, 2019 17:23
Network Router in swift
//
// Router.swift
//
// Created by Luiz Fernando Aquino Dias on 13/04/19.
// Copyright © 2019 Luiz Fernando Aquino Dias. All rights reserved.
//
import Foundation
public typealias NetworkRouterCompletion = (_ data: Data?,_ response: URLResponse?,_ error: Error?)->()
@luizdias
luizdias / HTTPMethod.swift
Created November 25, 2019 17:23
HTTPMethods in swift
//
// HTTPMethod.swift
//
// Created by Luiz Fernando Aquino Dias on 13/04/19.
// Copyright © 2019 Luiz Fernando Aquino Dias. All rights reserved.
//
import Foundation
public enum HTTPMethod : String {
@luizdias
luizdias / HTTPTask.swift
Created November 25, 2019 17:22
HTTPTask in swift
//
// HTTPTask.swift
//
// Created by Luiz Fernando Aquino Dias on 13/04/19.
// Copyright © 2019 Luiz Fernando Aquino Dias. All rights reserved.
//
import Foundation
public typealias HTTPHeaders = [String:String]
@luizdias
luizdias / EndPoint.swift
Last active November 25, 2019 17:27
EndPoint definition in swift
//
// EndPoint.swift
//
// Created by Luiz Fernando Aquino Dias on 13/04/19.
// Copyright © 2019 Luiz Fernando Aquino Dias. All rights reserved.
//
import Foundation
enum NetworkEnvironment {