Skip to content

Instantly share code, notes, and snippets.

View agtorre's full-sized avatar

Aaron Torres agtorre

View GitHub Profile
@agtorre
agtorre / revel_colorize.go
Last active January 1, 2016 20:49
The start of colorizing logs for revel using the new colorize package I'm developing
package main
import (
"colorize/colorize"
"fmt"
"log"
"os"
)
@agtorre
agtorre / gist:8204847
Last active January 1, 2016 21:39
colorize example
package main
import (
"fmt"
"github.com/agtorre/gocolorize"
"github.com/agtorre/gocolorize/paints"
)
func main() {
//stateful
package main
import (
"golang.org/x/oauth2/clientcredentials"
"golang.org/x/net/context"
)
func main(){
// this should match whatever service has given you
@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) {
1, 1, 10, 10, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 101100, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 001, 1, 0, 100100, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 01, 1, 0110000, 0, 0, 011, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 00, 0, 11, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 010, 1, 1, 11, 01, 00, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 01, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 010, 0, 111, 10, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 00, 1, 10, 0, 1, 1, 1, 1, 1, 0, 1, 1, 000, 1, 10, 10, 0, 1, 1, 0111, 1, 1, 1, 1, 11, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 11, 1, 110, 10, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 11, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 11, 1, 1, 0, 0, 111, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 110, 0,