Skip to content

Instantly share code, notes, and snippets.

@imantung
imantung / pg_logical_replication.md
Last active April 17, 2023 01:03
Posgres Logical Replication Notes

Postges Logical Replication

Overview

  • Table specific replicatlion
  • Support on postgres 10 above
  • Pub-sub model
  • Also known as Change Data Capture (CDC)
@imantung
imantung / google_script_helpdesk.js
Last active April 2, 2023 11:23
Example to enable generate unique ticket number and send notification for google form helpdesk
// Read more at: https://medium.com/@imantung/simple-helpdesk-using-google-forms-and-apps-script-ee3c755bb2b7
const TOAST_TIMEOUT = 3; // toast show for 3 sec
const FORM_SUBMIT_SHEETNAME = "Form Responses 1"
const TICKET_NO_LENGTH = 5;
const TICKET_NO_CHARSET = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
const SUPPORT_EMAIL = "support@example.com"
const SUPPORT_NAME = "Your Humble Support"
@imantung
imantung / jira.go
Created July 30, 2022 13:46
Golang fetch from jira
package main
import (
"fmt"
"log"
gojira "github.com/andygrunwald/go-jira"
)
// Example to fetch data from Jira
@imantung
imantung / aliyunoss_presigned_url.go
Created July 30, 2022 10:32
Golang create presigned url for Aliyun OSS
package main
import (
"fmt"
"log"
"github.com/aliyun/aliyun-oss-go-sdk/oss"
)
// Example create presigned url for Aliyun OSS
@imantung
imantung / gsheet.go
Last active April 17, 2023 00:48
Golang GSheet
package main
import (
"context"
"fmt"
"log"
"google.golang.org/api/option"
"google.golang.org/api/sheets/v4"
)
package coba;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.OutputKeys;
@imantung
imantung / ast_print_struct_fields.go
Created June 3, 2020 11:07
Print struct field using golang AST
package main
import (
"fmt"
"go/ast"
"go/parser"
"go/token"
)
var src = `package mypackage