Skip to content

Instantly share code, notes, and snippets.

@forstie
forstie / QBATCH job study.sql
Created May 30, 2021 17:10
I was asked to show how SQL could be used to analyze QBATCH subsystem job history. Super grouping to the rescue.
--
-- Subject: QBATCH Job Analysis
-- Author: Scott Forstie
-- Date : May 30, 2021
-- Note : This Gist leverages different built-in functions and grouping support to explore job history
--
-- ================================================================================================
--
-- description: 20 Jobs that ran (started and ended) the longest in QBATCH over the last 24 hours
@thatisuday
thatisuday / Dockerfile
Last active August 1, 2023 07:37
A sample Dockerfile to create Go image
# parent image
FROM golang:1.15.6-alpine3.12
# workspace directory
WORKDIR /app
# copy `go.mod` and `go.sum`
ADD go.mod go.sum ./
# install dependencies
@michaeljs1990
michaeljs1990 / main.go
Created July 17, 2020 05:26
Bleve _source example
package main
import (
"bytes"
"encoding/gob"
"fmt"
"github.com/blevesearch/bleve"
"github.com/blevesearch/bleve/document"
"github.com/blevesearch/bleve/index/scorch"
@jonstacks
jonstacks / Dockerfile
Created November 10, 2019 22:02
Golang Example of docker multi-stage build
FROM golang:1.13-alpine as builder
WORKDIR /my-proj
ADD . .
RUN CGO_ENABLED=0 go install ./cmd/my-cmd/...
FROM alpine:latest
COPY --from=builder /go/bin/my-cmd /usr/local/bin/my-cmd
ENTRYPOINT ["/usr/local/bin/my-cmd"]
@embano1
embano1 / README.MD
Created September 23, 2019 14:54
Dockerfile for Go modules and built cache efficiency

Also works across git branches if you keep the intermediate build images around, e.g. those <none> images in the docker images output.

FROM golang:1.12 AS builder

# enable Go modules support
ENV GO111MODULE=on

WORKDIR $GOPATH/src/github.com/myrepo/myapp
@mindlapse
mindlapse / guide.md
Last active September 7, 2021 15:05
A guide on how to use PaymentIntents with tipsi-stripe

Introduction

Card payments with Stripe should be performed with PaymentIntents.

This API was created to handle modern payments, where the cardholder's bank may require the user to authenticate themselves with the bank before a payment can be authorized.

Authentication requirements first started to appear with European banks regulated by PSD2 which introduced [Strong Customer Authentication

@ryu1kn
ryu1kn / README.md
Last active March 18, 2024 14:19
Getting GCP access token from a service account key JSON file

Getting GCP access token from a service account key

Use your service account's key JSON file to get an access token to call Google APIs.

Good for seeing how things work, including the creation of JWT token.

To create a JWT token, you can replace create-jwt-token.sh script with tools like step.

If you just want to get an access token for a service account,

apiVersion: v1
kind: Pod
metadata:
name: cockroachdb-client-secure
namespace: crdb
labels:
app: cockroachdb-client
spec:
serviceAccountName: cockroachdb
initContainers:
@wallyqs
wallyqs / go-mod-fixes.md
Last active February 22, 2020 04:09
NATS v2 & Go Modules

In case having issues during when using the recent versions of NATS such as:

go: github.com/nats-io/go-nats@v1.8.1: parsing go.mod: unexpected module path "github.com/nats-io/nats.go"
go: github.com/nats-io/go-nats-streaming@v0.5.0: parsing go.mod: unexpected module path "github.com/nats-io/stan.go"

To fix it:

  1. Update your go.mod using the latest tags, for example for both NATS and NATS Streaming clients:
@daubac402
daubac402 / Install Teamviewer, Start, Get ClientID and password on the Remote Mac machine via SSH - commandline.md
Last active September 24, 2023 03:29
Install Teamviewer, Start, Get ClientID and password on the Remote Mac machine via SSH - commandline

Requirement

  • Homebrew on the Remote Mac (if not, just install it via SSH)

Steps

# ssh to the remote Mac machine, then:
brew install caskroom/cask/brew-cask
brew cask install teamviewer