Skip to content

Instantly share code, notes, and snippets.

View gilluan's full-sized avatar
🎯
Focusing

Gilluan Dutra Formiga Sousa gilluan

🎯
Focusing
  • amplisaas.com
  • Sweden
View GitHub Profile
@gilluan
gilluan / serverless-function-reference-formats.yml
Created March 2, 2023 08:08 — forked from DavidWells/serverless-function-reference-formats.yml
Various ways to reference function name and ARN in serverless.yml
function:
foo:
handler: index.handler
# Ways to reference function in serverless.yml
FunctionName: !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:${self:service.name}-${self:provider.stage}-foo
FunctionName: !GetAtt FooLambdaFunction.Arn
FunctionName: !Sub "${AWS::StackName}-foo"
FunctionName: ${self:service.name}-${self:provider.stage}-foo
@gilluan
gilluan / examples_ecs_jq.sh
Last active August 1, 2020 03:31
Aws ecs with jq
#service-name=$(aws ecs list-services --cluster $CLUSTER_NAME --profile 2cloudb | jq -r '.serviceArns | map(. | select(. | contains("React")))[0] | split("/")[1]')
ALL_SERVICES=$(aws ecs list-services --cluster $CLUSTER_NAME --profile 2cloudb | jq -r '.serviceArns | map(. | split("/")[1]) | @sh')
#SERVICE_BY_NAME=$(aws ecs list-services --cluster $CLUSTER_NAME --profile $PROFILE_AWS | jq -r --arg name "$1" '.serviceArns | map(. | select(. | ascii_downcase | contains($name)))[0] | split("/")[1]');
for SERVICE in $ALL_SERVICES; do
echo "Atualizando o Service: ${SERVICE//\'/}"
PARSED_SERVICE=${SERVICE//\'/}
aws ecs update-service --cluster immail1 --service $PARSED_SERVICE --force-new-deployment --profile $PROFILE_AWS &
@gilluan
gilluan / prebuild.js
Created December 3, 2018 21:38
lib to create angular environment files.
#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
const ejs = require('ejs');
/**
*
* Cria os arquivos de environment a partir de variáveis de ambiente
@gilluan
gilluan / destructuring.js
Created March 19, 2018 04:15 — forked from mikaelbr/destructuring.js
Several demos and usages for ES6 destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
@gilluan
gilluan / queryExample.js
Created February 12, 2018 15:22
queryParams and isEmpty
(() => {
let queryParam = new URLSearchParams();
let objTeste = {
name: "gilluan",
age: "idade"
}
const isObjectEmpty = (obj) => {
return !obj[Object.keys(obj)[0]];
import React from "react";
import Route from "react-router-dom/Route";
import Redirect from "react-router-dom/Redirect";
import { connect } from "react-redux";
import withRouter from "react-router-dom/withRouter";
import { verifyToken } from '../actions/index'
class PrivateRouteContainer extends React.Component {
componentDidMount() {
import React, { Component} from "react";
import { withFormik, Field } from "formik";
import Yup from "yup";
import FlatButton from "material-ui/FlatButton";
import TextField from 'material-ui/TextField'
import SelectField from 'material-ui/SelectField'
import MenuItem from 'material-ui/MenuItem'
const CustomInputComponent = ({
field,