Skip to content

Instantly share code, notes, and snippets.

View efontan's full-sized avatar
:shipit:

Emmanuel Fontán efontan

:shipit:
View GitHub Profile
@efontan
efontan / main.go
Created June 1, 2020 15:31
Clone repository with go-git using SSH Deploy Key
package main
import (
"fmt"
"log"
"os"
"strings"
"github.com/go-git/go-billy/v5/memfs"
gogit "github.com/go-git/go-git/v5"
@efontan
efontan / go.json
Created July 27, 2020 21:44
My VSCode Go snippets
{
"Service with constructor": {
"prefix": "service",
"body": [
"type $1 struct {",
"}\n",
"func New${1/(.*)/${1:/capitalize}/}() (*$1, error) {",
"\treturn &$1{}, nil",
"}",
],
@efontan
efontan / move-wsl2.md
Last active March 13, 2021 09:14
Move WSL2 distro from C drive in Windows 10

Move WSL2 distro from C drive in Windows 10

choco install lxrunoffline
  • List installed distros:
wsl -l -v
 NAME STATE VERSION
@efontan
efontan / search_in_csv.py
Created April 5, 2021 21:11
Search in CSV with Python
#!/usr/bin/python
import csv
# input text you want to search
text = input("Input to search: ")
with open("/path/to/my/file.csv", "r") as f:
csv_file = csv.reader(f, delimiter=",")
# iterate over the csv list
@efontan
efontan / retrier.go
Created November 2, 2021 19:22
Golang simply retrier with exponential backoff
package retrier
import (
"time"
"github.com/pkg/errors"
)
type backoffRetrier struct {
initialDelay time.Duration