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 / theme example.js
Created January 17, 2020 00:24
theme example
theme: {
screens: {
sm: '640px',
md: '768px',
lg: '1024px',
xl: '1280px',
},
colors: {
transparent: 'transparent',
black: '#000',
@brunoksato
brunoksato / after.js
Last active November 11, 2019 17:00
before and after
<html
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml"
xmlns="http://www.w3.org/TR/REC-html40">
<head></head>
<body lang=EN-US style='tab-interval:36.0pt'>
<p >&nbsp;</p>
<p >
<span style='background:yellow;mso-highlight:yellow'>Feopfjepwojfopwjefopjwe</span>
//component
<Dropzone
onDrop={async acceptedFiles => {
if (acceptedFiles.length > 1) {
toaster.warning("Limite 1 imagem");
return;
}
const files = [];
for (const file of acceptedFiles) {
@brunoksato
brunoksato / pagina.jsx
Created October 9, 2019 17:13
so pra ve
import React, { useState, useEffect } from "react";
import { toaster, Label, TextInput } from "evergreen-ui";
import ReactQuill from "react-quill";
import styled from "styled-components";
import Dropzone from "react-dropzone";
import { Formik } from "formik";
import { useStore, useActions } from "../../configureStore";
import { Upload } from "../../utils/upload";
import "../../../node_modules/react-quill/dist/quill.snow.css";
@brunoksato
brunoksato / cookie.ts
Created August 29, 2019 15:28
cookie.ts
@brunoksato
brunoksato / xd.js
Created August 27, 2019 19:24
xdxd
import React, { useEffect } from "react"
import Keycloak from 'keycloak-js';
import { KeycloakProvider } from 'react-keycloak';
import { Router } from "@reach/router"
import Home from "./index"
import Login from "./login"
import PrivateRoute from '../components/PrivateRoute'
const keycloakProviderInitConfig = {
onLoad: 'check-sso',
@brunoksato
brunoksato / upload.js
Created July 31, 2019 22:51
Upload AWS s3 in REACT
import AWS from "aws-sdk/global";
import S3 from "aws-sdk/clients/s3";
export const IMAGE_URL = `${process.env.REACT_APP_ASSETS_BUCKET}`;
export const S3_NAME = `${process.env.REACT_APP_ASSETS_BUCKET_NAME}`;
export async function Upload(folder, file) {
const creds = {
bucket: `${S3_NAME}/${folder}`,
access_key: "access_key",
@brunoksato
brunoksato / recursive ltree postgres.sql
Created June 27, 2019 04:03
recursive ltree postgres
WITH RECURSIVE c AS (
SELECT id, name, username, sponsor, parent_id, root_node_path, 0 as lvl
FROM users
WHERE id = 1 and root_node_path is not null
UNION ALL
SELECT users.id, users.name, users.username, users.sponsor, users.parent_id, users.root_node_path, c.lvl + 1 as lvl
FROM users
JOIN c ON ltree2text(subpath(users.root_node_path,nlevel(users.root_node_path)-2 ,nlevel(users.root_node_path))) = CONCAT(subpath(c.root_node_path,nlevel(c.root_node_path)-1,nlevel(c.root_node_path)),'.',users.id)
),
maxlvl AS (
@brunoksato
brunoksato / cidade-estados.js
Created November 21, 2018 20:32
cidade-estados-lodash
import _ from 'lodash';
export default function UFCityBrazilService() {
const UFCity = [
{
abbreviation: 'AC',
name: 'Acre',
city: [
'Acrelândia',
@brunoksato
brunoksato / loadbalancer-terminatehttps.config
Created September 16, 2018 19:12
loadbalancer-terminatehttps-production.config
option_settings:
aws:elb:listener:443:
ListenerProtocol: HTTPS
SSLCertificateId: arn:aws:acm:sa-east-1:890777365147:certificate/fe1ea2dc-809a-4fae-b682-beeeed806dff
InstancePort: 80
InstanceProtocol: HTTP
aws:elb:listener:80:
InstancePort: '80'
InstanceProtocol: HTTP
ListenerEnabled: 'true'