Skip to content

Instantly share code, notes, and snippets.

View msidave's full-sized avatar

Dave Neeley msidave

View GitHub Profile
@tanaikech
tanaikech / submit.md
Last active January 26, 2021 00:44
Retrieving Access Token using Service Account by Google's OAuth2 package

Retrieving Access Token using Service Account by Google's OAuth2 package for Golang

This is a sample golang script for retrieving access token using Service Account of Google by Google's OAuth2 package.

The script without using Google's OAuth2 package is here.

package main

import (
 "encoding/json"
@briangershon
briangershon / gist:fa9feb08e6a65d52bdc35c738d8cf104
Created January 8, 2017 07:57
Log Request Body for Debugging (golang)
buf, bodyErr := ioutil.ReadAll(r.Body)
if bodyErr != nil {
log.Print("bodyErr ", bodyErr.Error())
http.Error(w, bodyErr.Error(), http.StatusInternalServerError)
return
}
rdr1 := ioutil.NopCloser(bytes.NewBuffer(buf))
rdr2 := ioutil.NopCloser(bytes.NewBuffer(buf))
log.Printf("BODY: %q", rdr1)
@msafi
msafi / How to get your Google account-user ID.md
Last active February 28, 2026 17:09
How to get your Google account/user ID

Go to this link https://plus.google.com/me. The me part of the URL will be replaced by your Google user ID (a.k.a Google account ID)