Skip to content

Instantly share code, notes, and snippets.

View DipandaAser's full-sized avatar
😁
Compile...

Dipanda Aser DipandaAser

😁
Compile...
View GitHub Profile
@DipandaAser
DipandaAser / storage.go
Last active January 21, 2022 15:57
List all objects of a AWS S3 folder (bypass the limit of 1000 objects)
package storage
import (
"context"
_ "github.com/aws/aws-sdk-go-v2/feature/s3/manager"
"github.com/aws/aws-sdk-go-v2/service/s3"
"github.com/aws/aws-sdk-go-v2/service/s3/types"
_ "github.com/aws/aws-sdk-go-v2/service/s3/types"
)
@DipandaAser
DipandaAser / wsl-go-install.sh
Last active March 10, 2022 03:56 — forked from ScottJWalter/wsl-go-install.sh
Script to install Go 1.17 on Linux and WSL (Windows Subsystem for Linux)
#!/bin/bash
set -e
GVERSION="1.17"
GFILE="go$GVERSION.linux-amd64.tar.gz"
GOPATH="$HOME/projects/go"
GOROOT="/usr/local/go"
if [ -d $GOROOT ]; then
echo "Installation directories already exist $GOROOT"
@DipandaAser
DipandaAser / Makefile
Created May 24, 2021 15:00
Makefile for golang cross-compile binaries (linux, macOS, windows)
APPNAME=app
## build: build application binary.
build:build-windows build-linux build-macOS
@echo "Build done!"
build-windows:build-windows-32 build-windows-64
@echo "Windows Build done!"
build-windows-64:
@DipandaAser
DipandaAser / replace.js
Last active May 31, 2021 11:14
Replace substring in mongodb documents using NosqlBooster
db.File.find({}).forEach(function(document) {
if (document.PublicLink.startsWith("http")) {
document.PublicLink = document.PublicLink.replace("http", "https")
}
db.File.save(document)
})
@DipandaAser
DipandaAser / collectionPreRequestScript.js
Created April 21, 2021 10:27
Automate login and re-login to refresh token
var moment = require('moment');
var tokenExpirationDate = pm.collectionVariables.get("token-expiration-date");
var currentTime = moment().format();
if ( (tokenExpirationDate === "") || (currentTime >= tokenExpirationDate) ){
pm.sendRequest({
url: pm.collectionVariables.get("local-url") + '/login',
method: 'POST',