Skip to content

Instantly share code, notes, and snippets.

View mrroot5's full-sized avatar
🏠
Working from home

Adrián mrroot5

🏠
Working from home
View GitHub Profile
@mrroot5
mrroot5 / import_postman_graphql_absinthe.md
Last active March 3, 2023 12:00
Import postman graphql absinthe

Import postman graphql absinthe

  • Go inside your container: docker exec -it <container_name> bash.
  • Generate sdl schema. Two ways:

This uses default application :schema configuration.

mix absinthe.schema.sdl
@mrroot5
mrroot5 / copy_docker_image_to_another_host.md
Last active January 11, 2023 10:23
Docker image copy from one host to another

Cómo copiar una imagen Docker de un host a otro sin usar un repositorio?

Necesitas guardad la imagen Docker como un fichero .tar:

docker save -o <path for generated tar file> <image name>

Ejemplo: docker save -o myfile.tar centos:16.

@mrroot5
mrroot5 / postgresql_in_docker_container.sh
Created October 27, 2022 12:47
Import postgres sql script inside docker container from host
cat <sql_name>.sql | docker exec -i <container_name> /usr/bin/psql -p <database_user_password> -U <database_user> -d <database_name>
@mrroot5
mrroot5 / development_cycle.md
Last active September 12, 2022 10:38
Ciclo de desarrollo cheatsheet - development cycle cheatsheet
flowchart TD
   id1(Asignarse un issue)
   %%id2(Mover el issue a 'In Progress')
   id3(Leerlo)
   id4{"Hacerme las preguntas de 'por qué' y 'para qué'.<br /> ¿Es aplicable?"}
   id5(Investigar sobre lo que no conozco)
   id6(Pensar y diseñar la solución)
   id7{"Le pregunto a un experto, ¿Es válido?"}
   id8(Lo programo)
@mrroot5
mrroot5 / install-letsencrypt-ubuntu.md
Created January 20, 2022 11:47
Install Letsencrypt cert. into a debian/ubuntu. Keywords: letsencrypt, ubuntu, ubuntu letsencrypt

Intro

How to set up letsencrypt on a debian/ubuntu machine. Step by step:

Update and install Certbot

$ apt update
# for apache-using web server
$ apt install certbot python3-certbot-apache
@mrroot5
mrroot5 / power-off-shutdown-desktop.md
Last active January 12, 2022 16:49
Power off button shutdown button. Keywords: ubuntu, power off, shutdown.

Intro

Create a button to shutdown the PC.

  • Create a .desktop file:
vim ~/.local/share/applications/shutdown-for-dock.desktop
@mrroot5
mrroot5 / elixir_type_protocol.ex
Created December 27, 2021 16:26
Elixir type protocol like Python. Keywrods: elixir, protocols, elixir protocols, type, elixir type, polymorphism, elixir polymorphism
defprotocol TypeProtocol do
@doc """
TypeProtocol checks a term type.
"""
@spec type(t) :: String.t()
def type(value)
end
defimpl TypeProtocol, for: Float do
@spec type(float) :: String.t()
@mrroot5
mrroot5 / elixir_utils_helper.md
Last active January 28, 2022 11:52
Elixir util / helper functions. Keywords: elixir, helpers, utils, elixir utils, elixir helpers.
@mrroot5
mrroot5 / elixir_cheatsheet.md
Last active January 21, 2022 09:51
Elixir cheatsheet. Keywords: elixir, how to, elixir how to, cheatsheet, elixir cheatsheet

Intro

Elixir cheat sheet with a question and explanation.

How to print a list of integers avoiding ASCII conversion?

numbers_list = [104, 101, 108, 108, 111]
# Output:hello
@mrroot5
mrroot5 / programatically_create_dataclass.md
Last active November 16, 2021 07:10
Crear dataclass en python dinámicamente. Convertir pydantic schema a dataclass. Keywords: python, dataclass, python dataclasss, pydantic, schema, pydantic schema

Intro

Creación dinámica de una dataclass. Puede ser útil, por ejemplo, para convertir un schema de pydantic en un dataclass.

Requisitos

Python >= 3.7.

Ejemplo de uso