Skip to content

Instantly share code, notes, and snippets.

View rusenask's full-sized avatar
🤔
why is there a status message field on github?

Karolis Rusenas rusenask

🤔
why is there a status message field on github?
View GitHub Profile
[
{
"id": "gapp_1",
"name": "Uptime Kuma",
"description": "monitoring",
"website": "https://github.com/louislam/uptime-kuma",
"manifestUrl": "https://raw.githubusercontent.com/synpse-hq/synpse/feature/appstore/apps/uptime-kuma.yaml",
"tags": [],
"thumbnail": "https://raw.githubusercontent.com/louislam/uptime-kuma/master/public/icon.svg",
"author": "Louis Lam",
{
"cat": {
"size": "small",
"price": 50
},
"dog": {
"size": "medium",
"price": 120
},
"cow": {
{
"nothing": "here"
}
nothing-here
# This file contains the contact information for repositories exposed through
# the Sunstone registry. Each repository has an alias, a url to a file and
# one or more maintainers.
#
# The structure of the repositories object is:
# repositories:
# - alias: example
# url: https://example.com/deployment.yaml
# maintainers:
# - name: foo
unc (m *FirestoreBinManager) BinDelete(ctx context.Context, binID string) error {
_, err := m.client.Collection(m.binsCollection).Doc(binID).Delete(ctx)
if err != nil {
m.logger.Errorw("failed to delete bin doc by ref",
"error", err,
)
}
// Now, get all the requests and delete them in a batch request
iter := m.client.Collection(m.reqsCollection).Where("Bin", "==", binID).Documents(ctx)
numDeleted := 0
func (m *BinManager) BinPut(ctx context.Context, b *bin.Bin) (err error) {
b.Requests = nil
encoded, err := proto.Marshal(b)
if err != nil {
return err
}
return m.storage.Store(ctx, "bins/"+b.Id, encoded, nil)
}
...
// store package
func (m *FirestoreBinManager) BinPut(ctx context.Context, b *bin.Bin) (err error) {
_, err = m.client.Collection(m.binsCollection).Doc(b.GetId()).Set(ctx, b)
return err
}
func NewFirestoreBinManager(opts *FirestoreBinManagerOpts) (*FirestoreBinManager, error) {
ctx := context.Background()
var options []option.ClientOption
if opts.CredsFile != "" {
options = append(options, option.WithCredentialsFile(opts.CredsFile))
}
// credentials file option is optional, by default it will use GOOGLE_APPLICATION_CREDENTIALS
// environment variable, this is a default method to connect to Google services
client, err := firestore.NewClient(ctx, opts.ProjectID, options...)
if err != nil {
@rusenask
rusenask / docker-compose.yaml
Last active August 16, 2019 14:08
Webhook forwarder tiny template
# Also, create an .env file with configuration
# RELAY_KEY=
# RELAY_SECRET=
# BUCKET=
version: '3.2'
services:
webhookrelay:
container_name: webhookrelay
image: webhookrelay/webhookrelayd:latest
restart: unless-stopped