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
package main
import (
"fmt"
"strings"
"database/sql"
)
const (
SQL_INSERT = "INSERT INTO %s (%s) VALUES (%s)"
@thiagozs
thiagozs / string_check_equalfold.go
Created October 24, 2020 12:42
String check with equal fold
package main
import (
"fmt"
"strings"
)
var (
ASK_SIDE = "ask"
BID_SIDE = "bid"
@thiagozs
thiagozs / checkorder_test.go
Last active September 28, 2020 13:36
Check Order
package handlers
import (
"context"
"fmt"
"io/ioutil"
"path/filepath"
"strings"
"testing"
"time"
@thiagozs
thiagozs / Dockerfile
Created June 22, 2020 22:18
Docker two stage builder
FROM alpine:3.9 as builder
ENV VERSION=v12.16.2 NPM_VERSION=6 YARN_VERSION=latest
LABEL maintainer="Thiago Zilli Sarmento <[email protected]>"
LABEL builder="builder"
RUN apk upgrade --no-cache -U && \
apk add --no-cache \
ca-certificates \
package main
import (
"fmt"
"log"
"net/http"
"time"
)
// the amount of time to wait when pushing a message to
@thiagozs
thiagozs / reducereven.go
Created May 26, 2020 20:15
Challenge QuintoAndar
package main
import (
"fmt"
)
func main() {
A := []int{0, 3, 3, 7, 5, 3, 11, 1}
B := []int{0, 3, 0, 7, 0, 0, 11, 0}
@thiagozs
thiagozs / minavgtwoslice.go
Created May 26, 2020 20:13
Challenge QuintoAndar
package main
import (
"fmt"
)
func main() {
A := []int{0, 3, 3, 7, 5, 3, 11, 1}
min_avg_value := (A[0] + A[1]) / 2.0 // mininal average
@thiagozs
thiagozs / phoneparse.go
Created May 26, 2020 18:33
Challenge QuintoAndar
package main
import (
"fmt"
"regexp"
)
const SEPARATOR = "-"
func main() {
@thiagozs
thiagozs / https-linux-dev.sh
Last active March 6, 2020 14:47
Running a localhost with https
# download mkcert
wget https://github.com/FiloSottile/mkcert/releases/download/v1.4.1/mkcert-v1.4.1-linux-amd64 -q --show-progress -o mkcert
chmod +x mkcert
sudo mv mkcert /usr/local/bin
# install mkcert
mkcert -install
# generate local certs and keys wildcard
@thiagozs
thiagozs / systemd-resolved.md
Created March 5, 2020 16:42
How to disable systemd-resolved in Ubuntu

How to disable systemd-resolved in Ubuntu

Stages

  • Disable and stop the systemd-resolved service:

      sudo systemctl disable systemd-resolved.service
      sudo systemctl stop systemd-resolved
    
  • Then put the following line in the [main] section of your /etc/NetworkManager/NetworkManager.conf: