Skip to content

Instantly share code, notes, and snippets.

package main
import (
"context"
"fmt"
"log"
"math/rand"
"os"
"os/signal"
"sync"
@agtorre
agtorre / config.go
Last active December 26, 2019 12:13
Store OAuth2 Token Using Redis
type Config struct {
*oauth2.Config
Redis MyRedisInterface
}
func (c *Config) StoreToken(token *oauth2.Token) error {
//store the token in redis here using c.Redis
}
func (c *Config) Exchange(ctx context.Context, code string) (*oauth2.Token, error) {
@bkeepers
bkeepers / .gitconfig
Created February 19, 2013 14:12
Git aliases to make new commits that fixup or are squashed into previous commits
[alias]
fixup = !sh -c 'REV=$(git rev-parse $1) && git commit --fixup $@ && git rebase -i --autosquash $REV^' -
squash = !sh -c 'REV=$(git rev-parse $1) && git commit --squash $@ && git rebase -i --autosquash $REV^' -
@stevenh512
stevenh512 / gitconfig-git
Created June 11, 2012 10:51
URL rewriting in .gitconfig
# Use git and git+ssh instead of https
[url "git://github.com/"]
insteadOf = https://github.com/
[url "git@github.com:"]
pushInsteadOf = "git://github.com/"
[url "git@github.com:"]
pushInsteadOf = "https://github.com/"