Skip to content

Instantly share code, notes, and snippets.

View iamucil's full-sized avatar
:octocat:
Working remotelly.

iamucil iamucil

:octocat:
Working remotelly.
View GitHub Profile
@iamucil
iamucil / git_ssl_verify.md
Created April 7, 2021 04:45
How do I set GIT_SSL_NO_VERIFY for specific repos only?
fatal: unable to access 'https://baseurl/username/repo_name.git/': SSL certificate problem: unable to get local issuer certificate
error: Could not fetch upstream

Use this command to make git not verify ssl certificate. If you want to unverify all git repo use --global instead of --local. Run this inside your working directory.

git config --local http.sslVerify false
@iamucil
iamucil / auto load go(lang) code.md
Last active July 31, 2021 09:40
Auto loading go(lang) code dengan docker-compose

Autoloading go(lang) code menggunakan docker-compose

Buat docker file untuk development development.Dockerfile

FROM cosmtrek/air AS loader

FROM golang:1.16

WORKDIR /workspace
@iamucil
iamucil / generate_jwt_token_for_header_signature.js
Last active November 15, 2021 11:47
Postman Pre-Request script to generate JWT token from request body.
/*
https://jwt.io/introduction/
In its compact form, JSON Web Tokens consist of three parts separated by dots (.), which are:
Header
Payload
Signature
Therefore, a JWT typically looks like the following.

Run SQL script in maria/mysql db container

Run this script from your local machine,

docker exec -i CONTAINER_ID sh -c \
	'exec mysql -uroot -p"$MYSQL_ROOT_PASSWORD" YOUR_DATABASE' \
	< your_file.sql 
@iamucil
iamucil / rename_interface_any.md
Last active June 6, 2023 07:30
First thing to do after moving to go 1.19

Rename all interface{} to any

find . -type f -name "*.go" | xargs gofmt -w -r 'interface{} -> any' 
@iamucil
iamucil / extract.go
Created June 5, 2023 12:44
Extract metadata from pdf file
package pdflib
import (
"fmt"
"time"
"github.com/timemore/foundation/errors"
pdf "github.com/unidoc/unipdf/v3/model"
)