Skip to content

Instantly share code, notes, and snippets.

👽
Writing code from another galaxy.

Douglas Miranda douglasmiranda

👽
Writing code from another galaxy.
View GitHub Profile
@douglasmiranda
douglasmiranda / choices.md
Created Jan 4, 2020
Django Field.choices alternative
View choices.md

Django Field.choices

I was never very fond of using that tuple of tuples and acessing those choices with something like choices[0].

In my latest projects I was using a solution of my own.

This:

@douglasmiranda
douglasmiranda / docker-client-go.md
Created May 8, 2019
Docker client API version mismatch: Error response from daemon: client version 1.40 is too new. Maximum supported API version is 1.39
View docker-client-go.md

When building things that will interact with the client/server you can have a mismatch of API versions.

This is a common way to get started with the Docker client in Go: (this will create a new client based on your environment settings for Docker)

cli, err := client.NewClientWithOpts(client.FromEnv)

You may face an error similar to:

View pull.go
package main
import (
"context"
"fmt"
"io/ioutil"
"os"
"github.com/containerd/containerd/content/local"
"github.com/containerd/containerd/images"
@douglasmiranda
douglasmiranda / ubuntu-dell-g3.md
Last active May 19, 2020
Ubuntu 16.04 Dell G3 series setup
View ubuntu-dell-g3.md
View gist:a58899729cc23accaeac1549bf65dccb
PYTHON
https://github.com/thumbor/thumbor
https://github.com/ufoym/cropman
https://github.com/agschwender/pilbox
JS
https://github.com/jwagner/smartcrop.js
GO
https://github.com/DarthSim/imgproxy
View gist:b055a19bf1e8a1bce8ecfded518f98e4
- https://github.com/thumbor/thumbor
- https://github.com/thumbor-community/aws
- https://github.com/Starou/django-thumborstorage
- https://github.com/ricobl/django-thumbor
@douglasmiranda
douglasmiranda / ansible.md
Last active May 21, 2020
Ansible: Notes, Errors and Solutions
View ansible.md

Ansible for Configuration Management

I'm using Ansible only for Configuration Management, the server is up and I want to configure users, install packages and configure them.

For infrastructure provisioning terraform.io is nice!

Currently, my deployment flow includes Drone.io/GitlabCI for CI/CD and Docker Swarm for orchestrating containers.

You can’t perform that action at this time.