Skip to content

Instantly share code, notes, and snippets.

View IgorDePaula's full-sized avatar
😆

Igor C. de Paula IgorDePaula

😆
View GitHub Profile
@IgorDePaula
IgorDePaula / main.go
Created February 22, 2021 16:56 — forked from srbry/main.go
Golang lambda authorizer
package main
import (
"errors"
"strings"
"github.com/aws/aws-lambda-go/events"
"github.com/aws/aws-lambda-go/lambda"
)
@IgorDePaula
IgorDePaula / colors.go
Created January 28, 2021 11:39 — forked from ik5/colors.go
Simple golang expirement with ANSI colors
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"
@IgorDePaula
IgorDePaula / AWSLambdaGenerateKeyPair.go
Created January 28, 2021 03:06 — forked from arrieta/AWSLambdaGenerateKeyPair.go
AWS Lambda Generate Key Pair (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 January 27, 2021 02:25
build config to github action and aws code build - images docker
# build docker image on github actions and push to AWS ECR
name: Build
on: [push]
jobs:
run:
runs-on: ubuntu-latest
strategy:
matrix:
@IgorDePaula
IgorDePaula / Random-string
Created January 20, 2021 03:33 — forked from 6174/Random-string
Generate a random string in JavaScript In a short and fast way!
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
<template>
<div class="btn-classic">
oid
</div>
</template>
<script>
export default {
name: "Click"
}
@IgorDePaula
IgorDePaula / Rabbitmq.php
Last active January 12, 2021 12:47
Rabbitmq service
<?php
namespace App\Services;
use PhpAmqpLib\Connection\AMQPStreamConnection;
use PhpAmqpLib\Message\AMQPMessage;
class Rabbitmq
@IgorDePaula
IgorDePaula / DockerFileEchoServer
Last active April 4, 2023 01:20
Laravel com redis e laravel-echo-server
# .docker/echo/Dockerfile
FROM node:erbium-alpine3.10
RUN npm install -g laravel-echo-server
RUN mkdir -p /var/www
WORKDIR /var/www
EXPOSE 6001
RUN ls /var/www
ENTRYPOINT laravel-echo-server start
@IgorDePaula
IgorDePaula / laravel.json
Last active December 27, 2020 22:31
Packer file to laravel on digital ocean
{
"variables": {
"do_api_token": "*******"
},
"builders": [
{
"type": "digitalocean",
"api_token": "{{user `do_api_token`}}",
"image": "ubuntu-20-04-x64",
"region": "nyc3",
<?php
$items = [];
foreach ($products as $value) {
$items[] = [
'product_id' => $value->id,
'name' => $value->name,
];
}
return collect($items)->all();