Skip to content

Instantly share code, notes, and snippets.

Avatar
😆

Igor C. de Paula IgorDePaula

😆
View GitHub Profile
View ProductPage.js
import React from 'react'
import {Fragment, useState, useEffect} from 'react'
import {Dialog, Disclosure, Popover, RadioGroup, Tab, Transition} from '@headlessui/react'
import {MenuIcon, SearchIcon, ShieldCheckIcon, ShoppingBagIcon, XIcon} from '@heroicons/react/outline'
import {CheckIcon, ChevronDownIcon, PlusSmIcon, QuestionMarkCircleIcon, StarIcon} from '@heroicons/react/solid'
import MainLayout from "../src/Layouts/Main";
import {useTranslation} from "react-i18next";
import {API} from 'aws-amplify'
import {listColors, listSizes, listCategories} from "../src/graphql/queries";
View api-auth-nexths.js
import NextAuth from 'next-auth'
import Providers from 'next-auth/providers'
import {Auth} from 'aws-amplify'
export default NextAuth({
pages: {
error: "/login", // Changing the error redirect page to our custom login page
},
callbacks: {
async session(session, token) {
View BoletoReader.php
<?php
namespace App\Services\BankFileReaders\Itau\Retorno\Boleto;
class Boleto
{
private $file;
View AuthContext.js
import {createContext, useState} from "react";
export const AuthContext = createContext()
export const AuthProvider = ({children}) => {
const [user, setUser] = useState({})
return <AuthContext.Provider value={[user, setUser]}>
{children}
</AuthContext.Provider>
}
View git-banner
#!/bin/sh
printf '%s\n' "He he he $USER! You haven't permission to logged in this folder"
exit 128
EOF
View githook.pos-commit
#!/bin/bash
TARGET="/var/www/"
GIT_DIR="/home/{{mysqlUser}}/laravel.git"
BRANCH="master"
GREEN='\033[0;32m' # green, in true
NC='\033[0m' # No Color
BLUE='\033[0;34m'
@IgorDePaula
IgorDePaula / main.go
Created Feb 22, 2021 — forked from srbry/main.go
Golang lambda authorizer
View main.go
package main
import (
"errors"
"strings"
"github.com/aws/aws-lambda-go/events"
"github.com/aws/aws-lambda-go/lambda"
)
@IgorDePaula
IgorDePaula / colors.go
Created Jan 28, 2021 — forked from ik5/colors.go
Simple golang expirement with ANSI colors
View colors.go
package main
// http://play.golang.org/p/jZ5pa944O1 <- will not display the colors
import "fmt"
const (
InfoColor = "\033[1;34m%s\033[0m"
NoticeColor = "\033[1;36m%s\033[0m"
WarningColor = "\033[1;33m%s\033[0m"
ErrorColor = "\033[1;31m%s\033[0m"
DebugColor = "\033[0;36m%s\033[0m"
View AWSLambdaGenerateKeyPair.go
// Sample code used to generate a cryptographic key pair via an AWS Lambda function.
// (C) 2019 Nabla Zero Labs
// MIT License
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
@IgorDePaula
IgorDePaula / build.yml
Last active Jan 27, 2021
build config to github action and aws code build - images docker
View build.yml
# build docker image on github actions and push to AWS ECR
name: Build
on: [push]
jobs:
run:
runs-on: ubuntu-latest
strategy:
matrix: