# Utilitários

Aqui estão algumas ferramentas, técnicas, ideias e qualquer outra coisa que possa ser util no dia a dia =)

## Tools

### [ray.so](https://ray.so/)

Sabe quando você precisa colocar algum exemplo de código em documentações ou apresentações?

Você pode usar esta tool para gerar a imagem dos seus snippets =).

### [sli.dev](https://sli.dev/)

Nada melhor que criar apresentações *as code*!

O Slidev é feito com Vite e Vue, permite customização, criação de componentes reutilizáveis e layouts.

### [CyberChef](https://gchq.github.io/CyberChef/)

Este site é uma coleção de utilitários para sec.

Funciona assim: você monta tipo um *pipeline*, colocando funções como *encoding* e *hashing*, depois coloca um *input* e ele gera o output baseado no pipeline.

### [it-tools](https://it-tools.tech/)

Aqui você tem acesso à uma porrada de geradores, conversores, formatters, etc.

Geração de UUID, chaves de criptografia, hashing, etc.

### [Mermaid Live](https://mermaid.live/)

Se você já precisou gerar algum workflow usando o *draw\.io* por exemplo, seria muito bom ter isso *as code* não?

Pois então... Agora você pode ter tudo isso codável, compartilhável e editável =).

### [Typer](https://typer.tiangolo.com/)

Se você precisa construir uma ferramenta de linha de comando e sabe python, esse carinha aqui vai ajudar MUITO =).

### [Cheat.sh](https://github.com/chubin/cheat.sh)

Cheat-Sheet de linha de comando que tem mais de 50 linguagens.

O mais legal é que funciona direto no terminal via `curl`.

{% code title="Command" %}

```bash
curl cht.sh/python/lambda
```

{% endcode %}

{% code title="Output" %}

```py
# Lambda are anonymous functions in Python by using the keyword lambda
# Therefore they are not bound to a name

# Simple Lambda Function
a = lambda parameter: parameter + 40
#
print (a(2))                    # Outputs 42

# Lambda Functions Inside Real Functions
def subtract_func(n) :
    return lambda x: x - n
#
a = subtract_func(1)            # Sets n to 1 for a
b = subtract_func(2)            # Sets n to 2 for b
#
print(a(-4))                    # Outputs -5 ( -5 = -4 - 1 )
print(b(-2))                    # Outputs -4 ( -4 = -2 - 2 )

# Lambda Function with Multiple Parameters
f = lambda x, y : x + y
#
print( f(1,1) )                 # Outputs 2 ( 1 + 1 )

# map() + lambda functions
a = [1, 2, 3, 4, 5]
b = [1, 2, 3, 4, 5]
#
r = map(lambda x,y : x+y, a,b)  # map() will return an iterator
r_list = list(r)                # listify r
print(r_list)                   # prints [2, 4, 6, 8, 10]

# filter() + lambda functions
# Program to filter out only the even items from a list
my_list = [1, 5, 4, 6, 8, 11, 3, 12]
#
new_list = list(filter(lambda x: (x%2 == 0) , my_list))
#
print(new_list)                 # Output: [4, 6, 8, 12]
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ben-hurs-organization.gitbook.io/guia-de-appsec/cheat-sheets/utilitarios.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
