Skip to content

Instantly share code, notes, and snippets.

View felipevlima's full-sized avatar
🚀

Felipe Vieira felipevlima

🚀
  • Inter Co
  • Salvador, BA
View GitHub Profile

Problema

Dado uma lista de vendas individuais é necessário saber o valor total e quantidade de produtos vendidos como o exemplo abaixo:

Entrada

[
    {
        name: 'TV 40 polegadas',
        value: 2000 
    },
 {
@felipevlima
felipevlima / GridStack.swift
Created June 21, 2021 01:00
Implementing GridStack on Swift UI
import SwiftUI
struct GridStack<Content: View>: View {
let rows: Int
let columns: Int
let content: (Int, Int) -> Content
var body: some View {
VStack {
ForEach(0..<rows) { row in
import useSWR, { ConfigInterface, responseInterface } from 'swr'
import axios, { AxiosRequestConfig, AxiosResponse, AxiosError } from 'axios'
export type GetRequest = AxiosRequestConfig | null
interface Return<Data, Error>
extends Pick<
responseInterface<AxiosResponse<Data>, AxiosError<Error>>,
'isValidating' | 'revalidate' | 'error'
> {
// Hook
import { useEffect, useState } from 'react';
const cachedScripts: any = [];
const loadingScripts: any = [];
export const useScript = (src: string) => {
// Keeping track of script loaded and error state
const [state, setState] = useState({
loaded: false,