Skip to content

Instantly share code, notes, and snippets.

View brettski's full-sized avatar
👨‍🍳
Experimenting

Brett Slaski brettski

👨‍🍳
Experimenting
View GitHub Profile
@adamhjk
adamhjk / proto-annotate.toml
Last active January 15, 2020 04:50
What I mean about graphql
protoPackageName = "si.account"
service.Account.CreateAccount.skipauth = true
service.Account.CreateAccount.mutation = true
service.Account.GetBillingAccount.query = true
service.Account.CreateUser.mutation = true
service.Account.GetUser.query = true
service.Account.ListUsers.query = true
service.Account.ListWorkspaces.query = true
service.Account.ListOrganizations.query = true
@travisjeffery
travisjeffery / functional-options.md
Last active April 23, 2023 11:13
How to do functional options in Golang

Here's the simplest example showing how to do functional options in Golang.

They're a great way to enable users to set options and ease adding new options later.

package main

import (
	"flag"
	"fmt"
@6174
6174 / Random-string
Created July 23, 2013 13:36
Generate a random string in JavaScript In a short and fast way!
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);