Skip to content

Instantly share code, notes, and snippets.

View brunoksato's full-sized avatar
Focusing

Bruno Sato brunoksato

Focusing
View GitHub Profile
@brunoksato
brunoksato / deletes3.go
Created June 29, 2023 16:51
deletes3.go
package main
import (
"errors"
"fmt"
"net/http"
"os"
"strings"
"time"
package main
import (
"fmt"
"os"
"strings"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
@brunoksato
brunoksato / newsDetail.tsx
Created April 26, 2022 15:59
newsDetail.tsx
import { Dialog } from 'evergreen-ui';
interface INewsDetail {
isShown: boolean;
onClose: any;
data: any;
}
const NewsDetail = ({ isShown, onClose, data }: INewsDetail) => {
const setTextTypes = (child, child_idx, array) => {
@brunoksato
brunoksato / test.tsx
Created January 20, 2022 17:30
next image responsive
import styled from "styled-components";
import Image from "next/image"
type Props = {
title: string;
}
export default function BannerSobreNos({ title }: Props) {
return (
<main>
@brunoksato
brunoksato / connect.js
Created August 26, 2020 13:40
Cache mongo serverless
mongoose.Promise = global.Promise;
let cache = null;
const connect = async (database) => {
if (cache) {
logger.info('[DATABASE] Using cache');
return Promise.resolve(cache);
}
@brunoksato
brunoksato / UsersList.tsx
Created July 15, 2020 16:34
hooks + axios + react
import useDataApi from "../../hooks/useDataApi";
import { userService } from "./api/action";
const UsersList = () => {
const { data, loading, error } = useDataApi(userService.list, []);
if (loading) {
return (
<>
<p>Loading...</p>
@brunoksato
brunoksato / dolar1sec.csv
Created June 22, 2020 00:53
dolar1sec.csv
time open high low close volume volumeMA
1592323200.001 94230 94260 94230 94260 89.5 244.76999999999944
1592323260 94230 94230 94200 94200 20.8 243.56999999999942
1592323260.001 94200 94200 94170 94170 20.8 242.36999999999944
1592323260.002 94170 94170 94140 94140 20.8 241.16999999999945
1592323260.003 94140 94140 94110 94110 20.8 149.90999999999946
1592323260.004 94110 94110 94080 94080 20.8 120.99999999999946
1592323440 94110 94140 94110 94140 379 110.69999999999945
1592323500 94110 94110 94080 94080 68 107.14999999999945
1592323860 94110 94140 94060 94140 577 115.79999999999946
time open high low close volume volumeMA
1591106400 5276 5277 5268.5 5273.5 57857 42831.65
1591106700 5273.5 5275 5266 5267 35026 41934.9
1591107000 5267 5268 5258 5264.5 55046 42325.9
1591107300 5264 5265 5255 5255.5 33245 42392.05
1591107600 5255.5 5257.5 5248.5 5251.5 46470 41793.4
1591107900 5251.5 5259.5 5251 5253.5 30250 40990.9
1591108200 5253 5255.5 5241.5 5250.5 62253 42376.4
1591108500 5250.5 5256.5 5247.5 5252.5 27759 42609.3
1591108800 5252.5 5255.5 5246 5253.5 32077 41409.85
@brunoksato
brunoksato / example.go
Last active May 20, 2020 22:42
manytomany gorm
//struct channel
type Channel struct {
ID uint `json:"id" gorm:"primary_key" settable:"false"`
Title string `json:"t" sql:"not null"`
RelatedSets []Set `json:"rs,omitempty" gorm:"many2many:related_sets;"`
}
//struct Set
@brunoksato
brunoksato / example.go
Created May 20, 2020 22:41
manytomany gorm
//struct channel
type Channel struct {
Title string `json:"t" sql:"not null"`
RelatedSets []Set `json:"rs,omitempty" gorm:"many2many:related_sets;"`
}
//struct Set
type Set struct {