Skip to content

Instantly share code, notes, and snippets.

View thiagozs's full-sized avatar
:octocat:
Have a nice day

Thiago Zilli Sarmento thiagozs

:octocat:
Have a nice day
View GitHub Profile
@thiagozs
thiagozs / cron.go
Created March 30, 2022 14:07
Golang cronx test integration
package main
import (
"context"
"fmt"
"os"
"os/signal"
"github.com/adhocore/gronx/pkg/tasker"
)
@thiagozs
thiagozs / docker_arg_env.md
Created March 2, 2022 12:48
docker arg env and .env complete guide

Docker ARG, ENV and .env - a Complete Guide

Error: Docker image build failed.

Building Docker images and configuring your dockerized apps doesn’t have to be a try-fail-repeat Google extravaganza. This article will help you work with Docker ARG, ENV, env_file and .env files with confidence.

The only prerequisite: make sure that you’re comfortable with the basics of Docker.

@thiagozs
thiagozs / validates_phone.go
Created February 8, 2022 19:52
Validation phone numbers
package main
import (
"fmt"
"regexp"
"github.com/nyaruka/phonenumbers"
)
func main() {
@thiagozs
thiagozs / checkstruct.go
Last active January 28, 2022 17:04
check struct and values
package main
import (
"fmt"
"github.com/google/go-cmp/cmp"
)
type Model struct {
A int
@thiagozs
thiagozs / jsonraw.go
Created December 8, 2021 21:02
Json.RawMessage tests and pocs
package main
import (
"encoding/json"
"fmt"
"strconv"
"strings"
"github.com/shopspring/decimal"
//"github.com/shopspring/decimal"
@thiagozs
thiagozs / DoH_DNSoverHTTPS.md
Created November 29, 2021 21:16
DoH - DNS over HTTPS

DoH - DNS over HTTPS

DoH queries resolve over HTTPS for privacy, performance, and security. DoH also makes it easier to use a name server of your choice instead of the one configured for your system.

Spec

RFC 8484 - DNS Queries over HTTPS (DoH)

Publicly available servers

@thiagozs
thiagozs / date_in_range.go
Created November 24, 2021 18:37
Time and Date in range golang
package main
import (
"fmt"
"time"
)
func main() {
start_campain := DateHMS("America/Sao_Paulo", 0, 0, 0) // inicio campanha
@thiagozs
thiagozs / kubernetes.md
Created September 30, 2021 13:17
sheet codes development day

Kubectl Kubernetes Free CheatSheet

1.1 Common Commands

Run curl test temporarily

kubectl run --generator=run-pod/v1 --rm mytest --image=yauritux/busybox-curl -it

Run wget test temporarily

@thiagozs
thiagozs / todo_tree_cfg.json
Last active October 5, 2022 11:44
Todo Tree Config VSCode highlights
{
"workbench.colorTheme": "Default Dark+",
"go.alternateTools": {},
"editor.fontSize": 18,
"workbench.iconTheme": "material-icon-theme",
"editor.inlineSuggest.enabled": true,
"todo-tree.tree.autoRefresh": true,
"todo-tree.highlights.customHighlight": {
"BUG": {
"background": "#ff0000",
@thiagozs
thiagozs / backup_ssd.sh
Created September 2, 2021 17:11
Back sync folders
#! /bin/sh
# set -e
# function dismount()
# {
# if [ -d "\$mount_point" ]; then
# veracrypt --text --dismount "\$mount_point"
# fi
# }