This file contains hidden or 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 Foundation | |
class ProductsRepository { | |
func loadProducts() -> [Product]? { | |
guard let path = Bundle.main.path(forResource: "products", ofType: "json") else { | |
return nil | |
} | |
do { | |
let data = try Data(contentsOf: URL(fileURLWithPath: path)) | |
let decoder = JSONDecoder() |
This file contains hidden or 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 UIKit | |
//crie um programa que replique a sequencia de Fibonnacci | |
//fibonnacci(limit: 10) | |
var saque = 120 | |
caixa(&saque) | |
func fibonnacci(limit: Int) { | |
var prevNum = 0 |
This file contains hidden or 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
internal static class ExtensionServices | |
{ | |
public static StringContent ToJsonContent(this object obj) | |
{ | |
if (obj == null) | |
return null; | |
var json = JsonConvert.SerializeObject(obj); | |
return new StringContent(json, Encoding.UTF8, "application/json"); | |
} |
This file contains hidden or 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
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Net; | |
using System.Text; | |
namespace LibUtil | |
{ | |
public class SimpleRequest | |
{ |
This file contains hidden or 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
[ | |
{"keys": ["ctrl+alt+f"], "command": "reindent", "args": {"single_line": false}} | |
] |